Filesink from C code, file always empty

Paul Barber paul.barber at oncology.ox.ac.uk
Wed Nov 19 09:16:09 PST 2014


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.

Cheers,
Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141119/b3f018b5/attachment.html>


More information about the gstreamer-devel mailing list