I'm having trouble transcoding videos where the SAR is not 1:1. For example, on one video ffmpeg -i reports:
Duration: 00:01:11.89, start: 0.000000, bitrate: 790 kb/s
Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p, 368x208 [SAR 208:207 DAR 16:9], 639 kb/s, 30.05 fps, 29.83 tbr, 30k tbn, 60 tbc
When trying to transcode to a 16:9 resolution, I am getting the following ffmpeg ran:
/usr/bin/ffmpeg -i '/home/XXX/drupal7/files/videos/original/video1.mp4' -vf 'scale=213:360' -strict experimental -vcodec 'h264' -acodec 'aac' -b '720k' -vprofile 'baseline' -ab '128k' -ac '2' -pass '1' -passlogfile '/tmp/1366829491-517829b3419d0-multipass' -y /tmp/1366829491-517829b3418bf.mp4
And is failing with the following error [libx264 @ 0xcdea00] width not divisible by 2 (213x360)
I have no idea how its calculating that scaling factor.
PS we also need to pass -b:v '720k' instead of -b '720k' when setting a video bitrate.
Comments
Comment #1
Jorrit commentedI have fixed the problem in issue #1997762: Width and height not constrained to be even in computing scale factor. You can try the latest 7.x-2.x-dev release.
-b '720k'is the 'old' way of specifying the bit rate. I don't want to remove compatibility for older FFmpeg versions yet. Are you getting an error because of it? Or just a warning?