Android Question Video play rtsp stream

fishwolf

Well-Known Member
Licensed User
Longtime 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

Well-Known Member
Licensed User
Longtime 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?
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime 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.
 
Upvote 0

moster67

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

KZero

Active Member
Licensed User
Longtime 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 ?
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime 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
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime 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
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime 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:
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
mjpeg decoder is a simple implementation of a http client. It will not follow redirections.

Any suggestion for this simple problem?

i have tried vlc library, i have see that vlc application work fine, but example work fine only with http stream
 
Upvote 0
Top