Gstreamer save frame to multifilesink produces 0 KB image

Nicolas Dufresne nicolas at ndufresne.ca
Thu Aug 26 16:25:25 UTC 2021


Le jeudi 26 août 2021 à 11:14 -0400, Dwight Kulkarni via gstreamer-devel a
écrit :
> Hi all,
> 
> I am using gstreamer and try the following two pipelines:
> 
> gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, width=1920,
> height=1080, framerate=15/1 ! autovideosink
> 
> When I run this command, a window opens up and shows me the camera output.
> 
> Now I want to convert this stream to jpeg and save it to file, so I use the
> following:
> 
> gst-launch-1.0 v4l2src device=/dev/video1 ! video/x-raw, width=1920,
> height=1080, framerate=15/1 ! jpegenc ! multifilesink
> location=/home/myuser/mytestfolder/img_%06d.jpg
> 
> 
> I run the second command for a few seconds then terminate with Ctrl C. I see
> files img_00001.jpg etc. but the size of the file is 0 KB.
> 
> Can anyone suggest what I might be doing wrong ?
> 

This is strange, I ran this here, gst 1.18.4, and it just worked. Perhaps you
should set GST_DEBUG=2 to get warnings printed if any, might help ? Also,
consider adding videoconvert, in case your cam does not produce a pixel format
compatible with jpegenc ?



More information about the gstreamer-devel mailing list