TEEing the video

Ian Davidson id012c3076 at blueyonder.co.uk
Fri Nov 21 13:33:14 PST 2014


I am getting frustrated making 'negative progress' with my project.

I have 2 machines.

The 'Live Machine' runs a 64 bit version of Fedora, and has a video 
capture card. Access to this machine is not very convenient and Internet 
access is also not convenient.

At home I have an old 'Development Machine' which runs a 32 bit version 
of Fedora, does not have a video capture card, but does have a USB 
webcam. It has easy access to the Internet.

On the live machine I have a working program that records a video (mp4) 
file and an audio (wav) file concurrently. I want to tee the video off 
to create a small monitor window while the program is recording – a 
'viewfinder' if you like.

Thus far, the pipeline does not make it all the way to 'PLAYING' when I 
add into the pipeline the additional elements I think I need for my 
viewfinder – and I cannot see why. So, I tried to test it on my 
development machine. As part of the pipeline, I use “x264enc ! Mp4mux” - 
but on the development machine I see the message (in the trace log)

0:00:03.937134344  1604  0x8990980 INFO               structure gststructure.c:2854:gst_structure_get_valist: Expected field 'channel-mask' in structure: audio/x-raw, format=(string)S16LE, layout=(string)interleaved, rate=(int)44100, channels=(int)1;
0:00:03.936178253  1604  0x8990a30 INFO                    task gsttask.c:302:gst_task_func:<vid-source:src> Task resume from paused
0:00:03.945953183  1604  0x8990a30 INFO                    v4l2 gstv4l2object.c:2729:gst_v4l2_object_get_caps:<vid-source> probed caps: video/x-raw, format=(string)I420, width=(int)352, height=(int)292, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)[ 0/1, 100/1 ]; video/x-raw, format=(string)YV12, width=(int)352, height=(int)292, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)[ 0/1, 100/1 ]; video/x-raw, format=(string)BGR, width=(int)352, height=(int)292, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)[ 0/1, 100/1 ]; video/x-raw, format=(string)RGB, width=(int)352, height=(int)292, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)[ 0/1, 100/1 ]
0:00:03.946255699  1604  0x8990a30 INFO                 x264enc gstx264enc.c:509:gst_x264_enc_add_x264_chroma_format: This x264 build supports 8-bit depth
0:00:03.946404915  1604  0x8990a30 INFO                 x264enc gstx264enc.c:509:gst_x264_enc_add_x264_chroma_format: This x264 build supports 8-bit depth
0:00:03.946987781  1604  0x8990a30 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<vid-source> error: Internal data flow error.
0:00:03.948398246  1604  0x8990a30 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<vid-source> error: streaming task paused, reason not-negotiated (-4)
0:00:03.948507201  1604  0x8990a30 INFO        GST_ERROR_SYSTEM gstelement.c:1835:gst_element_message_full:<vid-source> posting message: Internal data flow error.
0:00:03.948590508  1604  0x8990a30 INFO        GST_ERROR_SYSTEM gstelement.c:1858:gst_element_message_full:<vid-source> posted error message: Internal data flow error.
0:00:03.948641377  1604  0x8990a30 INFO                    task gsttask.c:300:gst_task_func:<vid-source:src> Task going to paused
Error: Internal data flow error.

I don't know whether 'This x264 build supports 8-bit depth' is a boast 
or a complaint – or purely information, but coming just in front of the 
'not-negotiated (-4)' leads me to suppose that it is a problem. I don't 
know what I might do to my pipeline to allow it to work, so I tried to 
find an alternative pair of video encoder and mux, so that (on my 
development PC) I could investigate why I can't tee off the video. I was 
not able to find anything which would work.

I then tried another tack – to see if I could simply code up the 
elements to make a monitor. So I tried a pipeline of “v4l2src ! 
videorate ! videoscale ! video/x-raw,width=(int)352,height=(int)292 ! 
autovideosink. Once again, I got a not-negotiated error

gstbin.c:2656:gst_bin_change_state_func:<camera> child 'vidsrc' changed state to 4(PLAYING) successfully
0:00:05.370134748  2500  0x9493520 INFO        GST_ELEMENT_PADS gstelement.c:894:gst_element_get_static_pad: no such pad 'sink' in element "vidsrc"
0:00:05.386283440  2500  0x9493520 INFO                    v4l2 gstv4l2object.c:1247:gst_v4l2_object_fill_format_list:<vidsrc> got 4 format(s):
0:00:05.386626594  2500  0x9493520 INFO                    v4l2 gstv4l2object.c:1253:gst_v4l2_object_fill_format_list:<vidsrc>   YU12 (emulated)
0:00:05.386753887  2500  0x9493520 INFO                    v4l2 gstv4l2object.c:1253:gst_v4l2_object_fill_format_list:<vidsrc>   YV12 (emulated)
0:00:05.386875965  2500  0x9493520 INFO                    v4l2 gstv4l2object.c:1253:gst_v4l2_object_fill_format_list:<vidsrc>   BGR3 (emulated)
0:00:05.386959581  2500  0x9493520 INFO                    v4l2 gstv4l2object.c:1253:gst_v4l2_object_fill_format_list:<vidsrc>   RGB3 (emulated)
0:00:05.387345042  2500  0x9493520 INFO                    v4l2 gstv4l2object.c:2729:gst_v4l2_object_get_caps:<vidsrc> probed caps: video/x-raw, format=(string)I420, width=(int)352, height=(int)292, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)[ 0/1, 100/1 ]; video/x-raw, format=(string)YV12, width=(int)352, height=(int)292, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)[ 0/1, 100/1 ]; video/x-raw, format=(string)BGR, width=(int)352, height=(int)292, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)[ 0/1, 100/1 ]; video/x-raw, format=(string)RGB, width=(int)352, height=(int)292, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)[ 0/1, 100/1 ]
0:00:05.388117725  2500  0x9493520 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<vidsrc> error: Internal data flow error.
0:00:05.391941259  2500  0x9493520 WARN                 basesrc gstbasesrc.c:2865:gst_base_src_loop:<vidsrc> error: streaming task paused, reason not-negotiated (-4)
0:00:05.392081470  2500  0x9493520 INFO        GST_ERROR_SYSTEM gstelement.c:1835:gst_element_message_full:<vidsrc> posting message: Internal data flow error.

I have, previously, used camerabin on the development machine, and there 
the caps of “video/x-raw, format=(string)I420, width=(int)352, 
height=(int)292” worked.


Is my problem to do with using v4l2src as the source? Is there some 
other source I should use with my webcam? Should I use some other sink 
than autovideosink? Help!


On 17/11/2014 18:32, Ian Davidson wrote:
> I have had another opportunity to test my program, both in its 
> original form and with my attempted improvements.
>
> I notice that the 'working version' does set a timestamp in the Auto 
> Ring Buffer to 99:99:99.999999999 several times, but it does 
> eventually stop and then the pipeline reports that it has transitioned 
> to the PLAYING state.  However, if I add my extra elements to the 
> pipeline, whether I link them or not, the pipeline never transitions 
> to the PLAYING state and is constantly filling the buffer with timestamps.
>
> I accept that I may have done something foolish - but if I could see 
> it I would not be writing here.
>
> Any pointers would be appreciated.
>
> Ian
> On 04/11/2014 16:00, Ian Davidson wrote:
>>
>> I have a program (written in C and using GStreamer 1.0) which works. 
>> I take input from v4l2src and alsasrc and mux them together and save 
>> an mp4 file. I also tee off the audio early on and save it as a wav file.
>>
>> However, I have no confirmation that I actually have a video signal 
>> to record. So, I decided to enhance the program by teeing the video 
>> off, right after the v4l2src and send it to an autovideosink to act 
>> as a monitor. The result was not 100% successful. The monitor window 
>> appears with a picture in it – but then everything seems to freeze 
>> up. Looking at a trace (--gst-debug-level=4) appears to loop for ever 
>> setting a timestamp to 99:99:99.999999999.
>>
>>
>> I have copied part of my program below. The elements I have added are 
>> defined in the line GstElement *videotee, *queue5, *monscale, 
>> *moncapsfilter, *videosink;
>>
>>
>> I have also included the beginning of the Trace output. To my 
>> untrained eye, everything seems to link together OK, but then it gets 
>> stuck with the timestamps. Any pointers as to where I am going wrong 
>> would be appreciated.
>>
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141121/03fee74f/attachment.html>


More information about the gstreamer-devel mailing list