Such an easy question

Nirbheek Chauhan nirbheek.chauhan at gmail.com
Fri Jul 23 13:08:45 UTC 2021


Hi James,

I tested this pipeline on my system with a Logitech C920, and I was
able to record 40 seconds of audio + video without issues. Note that
you need to use "gst-launch-1.0 -e" to ensure that EOS is sent on
Ctrl+C. This is the full command-line I used:

gst-launch-1.0 -e v4l2src device=/dev/video2 ! queue !
video/x-h264,width=1920,height=1080,framerate=30/1 ! h264parse ! queue
! mux. pulsesrc ! audioconvert ! queue ! avenc_aac ! queue ! mux.
mpegtsmux name=mux ! filesink location='output.ts'

The audio dropouts might be an issue with the selected clock, so maybe
try "pulsesrc provide-clock=false" which will use the system clock.
Another possibility is that your webcam is not actually outputting
frames fast enough. This often happens in low light conditions.

You might also like to see the "min-upstream-latency" and "latency"
properties on mpegtsmux, in case your devices have a startup delay.

Cheers,
Nirbheek

On Fri, Jul 23, 2021 at 12:15 PM James Linder via gstreamer-devel
<gstreamer-devel at lists.freedesktop.org> wrote:
>
> My question is so simple that I cannot believe there is no answer
>
> I have a camera providing 1080 at 30Hz in h254
> I want to record the output together with pulse audio.
>
> Google is fulll of tales of woe: eg
>
> http://gstreamer-devel.966125.n4.nabble.com/How-do-you-record-audio-and-video-off-a-webcam-td4687419.html
>
> Trying his ‘it works’ scenario found it does not work is even worse than mp4:
>
>
> Mine: audio cuts out in 15 sec
>
> gst-launch-1.0 $@ v4l2src device=/dev/video2 ! queue ! video/x-h264,width=1920,height=1080,framerate=30/1 ! h264parse ! queue max-size-buffers=0 max-size-bytes=0 max-size-time=1000000000 ! mux. pulsesrc device=0 ! audioconvert ! queue ! avenc_aac ! queue ! mux. mpegtsmux name=mux ! filesink location='output.mp4'
>
> His: audio cust out in 1 sec
>
> gst-launch-1.0 $@ v4l2src device=/dev/video2 ! queue ! video/x-h264,width=1920,height=1080,framerate=30/1 ! h264parse ! queue max-size-buffers=0 max-size-bytes=0 max-size-time=1000000000 ! \
>  mux.  pulsesrc device=alsa_input.usb-Sensoray_Co.__Inc._Sensoray_Model_2263_551645-04.analog-stereo ! audioconvert ! vorbisenc ! matroskamux name=mux ! filesink location=‘output.mkv'
>
> Can anyone help?
>
> thanks
> James
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list