Video+Audio together stutter (but not separately)

fadnavis harsh.fad at gmail.com
Sun Mar 27 18:17:48 UTC 2016


Hello all,

I have been stuck on this issue for past few days and would appreciate if
someone can guide me in the right direction. 
I am building a pipeline to stream video (with audio) over UDP from my
Raspberry Pi to Android. 

When I build a gstreamer pipeline for video-only streaming, it works fine.
The video renders smoothly and perfectly even on my old Galaxy Nexus without
any glitches or stuttering. Similarly, when I build an audio-only pipeline
to stream from the Pi to Android, everything works fine again. No glitches
or stuttering in the audio.

However, when I create a pipeline to play both together - this is where the
problem starts. When both are streamed, the video and audio both stutter a
lot. Here is the pipeline I have built - 

SENDER:
gst-launch-1.0 filesrc location=/path/to/file.mp4 ! qtdemux name=demux
demux.audio_0 ! queue ! rtpmp4apay ! udpsink host=<Target IP> port=5001
demux.video_0 ! queue !  decodebin ! jpegenc ! rtpjpegpay ! udpsink
host=<Target IP> port=5000

RECEIVER:
udpsrc port=5000 caps="application/x-rtp" ! rtpjpegdepay ! decodebin !
videoscale ! autovideosink  udpsrc port=5001
caps="application/x-rtp,media=(string)audio,clock-rate=(int)44100,encoding-name=(string)MP4A-LATM,cpresent=(string)0,config=(string)40002420,payload=(int)96,ssrc=(uint)1152421420,timestamp-offset=(uint)3767852666,seqnum-offset=(uint)2211"
! rtpmp4adepay ! decodebin ! queue ! audioconvert ! autoaudiosink 

I have also tried adding "sync=false" at the end of both sinks on the
receiver but the behavior is the same. I did some research around this and
guessed there could be three reasons :

a) Bad timestamps
b) Android CPU not powerful enough to render both audio and video together
(remember - individual pipelines work fine. Also, same behavior on a
powerful OnePlus one device with 3GB RAM)
c) Data is being read from the buffer faster than it is being fed into it -
this is called underflow right? (or could it be overflow? I doubt though)

I'd appreciate if someone can help me understand if it is one of these three
issues or could it be something else? Even if the issue is amongst the
above, I have no idea how to solve it. 

Thanks in advance.

Cheers,
Fadnavis





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Video-Audio-together-stutter-but-not-separately-tp4676599.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list