Such an easy question

James jam at tigger.ws
Sat Jul 31 22:19:21 UTC 2021


It must be my own naivet. Building from src, debugging led to the simple answer that works. Thanks specially to Nirbheek.

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 ! \

audioresample ! audio/x-raw, rate=16000 \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

! queue ! avenc_aac ! queue ! mux. mpegtsmux name=mux ! filesink location='output.mp4'

> On 31 Jul 2021, at 7:50 pm, James via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:
> 
> 
> 
>> On 25 Jul 2021, at 11:58 am, James Linder via gstreamer-devel <gstreamer-devel at lists.freedesktop.org <mailto:gstreamer-devel at lists.freedesktop.org>> wrote:
>> 
>> 
>> 
>>> On 24 Jul 2021, at 2:21 pm, Nirbheek Chauhan via gstreamer-devel <gstreamer-devel at lists.freedesktop.org <mailto:gstreamer-devel at lists.freedesktop.org>> wrote:
>>> 
>>> Hi James,
>>> 
>>> It looks like you forgot to add a space after `false` and before the
>>> `!`, which is why setting the property failed, as the error message
>>> tells you.
>>> 
>>> Cheers,
>>> Nirbheek
>>> 
>>> On Sat, Jul 24, 2021 at 11:30 AM James Linder via gstreamer-devel
>>> <gstreamer-devel at lists.freedesktop.org <mailto:gstreamer-devel at lists.freedesktop.org>> wrote:
>>>> 
>>>> 
>>>> 
>>>>> On 23 Jul 2021, at 9:08 pm, Nirbheek Chauhan <nirbheek.chauhan at gmail.com <mailto:nirbheek.chauhan at gmail.com>> wrote:
>>>>> 
>>>>> 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 <mailto: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 <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?
>>>> 
>>>> I guess it is time to walk away, licking my wounds.
>>>> Thanks for the help.
>>>> I posted my results here: http://tigger.ws/downloads/output.ts <http://tigger.ws/downloads/output.ts>
>>>> 
>>>> What may be intersting/relevant:
>>>> I am using an i3 nuc. HTOP shows 4 cores (actually 2 + 2 threads) at 2-5% busy.
>>>> I can record audio or video endlessly without any issue, just not together.
>>>> I cannot see a reference to provide-clock=false and indeed
>>>> 
>>>> WARNING: erroneous pipeline: could not set property "provide-clock" in element "pulsesrc0" to "false!”
>> 
>> Thanks for the help, provide-clock=false definitly made a difference doubling the record time. ie 8 sec to 20 sec.
>> During my fool-about I managed to select a silent source and recorded, silently, for 10 min.
>> I suspect the answer is in reach, I just cannot see it.
>> 
>> BTW
>> 
>>>>> you need to use "gst-launch-1.0 -e" to ensure that EOS is sent on
>>>>> Ctrl+C.
>> 
>> $@ means $ gst.launch -e -v
>> means gstreamer inherits the flags
[snip]
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210801/87b107f7/attachment.htm>


More information about the gstreamer-devel mailing list