<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Paul Barber wrote:<br>
<div class="moz-cite-prefix">
<pre wrap="">>>Hi,
>>I am having trouble writing a C application to put video to screen and to file at the same time. I have a >>command line pipeline that works:
>>
>>gst-launch-1.0 videotestsrc num-buffers=100 ! tee name=t ! queue ! videoconvert !
>>xvimagesink sync=false t. ! queue ! videorate ! video/x-raw,framerate=25/1 !
>>videoconvert ! avenc_mpeg2video bitrate=3000000 ! avimux !
>>filesink location=test_file.avi async=0
>>
>>but in code this does not work. I always end up with an empty file (0 bytes).
>>
>>I have reduce the code down and put it on github:
<a class="moz-txt-link-freetext" href="https://gist.github.com/paulbarber/7d2e43d1e3365b2042aa">>>https://gist.github.com/paulbarber/7d2e43d1e3365b2042aa</a>
>>
>>All the action is in play_camera() in play.c.
>>
>>I would be really grateful if anyone has any clue as to what is wrong.
Sebastian Dröge wrote:
>Did you check if all the pad linking you do succeeds? Always check the
>return values.
>
>Also did you take a look at the pipeline graph once it's started by
>using GST_DEBUG_BIN_TO_DOT_FILE() to see if it looks the way you expect
>it to look?
>
>And do you get any errors when you run that pipeline, or did you try
>looking at the GStreamer debug logs already?</pre>
</div>
Thank you for your reply, that was all the help I needed. I had done
2 of the 3 but had not looked at the graph. This revealed that I was
not requesting tee pads correctly.<br>
Should use <span style="color: rgba(0, 0, 0, 0.8); font-family:
'Roboto Slab', 'Times New Roman', serif; font-size: 14px;
font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing: normal; line-height: 19px; orphans: auto;
text-align: start; text-indent: 0px; text-transform: none;
white-space: pre-wrap; widows: auto; word-spacing: 0px;
-webkit-text-stroke-width: 0px; display: inline !important; float:
none; background-color: rgb(255, 255, 255);"></span>gst_element_request_pad(),
for each tee pad required.<br>
Not, gst_element_get_request_pad() as this does not create request
pads.<br>
Nor, gst_element_get_compatible_pad() as this will only create one
request pad, then return that same pad on all subsequent calls.<br>
Cheers,<br>
Paul.<br>
</body>
</html>