Search code examples
ffmpeghtml5-videovideo.js

FFMPEG Aspect Ratio HTML5 Video


Currently have a bunch of still images, sized: 352:240.

I use the standard ffmpeg on the files and create an mp4 or an ogv dependent on my situation. However, when I open the video file in videoJS it's being forced into a 4:3 aspect ratio so the image is not in it's true form.

Is there an additional command I can tail onto the ffmpeg to keep the video size correctly or the ratio at a 1:1?


Solution

  • It was forcing the size, resolved it by doing the following:

    ffmpeg -r ' + str(FRAME_RATE) + ' -i ' + directory_name + '\img%d.jpg -vf "scale='+str(imgSize[0])+':'+str(imgSize[1])+',setsar=1:1" ' + directory_name

    That fixed it