generate mp4 video based on images
https://stackoverflow.com/questions/24961127/how-to-create-a-video-from-images-with-ffmpeg
ffmpeg -framerate 30 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp4
ffmpeg -framerate 1 -pattern_type glob -i '*.png' -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
If you are meet error "width not divisible by 2", please try below crop way. https://stackoverflow.com/questions/20847674/ffmpeg-libx264-height-not-divisible-by-2
$ ffmpeg -framerate 2 -pattern_type glob -i 'car/*.jpg' -c:v libx264 -pix_fmt yuv420p -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4
For width and height
Make width and height divisible by 2 with the crop filter:
ffmpeg -i input.mp4 -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" output.mp4
If you want to scale instead of crop change crop
to scale
.
Generate avi file based on jpgs
https://www.tal.org/tutorials/timelapse-video-gstreamer
https://forums.developer.nvidia.com/t/deepstream-image-decode-test-for-multiple-images-dynamically/108913/5
gst-launch-1.0 multifilesrc location="/tmp/Scratch_2020_07_06__11_31_52_331577.jpg" caps="image/jpeg,framerate=30/1" ! jpegdec ! x264enc ! avimux ! filesink location="out.avi"
https://forums.developer.nvidia.com/t/deepstream-image-decode-test-for-multiple-images-dynamically/108913/5
gst-launch-1.0 multifilesrc location="%d-camera0.jpg" caps="image/jpeg,framerate=30/1" ! jpegdec ! x264enc ! avimux ! filesink location="out.avi"
nvidia@nvidia:/opt/nvidia/deepstream/deepstream-5.0/samples/configs/deepstream-app/nvidia-classifier/deepstream-app$ gst-launch-1.0 multifilesrc location="/tmp/%d.jpg" caps="image/jpeg,framerate=30/1" ! jpegdec ! x264enc ! avimux ! filesink location="out.avi"
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:31.578454868
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
nvidia@nvidia:/opt/nvidia/deepstream/deepstream-5.0/samples/configs/deepstream-app/nvidia-classifier/deepstream-app$
useful link
https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_ref_app_deepstream.html#primary-gie-and-secondary-gie-group
https://stackoverflow.com/questions/55901428/how-to-create-a-mp4-video-file-from-png-images-using-gstreamer
https://forums.developer.nvidia.com/t/no-such-file-or-directory-include-gst-gst-h/156423/4
https://developer.ridgerun.com/wiki/index.php?title=Jetson_Nano/Gstreamer/Example_Pipelines/Encoding
https://gstreamer.freedesktop.org/documentation/multifile/multifilesrc.html?gi-language=c#multifilesrc-page
https://forums.developer.nvidia.com/t/deepstream-images/149059/4
https://forums.developer.nvidia.com/t/inference-of-faster-rcnn-on-deepstream/156355/7 (not work)