Record video at 30fps and images at 1fps simultaneously

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Record video at 30fps and images at 1fps simultaneously

Brukernavn
Hello,

I'm trying to record both video and take images at the same time through one gst-launch. It works perfectly using ximagesink to show the videostream at the same time frames are saved every second.

gst-launch-1.0 tcamsrc serial=.. ! video/x-bayer,format=bggr,width=1024,height=768 ! capssetter join=false caps="video/x-bayer,format=gbrg" ! bayer2rgb ! tee name=t t. ! queue ! videoscale ! video/x-raw,framerate=30/1 ! videoconvert ! ximagesink t. ! queue ! videorate ! video/x-raw,framerate=1/1 ! videoconvert ! jpegenc ! multifilesink location=bilder/frame_%04d.jpg

When I change the filesink to save to mp4 it suddenly stops working. I've figured the problem out to be the "x264enc" part of the pipeline, as it stops working when calling this. This is my non-working attempt:

gst-launch-1.0 tcamsrc num-buffers=40 serial=... ! video/x-bayer,format=bggr,width=1024,height=768 ! capssetter join=false caps="video/x-bayer,format=gbrg" ! bayer2rgb ! tee name=t t. ! queue ! videoscale ! video/x-raw,framerate=30/1 ! videoconvert ! x264enc ! mp4mux ! filesink location=bilder/test.mp4 t. ! queue ! videorate ! video/x-raw,framerate=1/1 ! videoconvert ! jpegenc ! multifilesink location=bilder/frame_%04d.jpg

And for some reason it works fine with avimux, since I then can remove x264enc. The files become huge (1GB after 2-3 seconds), so this is not an alternative.

Does anyone have suggestions on how to fix this? If not, alternatives to mp4 or how to compress the avi files on the go?

Thank you

Sent from the GStreamer-devel mailing list archive at Nabble.com.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Record video at 30fps and images at 1fps simultaneously

Gst-Geek
By default x264 uses more video buffers for better rate control. This leads
to dead lock when it is used along with other sink or audio branch.

To avoid this dead lock there are 2 option.
1. Reduce look ahead in x264enc or enable low latency by setting tune=4
property
2. Adjust queue size in mulitfilesink branch.

By setting tune=4 below pipeline worked for me. Otherwise it doesn't work.

gst-launch-1.0 videotestsrc !
video/x-bayer,format=bggr,width=1024,height=768 ! capssetter join=false
caps="video/x-bayer,format=gbrg" ! bayer2rgb ! tee name=t \
t. ! queue ! videoscale ! video/x-raw,framerate=30/1 ! videoconvert !
x264enc ! mp4mux ! filesink location=test.mp4 \
t. ! queue ! videorate ! video/x-raw,framerate=1/1 ! videoconvert ! jpegenc
! multifilesink location=frame_%04d.jpg

! Vinod



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel