I'd like to find a happy medium (smaller file size but faster encoding) keeping the video scale size close to the original. this second command goes a lot faster but makes the file size significantly bigger: ffmpeg -i input.mp4 -vcodec libx264 -preset fast -c:a copy -s 960x540 output.mp4 I've tweaked the bitrate some on that as well as changed the scale to a smaller size, but I don't want to have to make the videos really small (in terms of scale) to accomplish a faster encoding. This first one outputs the file size / quality that I want, but it just takes way too long to encode, not to mention it makes my device get really hot while it's encoding for so long: ffmpeg -i input.mp4 -b:v 1024k -c:a copy -vf scale=960:540 output.mp4 Here are the two commands I've been using. I'm just not sure what codec I should use (fastest encoding but with decent quality output), how ffmpeg handles changing size (aspect ratio) in terms of speed of encoding etc. I've done some playing around with different switches / parameters on the ffmpeg command line and I now have it at a more comfortable time, but the file sizes are significantly bigger. These videos usually aren't longer than 45 seconds and can take 20 minutes to encode. The problem is, it's taking forever to encode the videos on the android device. I'm allowing users to take short videos within my app and then when they upload them to the server, I'm crunching them down with ffmpeg to decrease file size so they're not passing huge amounts of data over the wire. I'm currently using an implementation of ffmpeg on my android app.
0 Comments
Leave a Reply. |