Filesink from C code, file always empty

Sebastian Dröge sebastian at centricular.com
Thu Nov 20 01:02:37 PST 2014


On Mi, 2014-11-19 at 17:16 +0000, Paul Barber wrote:
> 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:
> https://gist.github.com/paulbarber/7d2e43d1e3365b2042aa
> 
> 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.

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?

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141120/a6569a0d/attachment.sig>


More information about the gstreamer-devel mailing list