xvidenc + libmp3lame out of sync...

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

xvidenc + libmp3lame out of sync...

Andrea-2
Hi,

I'm using the following command line (with reference to some shell
variables) to download streams from Italian broadcast RAI.TV:

gst-launch-0.10 rtspsrc location="$URL" \
  ! decodebin2 name=decoder \
  decoder. \
  ! queue \
  ! xvidenc bitrate=$VBT \
  ! mux. \
  decoder. \
  ! audioconvert \
  ! audioresample \
  ! audio/x-raw-int, rate=44100 \
  ! lamemp3enc target=bitrate cbr=true bitrate=128 \
  ! queue \
  ! mux. \
  avimux name=mux \
  ! filesink location="$DEST"

It usually works, but sometimes the resulting videos go out of sync
after some minutes. Some other times audio and video are slightly out of
sync constantly throughout the show.

I'm not a developer, I simply try to use gstreamer for very simple
applications. I wander if the above pipeline misses something that is
needed to guarantee the sync.

Here are some example for $URL:

rtsp://wms2.rai.it/raitrecdn/raitre/ulisse/Ulisse_PUNTATE/156723.wmv
rtsp://wms2.rai.it/raitrecdn/raitre/ulisse/Ulisse_PUNTATE/433069.wmv

Any hint would be very much appreciated.

Best regards.
--
Andrea <sarkiaponius'at'alice.it>
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: xvidenc + libmp3lame out of sync...

Wim Taymans
On 05/16/2012 05:10 PM, andrea wrote:

> Hi,
>
> I'm using the following command line (with reference to some shell
> variables) to download streams from Italian broadcast RAI.TV:
>
> gst-launch-0.10 rtspsrc location="$URL" \
>    ! decodebin2 name=decoder \
>    decoder. \
>    ! queue \
>    ! xvidenc bitrate=$VBT \
>    ! mux. \
>    decoder. \
>    ! audioconvert \
>    ! audioresample \
>    ! audio/x-raw-int, rate=44100 \
>    ! lamemp3enc target=bitrate cbr=true bitrate=128 \
>    ! queue \
>    ! mux. \
>    avimux name=mux \
>    ! filesink location="$DEST"
>
> It usually works, but sometimes the resulting videos go out of sync
> after some minutes. Some other times audio and video are slightly out of
> sync constantly throughout the show.

rtspsrc buffer-mode=none might make things better. You might also have
better results with
qtmux because it can preserve timestamps better.

Wim

>
> I'm not a developer, I simply try to use gstreamer for very simple
> applications. I wander if the above pipeline misses something that is
> needed to guarantee the sync.
>
> Here are some example for $URL:
>
> rtsp://wms2.rai.it/raitrecdn/raitre/ulisse/Ulisse_PUNTATE/156723.wmv
> rtsp://wms2.rai.it/raitrecdn/raitre/ulisse/Ulisse_PUNTATE/433069.wmv
>
> Any hint would be very much appreciated.
>
> Best regards.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: xvidenc + libmp3lame out of sync...

Andrea-2
On Wed, 2012-05-16 at 17:19 +0200, Wim Taymans wrote:

> On 05/16/2012 05:10 PM, andrea wrote:
> > Hi,
> >
> > I'm using the following command line (with reference to some shell
> > variables) to download streams from Italian broadcast RAI.TV:
> >
> > gst-launch-0.10 rtspsrc location="$URL" \
> >    ! decodebin2 name=decoder \
> >    decoder. \
> >    ! queue \
> >    ! xvidenc bitrate=$VBT \
> >    ! mux. \
> >    decoder. \
> >    ! audioconvert \
> >    ! audioresample \
> >    ! audio/x-raw-int, rate=44100 \
> >    ! lamemp3enc target=bitrate cbr=true bitrate=128 \
> >    ! queue \
> >    ! mux. \
> >    avimux name=mux \
> >    ! filesink location="$DEST"
> >
> > It usually works, but sometimes the resulting videos go out of sync
> > after some minutes. Some other times audio and video are slightly out of
> > sync constantly throughout the show.
>
> rtspsrc buffer-mode=none might make things better. You might also have
> better results with
> qtmux because it can preserve timestamps better.

buffer-mode=none gave better results in some cases. Some other cases are
more difficult, I don't know why. It could well be the overall source
quality, that I could not check because I have no time to stay here
watching a two hours video.

Concerning qtmux, can it create AVI files as well as avimux?

Best regards.

>
> Wim
> >
> > I'm not a developer, I simply try to use gstreamer for very simple
> > applications. I wander if the above pipeline misses something that is
> > needed to guarantee the sync.
> >
> > Here are some example for $URL:
> >
> > rtsp://wms2.rai.it/raitrecdn/raitre/ulisse/Ulisse_PUNTATE/156723.wmv
> > rtsp://wms2.rai.it/raitrecdn/raitre/ulisse/Ulisse_PUNTATE/433069.wmv
> >
> > Any hint would be very much appreciated.
> >
> > Best regards.
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

--
Andrea <sarkiaponius'at'alice.it>
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: xvidenc + libmp3lame out of sync...

Tim-Philipp Müller-2
In reply to this post by Andrea-2
On Wed, 2012-05-16 at 17:10 +0200, andrea wrote:

Hi,

> I'm using the following command line (with reference to some shell
> variables) to download streams from Italian broadcast RAI.TV:
>
> gst-launch-0.10 rtspsrc location="$URL" \
>   ! decodebin2 name=decoder \
>   decoder. \
>   ! queue \
>   ! xvidenc bitrate=$VBT \
>   ! mux. \
>   decoder. \
>   ! audioconvert \
>   ! audioresample \
>   ! audio/x-raw-int, rate=44100 \
>   ! lamemp3enc target=bitrate cbr=true bitrate=128 \
>   ! queue \
>   ! mux. \
>   avimux name=mux \
>   ! filesink location="$DEST"
>
> It usually works, but sometimes the resulting videos go out of sync
> after some minutes. Some other times audio and video are slightly out of
> sync constantly throughout the show.
> Any hint would be very much appreciated.

If you're muxing into AVI, you might need the following:

 * audiorate tolerance=40000000 before the audio encoder

 * videorate before the video encoder

Cheers
 -Tim

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel