Gstreamer synch/drop problems.

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

Gstreamer synch/drop problems.

Jaka Hudoklin
Hello!

I have the following script to start stream and record to avi file.
gst-launch-0.10 \
        v4l2src device=/dev/video0 ! queue ! ffmpegcolorspace ! tee name=raw_camera \
        v4l2src device=/dev/video1 ! queue ! ffmpegcolorspace ! tee name=raw_camera2 \
        raw_camera. ! videorate ! \
                video/x-raw-yuv,framerate=20/1 ! tee name=t_video1 \
        raw_camera2. ! videoscale ! video/x-raw-yuv,width=133,height=100 ! videorate ! \
                video/x-raw-yuv,framerate=20/1 ! tee name=t_video2 \
        multifilesrc location="logo.png" caps="image/png,framerate=1/1" ! pngdec ! freeze ! alpha method=0 alpha=1 ! ffmpegcolorspace$
        videomixer name=pip sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0 sink_1::xpos=449 sink_1::ypos=334 sink_1::alpha=0.8 sink_1$
        alsasrc device=hw:0,0 ! queue ! audio/x-raw-int,rate=44100,depth=16,channels=2,signed$
        t_video1. ! queue ! pip.sink_0 \
        t_video2. ! queue ! pip.sink_1 \
        t_logo. ! queue ! pip.sink_2 \
        t_video. ! queue ! vp8enc ! queue ! avimux name=mux ! filesink location=test.avi sync=false \
        t_audio. ! audioconvert ! alawenc ! .mux

The problem is with mux component, which doesn't want to mix audio and video together and just drops frames. If i change last two lines to:
        t_video. ! queue ! vp8enc ! queue ! filesink location=test.vid sync=false \
        t_audio. ! audioconvert ! alawenc ! filesink location=test.snd sync=false
everything works fine, except that i don't get muxed audio and video. I can see in log that videframes have timestamps starting from 0, but audio has timestamps, from some higher numbers. Could this be the problem? Does anybody have any idea what could be the problem and why avimux doesn't mix streams? It's clearly problem with gstreamere and not hardware, because in case no. 2 cpu is not nearly fully loaded.

Have a nice day, Jaka Hudoklin.

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

Re: Gstreamer synch/drop problems.

Stefan Sauer
On 09/15/11 11:22, Jaka Hudoklin wrote:
Hello!

I have the following script to start stream and record to avi file.
gst-launch-0.10 \
        v4l2src device=/dev/video0 ! queue ! ffmpegcolorspace ! tee name=raw_camera \
        v4l2src device=/dev/video1 ! queue ! ffmpegcolorspace ! tee name=raw_camera2 \
        raw_camera. ! videorate ! \
                video/x-raw-yuv,framerate=20/1 ! tee name=t_video1 \
        raw_camera2. ! videoscale ! video/x-raw-yuv,width=133,height=100 ! videorate ! \
                video/x-raw-yuv,framerate=20/1 ! tee name=t_video2 \
        multifilesrc location="logo.png" caps="image/png,framerate=1/1" ! pngdec ! freeze ! alpha method=0 alpha=1 ! ffmpegcolorspace$
        videomixer name=pip sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0 sink_1::xpos=449 sink_1::ypos=334 sink_1::alpha=0.8 sink_1$
        alsasrc device=hw:0,0 ! queue ! audio/x-raw-int,rate=44100,depth=16,channels=2,signed$
        t_video1. ! queue ! pip.sink_0 \
        t_video2. ! queue ! pip.sink_1 \
        t_logo. ! queue ! pip.sink_2 \
        t_video. ! queue ! vp8enc ! queue ! avimux name=mux ! filesink location=test.avi sync=false \
        t_audio. ! audioconvert ! alawenc ! .mux

The problem is with mux component, which doesn't want to mix audio and video together and just drops frames. If i change last two lines to:
        t_video. ! queue ! vp8enc ! queue ! filesink location=test.vid sync=false \
        t_audio. ! audioconvert ! alawenc ! filesink location=test.snd sync=false
everything works fine, except that i don't get muxed audio and video. I can see in log that videframes have timestamps starting from 0, but audio has timestamps, from some higher numbers. Could this be the problem? Does anybody have any idea what could be the problem and why avimux doesn't mix streams? It's clearly problem with gstreamere and not hardware, because in case no. 2 cpu is not nearly fully loaded.

This could be a bug in avimux (file a bug). Try also some more modern format e.g. mp4mux.

Stefan

Have a nice day, Jaka Hudoklin.
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


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

Re: Gstreamer synch/drop problems.

Jaka Hudoklin
It was weird problem with audio card. Just needed to restart computer. Tnx anyway.

On Fri, Sep 16, 2011 at 10:13 PM, Stefan Sauer <[hidden email]> wrote:
On 09/15/11 11:22, Jaka Hudoklin wrote:
Hello!

I have the following script to start stream and record to avi file.
gst-launch-0.10 \
        v4l2src device=/dev/video0 ! queue ! ffmpegcolorspace ! tee name=raw_camera \
        v4l2src device=/dev/video1 ! queue ! ffmpegcolorspace ! tee name=raw_camera2 \
        raw_camera. ! videorate ! \
                video/x-raw-yuv,framerate=20/1 ! tee name=t_video1 \
        raw_camera2. ! videoscale ! video/x-raw-yuv,width=133,height=100 ! videorate ! \
                video/x-raw-yuv,framerate=20/1 ! tee name=t_video2 \
        multifilesrc location="logo.png" caps="image/png,framerate=1/1" ! pngdec ! freeze ! alpha method=0 alpha=1 ! ffmpegcolorspace$
        videomixer name=pip sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0 sink_1::xpos=449 sink_1::ypos=334 sink_1::alpha=0.8 sink_1$
        alsasrc device=hw:0,0 ! queue ! audio/x-raw-int,rate=44100,depth=16,channels=2,signed$
        t_video1. ! queue ! pip.sink_0 \
        t_video2. ! queue ! pip.sink_1 \
        t_logo. ! queue ! pip.sink_2 \
        t_video. ! queue ! vp8enc ! queue ! avimux name=mux ! filesink location=test.avi sync=false \
        t_audio. ! audioconvert ! alawenc ! .mux

The problem is with mux component, which doesn't want to mix audio and video together and just drops frames. If i change last two lines to:
        t_video. ! queue ! vp8enc ! queue ! filesink location=test.vid sync=false \
        t_audio. ! audioconvert ! alawenc ! filesink location=test.snd sync=false
everything works fine, except that i don't get muxed audio and video. I can see in log that videframes have timestamps starting from 0, but audio has timestamps, from some higher numbers. Could this be the problem? Does anybody have any idea what could be the problem and why avimux doesn't mix streams? It's clearly problem with gstreamere and not hardware, because in case no. 2 cpu is not nearly fully loaded.

This could be a bug in avimux (file a bug). Try also some more modern format e.g. mp4mux.

Stefan

Have a nice day, Jaka Hudoklin.
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


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



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