B4J Question I can play rtmp streaming in b4j

Magma

Expert
Licensed User
Longtime User
For B4J - I think Mediaview will be ok...
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
hi,
thanks for your help.
I have tried to use the following command:

MediaView1.Source = "rtmp://161.97.64.221/test/test":

and it throws me an error:
1653413693806.png
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
a greek local tv station/streaming... that works...now
B4X:
    MediaView1.Source = "https://www.hellasnet.tv/rest.live.hn/trt2/playlist.m3u8"

Sorry for asking... is that a streaming server you are running..?? maybe you must open some ports... first check with a other player... like VLC, Windows Media Player... etc..
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
Hi, thanks for taking an interest in my topic.

I am using wirecast for transmission.
and I'm transmitting from my computer.
tonight it was off
And from vlc it works correctly.

1653471846204.png


1653471959555.png
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
I have seen a solution, but it is necessary to install the vlc player, and I do not see it very convenient since the final application is for my clients

the ideal is to install a standalone application
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
1st) Download 64bit VLC from https://www.videolan.org

1653475389845.png


2) Download this library of member: moster67 and any file needed (JAR, all zips, libs, sourcecode of demo)


3) Edit the source code - of his demo and replace these subs with:

Sub btnPlay_Action
B4X:
Sub btnPlay_Action
    'If MediaFile <> "" Or MediaFile.Length > 0 Then
        StopAndPlayMedia
    'Else
    '    Log("no media file selected")
    'End If
End Sub

sub StopAndPlayMedia
B4X:
Sub StopAndPlayMedia
    If vlc.IsPlaying Then
        vlc.Stop
    End If
    ShowDragButtons(False)
    vlc.Play("rtmp://161.97.64.221/adictos/tutorial")
    vlc.SetVolume(50)
    VolLevel = 50
    
    'Note: you can also play streaming media sources
    'vlc.Play(http://www.storiesinflight.com/js_videosub/jellies.mp4)
    
End Sub

..just hit "Play"...
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
1st) Download 64bit VLC from https://www.videolan.org

View attachment 129599

2) Download this library of member: moster67 and any file needed (JAR, all zips, libs, sourcecode of demo)


3) Edit the source code - of his demo and replace these subs with:

Sub btnPlay_Action
B4X:
Sub btnPlay_Action
    'If MediaFile <> "" Or MediaFile.Length > 0 Then
        StopAndPlayMedia
    'Else
    '    Log("no media file selected")
    'End If
End Sub

sub StopAndPlayMedia
B4X:
Sub StopAndPlayMedia
    If vlc.IsPlaying Then
        vlc.Stop
    End If
    ShowDragButtons(False)
    vlc.Play("rtmp://161.97.64.221/adictos/tutorial")
    vlc.SetVolume(50)
    VolLevel = 50
   
    'Note: you can also play streaming media sources
    'vlc.Play(http://www.storiesinflight.com/js_videosub/jellies.mp4)
   
End Sub

..just hit "Play"...
Thank you!!!!
 
Upvote 0

jose luis gudino

Active Member
Licensed User
Longtime User
hi.
the solution was to install a library on the server in which the source of the
origin is rtmp and converted to hls, using nginx and ffmpeg for
the broadcast.

From the linux command line:

ffmpeg -i ./video.mp4 -c:v libx264 -preset medium -maxrate 3000k -bufsize 6000k -vf "scale=1280:-1,format=yuv420p" -g 50 -c:a aac -b:a 128k -ac 2 -ar 44100 -f flv rtmp://192.168.1.55/hls/stream

the transmission would be:



1653596409790.png
 
Upvote 0
Top