sync 2 videos

Cédric BRINER briner at infomaniak.ch
Wed Nov 12 12:02:27 PST 2014


Hello,

I'm recording event for freesoftware. These records save at the same 
time an output from a webcam and an output from a frame grabber. Should 
I do something specific to gst-launch-1.0 pipe to say that the video has 
to be in sync.

For an easy reading and testing, I'll put 2 pipes one that you could run 
without constraint as it only use test sources and the other one which 
is the true one.

Thanks in advance for your help.

cED
P.-S. if you have any comment on the pipe do not hesitate to tell me.
-------------- next part --------------
#!/bin/bash

GRABBER_DEVICE=/dev/video1
WEBCAM_DEVICE=/dev/video0

gst-launch-1.0 -e \
    v4l2src device=${WEBCAM_DEVICE} \
        ! "video/x-raw, width=(int)320, height=(int)240, format=(string)I420, framerate=(fraction)30/1" \
        ! x264enc speed-preset=fast \
        ! mux. \
    v4l2src device=${GRABBER_DEVICE} \
        ! "video/x-raw, width=(int)1280, height=(int)1024, format=(string)YUY2, framerate=(fraction)30/1" \
        ! videoconvert \
        ! "video/x-raw, width=(int)1280, height=(int)1024, format=(string)I420, framerate=(fraction)30/1" \
        ! x264enc speed-preset=fast \
        ! mux. \
    pulsesrc \
        ! audioconvert \
        ! audio/x-raw, rate=44100, channels=2 \
        ! voaacenc \
        ! queue \
        ! mp4mux name=mux \
    mux. ! filesink location="genuine.mp4"
-------------- next part --------------
#!/bin/bash

gst-launch-1.0 -e \
    videotestsrc pattern=ball \
        ! "video/x-raw, width=(int)320, height=(int)240, format=(string)I420, framerate=(fraction)30/1" \
        ! x264enc speed-preset=fast \
        ! mux. \
    videotestsrc pattern=ball \
        ! "video/x-raw, width=(int)1280, height=(int)1024, format=(string)YUY2, framerate=(fraction)30/1" \
        ! videoconvert \
        ! "video/x-raw, width=(int)1280, height=(int)1024, format=(string)I420, framerate=(fraction)30/1" \
        ! x264enc speed-preset=fast \
        ! mux. \
    audiotestsrc wave=saw \
        ! audioconvert \
        ! audio/x-raw, rate=44100, channels=2 \
        ! voaacenc \
        ! queue \
        ! mp4mux name=mux \
    mux. ! filesink location=genuine.mp4


More information about the gstreamer-devel mailing list