Sync audio and video in RTSP server

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Sync audio and video in RTSP server

bomba
I've got an RTSP server flowing like:

gst_rtsp_media_factory_set_launch (factory, "( "
                  // video
                 "v4l2src ! video/x-raw,width=640,height=480,framerate=30/1 ! "
                 "x264enc ! queue ! rtph264pay config-interval=1 name=pay0 pt=96 ! "
                  // audio
                 "filesrc location=/dev/ttyUSB0 do-timestamp=true ! "
                 "audio/x-alaw,rate=8000,channels=1 ! queue ! rtppcmapay name=pay1 pt=97"
                  " )");

 /dev/ttyUSB0 gives VS1063A encoder g.711 A law output.


I can successfully play the stream with: gst-launch-1.0 -v playbin uri=rtsp://my.ip:8554/source

But the audio is 500ms~ later than the video. Is there any way to fix this?
Reply | Threaded
Open this post in threaded view
|

Re: Sync audio and video in RTSP server

dfussia
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Sync audio and video in RTSP server

bomba
Actually, changing from

 // audio
                 "filesrc location=/dev/ttyUSB0 do-timestamp=true ! "
                 "audio/x-alaw,rate=8000,channels=1 ! queue ! rtppcmapay name=pay1 pt=97"
                  " )");

to

 // audio
                 "filesrc location=/dev/ttyUSB0 do-timestamp=true ! "
                 "audio/x-alaw,rate=8000,channels=1 ! queue ! "
                 "alawdec ! alawenc ! rtppcmapay name=pay1 pt=97"
                  " )");

Fixed the problem. That makes me think of different formed alaw than the expected. Is there any parser for alaw?
Reply | Threaded
Open this post in threaded view
|

Re: Sync audio and video in RTSP server

Tim Müller
On Thu, 2016-07-21 at 16:16 -0700, bomba wrote:

> Fixed the problem. That makes me think of different formed alaw than
> the expected. Is there any parser for alaw?

 audioparse raw-format=encoded format=alaw rate=8000 channels=1

Might also be worth checking if filesrc actually puts timestamps on the
buffers.

Cheers
-Tim

--

Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel