Convert From Jpg To Mp4 By Ffmpeg


Answer :

Depending on your file names you'll want:



ffmpeg -f image2 -i Path/To/File/filename%3d.jpg test.avi


The filename%3d would be for files named: filename000.jpg, filename001.jpg, filename002.jpg, etc.



See FFmpeg image2 demuxer examples



You have other option like :




  • framerate = Set the frame rate for the video stream. It defaults to 25

  • -r = set frame rate



    ffmpeg -framerate 10 -i Path/To/File/filename%3d.jpg -r 5 -y Path/To/File/test.mp4



I can show you an example here,


ffmpeg -f image2 -r 60 -i path/filename%03d.jpg -vcodec libx264 -crf 18  -pix_fmt yuv420p test.mp4


  • f: force format

  • r: frame rate

  • i: input files assuming your files are filename001.jpg, filename002.jpg, ...

  • vcodec: video codec

  • crf: constant rate factor (0-51). 17-18 is (nearly) visually lossless. See Encode/H.264

  • pix_fmt: pixel format



Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools