Muhammad Kashif
Muhammad Kashif

Reputation: 131

Make video from images with ffmpeg/imagemagic

I want to convert jpg images to mp4 video without resizing image(keep original images size and well formated video)

I have tried lot's of solutions of ffmpeg and imagemagic (links given below)but both crop images after converting in video format and i want a video from images with original image size.

Solution will be appreciated with ffmpeg or imagemagick. :)

slow ffmpeg's images per second when creating video from images

image to video ffmpegf

FFMPEG An Intermediate Guide/image sequence

How can I create a video file from a set of jpg images? [duplicate]

How to create a video from images with FFmpeg?

FFmpeg

Make video from still image sequence

Combining images with ImageMagick

Imagemagick.org

enter image description here

ffmpeg -framerate 1/5 -i na%03d.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4

enter image description here on large image(1600X1200) its execute successfully but not generate a smooth video.

on small image(300x168) its show error. i also try this command on small image

ffmpeg -framerate 1/5 -i abc%03d.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2"

Upvotes: 4

Views: 7083

Answers (1)

Muhammad Kashif
Muhammad Kashif

Reputation: 131

this work for me i use this in loop

ffmpeg -loop 1 -i na002.jpg -c:a copy -c:v libx264 -strict 1  -shortest -vf "scale='min(1280,iw)':min'(720,ih)':force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" test.mp4

ffmpeg -y -i video.mp4 -vf "scale='min(1280,iw)':min'(720,ih)':force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" out1.media


ffmpeg -i "C:\xampp\htdocs\social_media\public\uploads\stories\temp_media\81/temp0.mp4" -i "C:\xampp\htdocs\social_media\public\uploads\stories\temp_media\81/temp1.mp4" -i "C:\xampp\htdocs\social_media\public\uploads\stories\temp_media\81/temp2.mp4" -i "C:\xampp\htdocs\social_media\public\uploads\stories\temp_media\81/temp3.mp4" -filter_complex "[0]setdar=16/9[a];[1]setdar=16/9[b];[2]setdar=16/9[c];[3]setdar=16/9[d];[a][0:a][b][1:a][c][2:a][d][3:a] concat=n=4:v=1:a=1[v][a]" -map "[outv]" -map "[outa]" 

Upvotes: 2

Related Questions