4

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"
Kashif Ali
  • 91
  • 2
  • 10
  • Show your `ffmpeg` command and the complete console output. – llogan Mar 05 '18 at 17:03
  • i used this command of ffmpeg ffmpeg -framerate 25 -i image-%05d.jpg -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4 – Kashif Ali Mar 06 '18 at 05:43
  • please see the console output in thread – Kashif Ali Mar 06 '18 at 06:01
  • These two commands making videos with correct delay time but with different resolution pics in video it convert all the image to first image resolution. it should keep original size all image in video `ffmpeg -f image2 -r 1/5 -i na%03d.jpg -y -r 25 test.mp4` `ffmpeg -y -r 1/5 -i na%03d.jpg -r 25 out.mp4` – Kashif Ali Mar 07 '18 at 10:40

1 Answers1

2

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]" 
Kashif Ali
  • 91
  • 2
  • 10