mdk-sdk icon indicating copy to clipboard operation
mdk-sdk copied to clipboard

Can't play rtsp stream without sound

Open lukegluke opened this issue 4 years ago • 9 comments

Took an example from https://github.com/wang-bin/mdk-examples/issues/9 and changed a player source to "rtsp://192.168.1.57:8080/h264_ulaw.sdp" to connect to virtual local ip camera - the android smartphone with running IP Webcam app. It works if sound is turned on in IP Webcam app, but not shown anything if video is streamed without sound. Vlc plays in both cases.

Windows 10 Qt 5.9.5, MinGW 5.3.0 32bit MDK 0.11.0 (git 6dd01c9)

lukegluke avatar Apr 11 '21 13:04 lukegluke

I have no such rtsp stream. but a local video file without audio works for me.

wang-bin avatar Apr 12 '21 09:04 wang-bin

I forgot to paste link to IP Webcam app: https://play.google.com/store/apps/details?id=com.pas.webcam Maybe you have opportunity to test with it using Android phone.

lukegluke avatar Apr 12 '21 09:04 lukegluke

can you send me an apk? I'm unable to install apps from google play in my country

wang-bin avatar Apr 12 '21 10:04 wang-bin

Ok, I've download it from https://apkpure.com/ip-webcam/com.pas.webcam

IP Webcam_v1.14.37.759 (aarch64)_apkpure.com.zip

lukegluke avatar Apr 12 '21 10:04 lukegluke

Can you try glfwplay example in the sdk? I'm failed to open the rtsp stream using mdk, ffplay and vlc.

wang-bin avatar Apr 13 '21 01:04 wang-bin

Sorry, I don't have tools to build it. On my side I'm able to play rtcp stream from IP Webcam apk using vlc.

lukegluke avatar Apr 19 '21 07:04 lukegluke

glfwplay is a prebuilt binary in mdk-sdk/bin

wang-bin avatar Apr 19 '21 10:04 wang-bin

Ah, ok. I got the same result: it works only if sound is turned on in IP Webcam app, otherwise nothing - black screen.

lukegluke avatar Apr 19 '21 11:04 lukegluke

Finally I can play the rtsp stream generated by this app. Here is the MediaInfo printed by mdk

Format: rtsp, range: 99 +0ms, bitrate: 0, size: 0
Metadata:
  title: IP Webcam
Streams: 2
 Audio:
  stream#1, range: -209146758205323714 +0ms, frames: 0
  codec: pcm_s16be tag: 0 profile: -99 level: -99, sample size: 0/16, s16 mono(1) @44100Hz, bitrate: 705600
 Video:
  stream#0, range: 99 +0ms, frames: 0
  codec: h264 tag: 0 profile: 578 level: 40, sample size: 8/0, yuv420p, bpc:8, bpp:12(8,8,8), bitrate: 0, 1920x1080, fps: 90000, bframes: 0
D 2021-04-22 22:19:59.201@0x16c233000:   extra data(28): 00 00 00 01 67 42 C0 28 8C 8D 40 3C 01 12 F2 C0 3C 22 11 A8 00 00 00 01 68 CE 3C 80 

The stream contains an invalid audio track, so video can not sync to audio. You can call player.setActiveTracks(MediaType::Audio, {}) to disable audio track, then video displays correctly.

wang-bin avatar Apr 22 '21 14:04 wang-bin

fixed in the latest build

wang-bin avatar Nov 13 '23 15:11 wang-bin