Use ffmpeg to encode folder of yuyv frames into an mp4

0

I'm trying to use ffmpeg to generate an mp4 file from a few thousand frames I have in yuyv format (yuyv422 in ffmpeg terms). I've found some command lines to join a bunch of images like this, but how do I do it with a directory of raw frames? I'd also like to specify the bitrate and framerate if that's possible too.

Robinson

Posted 2016-09-03T23:20:30.167

Reputation: 103

Answers

2

Basic command template is

ffmpeg -f image2 -c:v rawvideo -framerate 24 -video_size 1920x1080 -pixel_format yuyv422
       -i path/to/img%d.raw -b:v 2000k output.mp4

Gyan

Posted 2016-09-03T23:20:30.167

Reputation: 21 016

The -b:v option is not necessary (ffmpeg 4.1.3). I'm getting the exact same video (same checksum) with or without the option – Romuald Brunet – 2019-05-04T07:50:03.507

Can't reproduce it here. Share full log of your two runs - with and without b:v. – Gyan – 2019-05-04T08:12:42.790

https://pastebin.com/tFag1gfR - It seems the encoder simply ignore the bitrate (which makes sense since we're encoding raw). It also seems to ignore the framerate in my case (edit the only difference with / without the -b:v option is the speedup) – Romuald Brunet – 2019-05-06T12:51:19.770

b:v is bitrate, so the 1000 in your command is 1 kbps which ffmpeg will ignore and override with default rate. You're also assigning 'rawvideo' as the output encoder (my command does not), where bitrate does not matter. – Gyan – 2019-05-06T13:14:07.477