Android Question Video play rtsp stream

fishwolf

Active Member
Licensed User
What is the best and simple solution in b4a for play a stream rtsp in mjpg format?

i'm using a sport cam, like sj4000

i search on forum, but are old threads.
i have tried wit VideoView, but doesn't work.

Thanks

B4X:
    vvv.Initialize("vvv")
    Activity.AddView(vvv,0,0,Activity.Width,Activity.Height)
    vvv.LoadVideo("rtsp", "rtsp://192.168.1.1/MJPG?W=640&H=360&Q=50&BR=3000000")
    vvv.Play
 

fishwolf

Active Member
Licensed User
ExoPlayer don't support rtsp format
FFMPeg wrapper doesn't work with my rtsp streaming (work fine with sample video)
VLC wrapper doesn't work with my rtsp streaming (work fine with sample video)
VLC application work fine with my streaming

it's a rtsp flow in motion jpeg, i think a simple encode.

suggestion?
 

Syd Wright

Well-Known Member
Licensed User
You may want to try Moster67's Vitamio library (version 5 or higher). I prefer it over FFMpeg and use it all the time for TV streams and videos.
 

fishwolf

Active Member
Licensed User
You may want to try Moster67's Vitamio library (version 5 or higher). I prefer it over FFMpeg and use it all the time for TV streams and videos.
this library is not
You may want to try Moster67's Vitamio library (version 5 or higher). I prefer it over FFMpeg and use it all the time for TV streams and videos.
Vitamio5 it's available only to donation.
Vitamio4 doen't work file.

It's strange that all libraries doen'st work fine.
 

moster67

Expert
Licensed User
Maybe a codec issue?
If you want you can send me the streaming link by PM and I can check on Monday.
 

Syd Wright

Well-Known Member
Licensed User
this library is not
I assume you mean "...is not free". True, but it is worth every penny of your donation.
Forget about older Vitamio versions. A lot of water has gone to the sea with these versions, with even a period during which Google blocked Vitamio 4.
 

KZero

Active Member
Licensed User
the native videoview supports rtsp , are you sure this url is valid

rtsp://192.168.1.1/MJPG?W=640&H=360&Q=50&BR=3000000

did you tried to open it in VLC ?
 

fishwolf

Active Member
Licensed User
the native videoview supports rtsp , are you sure this url is valid

rtsp://192.168.1.1/MJPG?W=640&H=360&Q=50&BR=3000000

did you tried to open it in VLC ?
yes, with vlc application work fine
with vlc library doesn't work fine
 

fishwolf

Active Member
Licensed User
Yes. There is no library. It is implemented in the class code and it is supported by B4A, B4J and B4i.
ok, i have tried to convert in a B4A project, but doesn't work fine, don't call the "mj1_frame" function

i have tried also with 554 port

B4X:
Sub Process_Globals
Private mj1 As MJPEG
End Sub

Sub Globals
Private ImageView1 As ImageView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("main")
      
    mj1.Initialize(Me, "mj1")
    mj1.Connect("rtsp://192.168.1.1/MJPG?W=640&H=360&Q=50&BR=3000000", 1935)
    Log("Activity_Create")
  
End Sub

Sub mj1_frame(bmp As Bitmap)
    Log("mj1_frame")
    ImageView1.Bitmap = bmp
End Sub
 

fishwolf

Active Member
Licensed User
See the example. You shouldn't add the scheme (rtsp://).
it's equal :(

i have sniffed the traffic from original app and action cam the port is the 554 for init protocol, but after the stream is 15740 port.

also if i open this port, doesn't work fine

B4X:
RTSP/1.0 200 OK
CSeq: 3
Date: 2012/1/1
Content-Base: rtsp://192.168.1.1/MJPG?W=640&H=360&Q=50&BR=3000000/
Content-Type: application/sdp
Content-Length: 322

v=0
o=- 930519206 1 IN IP4 192.168.1.1
s=Motion JPEG. Streamed by iCatchTek.
i=MJPG
t=0 0
a=tool:iCatchTek
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Motion JPEG. Streamed by iCatchTek.
a=x-qt-text-inf:MJPG
m=video 0 RTP/AVP 26
c=IN IP4 0.0.0.0
b=AS:12288
a=frmerate:30.0
a=control:track1
 
Last edited:
Top