I'am trying to produce image slideshow by ffmpeg concat.
The problem is that the output video only plays the last image from my input file with images.
The input:
file '/var/www/html/docroot/types/video/images/img0.jpg'
duration 10
file '/var/www/html/docroot/types/video/images/img1.jpg'
duration 10
file '/var/www/html/docroot/types/video/images/img2.jpg'
duration 10
The command:
ffmpeg -y -r 1/10 -f concat -safe 0 -i /var/www/html/docroot/types/video/info.txt -c:v libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2,fps=30,format=yuv420p" /var/www/html/docroot/types/video/output.mp4
And in the output I have something like this:
GIF
Remove -r 1/10 and ,fps=30:
ffmpeg -y -f concat -safe 0 -i /var/www/html/docroot/types/video/info.txt -c:v libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2,format=yuv420p" /var/www/html/docroot/types/video/output.mp4
Related
Please, I want to pipe these two commands.
ffmpeg -i input.flv -vf fps=1 out%d.png | ffmpeg -i input -vf format=gray output
If you just need frames, try this:
ffmpeg -i input.flv -r 1 -pix_fmt gray out%d.png
There is no need to call it twice
-r sets the output frame rate (1 frame/sec) dropping excess frames
pix_fmt sets the output pixel format
[edit]
Try this to output both grayscale video and images:
ffmpeg -i input.flv \
-filter_complex format=gray,split[v0][v1]
-map [v0] -r 1 out%d.png
-map [v1] output.mp4
I would like to extract every 5th frame from a video and rename it accordingly.
frame_0000.jpg
frame_0005.jpg
frame_0010.jpg
frame_0015.jpg
Are there any parameters in the ffmpeg command other than the framerate and FPS to do so. Current command generates output sequentially.
ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
Using a recent ffmpeg build, run
ffmpeg -i foo.avi -vf "setpts=N/TB,fps=1,select='not(mod(n\,5))',scale=WxH" -vsync 0 -frame_pts 1 -f image2 foo-%03d.jpeg
The loop option is not working with gif image.
When I'm working with png image the code good.
But when I'm working with animated gif image the error is thrown Option loop not found.
In my example I'm trying to create the video from input image with specific duration.
ffmpeg -loop 1 -t 5 -i 15324210315b56e3a78abe5.png -i watermark.png -filter_complex "[0]scale=trunc(iw/2)*2:trunc(ih/2)*2[v];[v][1]overlay=x=(W-w-10):y=(H-h-10)" output.mp4
Below command is not working
ffmpeg -loop 1 -t 5 -i 15323488345b55c9a2b2908.gif -i watermark.png -filter_complex "[0]scale=trunc(iw/2)*2:trunc(ih/2)*2[v];[v][1]overlay=x=(W-w-10):y=(H-h-10)" output.mp4
GIFs are handled by a seperate demuxer module, not the generic image sequence demuxer. The gif demuxer has a separate option. See command below.
ffmpeg -ignore_loop 0 -t 5 -i 15323488345b55c9a2b2908.gif ...
The python script for gif to video conversion using ffmpeg library
f"/opt/ffmpeglib/ffmpeg -ignore_loop 0 -i {lambda_file_path} -c:v libx264 -t 10 -pix_fmt yuv420p {lambda_output_file_path}
Im using ffmpeg but takes more than 10minutes to convert 2000 images to mp4
ffmpeg -y -r 1/5 -f concat -safe 0 -i ffmcommand.txt -c:v libx264 -vf fps=25,format=yuv420p out22.mp4
how I could do faster please help me
I use below command to concat background to an audio file:
"ffmpeg" -i /path/to/image.png -i /path/to/audio.mp3 -vsync vfr -pix_fmt yuv420p /path/to/video-1.mp4 2>&1
Next, I use that command to add other images to created video:
"ffmpeg" -f concat -safe 0 -i /path/to/text.txt -i /path/to/video-1.mp4 /path/to/video-2.mp4 2>&1
Content of my text.txt file:
/path/to/img1.jpg
duration 6
/path/to/img2.jpg
duration 6
/path/to/img3.jpg
duration 6
/path/to/img4.jpg
duration 6
Obtained video display only background image. Other images have not been shown.
What are my wrong in these commands? And how to set the display position of other images in video? To display images by position, I use below command, but after it ran, my machine was crashed:
"ffmpeg" -f concat -safe 0 -i /path/to/text.txt -i /path/to/video-1.mp4 -filter_complex "overlay=0:0, scale=640:640" /path/to/video-2.mp4 2>&1
Update:
I do follow order by below steps and got video with text and images, but the position is incorrect. I can't find any solution for custom:
"ffmpeg" -f concat -safe 0 -i /path/to/text.txt -i /path/to/audio.mp3 -vsync vfr -pix_fmt yuv420p /path/to/tmp-video-1.mp4 2>&1
"ffmpeg" -i /path/to/background.png -i /path/to/tmp-video-1.mp4 -filter_complex "overlay=0:0" /path/to/tmp-video-2.mp4 2>&1
"ffmpeg" -i /path/to/tmp-video-2.mp4 -vf "[in]<define texts and duration>[out]" -codec:a copy /path/to/endvideo.mp4 2>&1
Please take a look my video: http://184.171.170.45/cron/tmp/funny-1489648654.mp4
I tried to set overlay property in second command: -640:0, let images in horizontal center of background, but its not working