Why does FFmpeg decode a raw video in the YUV420 planar 8 bits pixel format, when it's also encoding the video using the same YUV420p pixel format?
I've ran a couple benchmark tests encoding only raw YUV420p video using the MPEG2 encoder on a FreeScale PowerPC using the following settings:
ffmpeg -f rawvideo -pix_fmt yuv420p -s cif -r 25 -i YUV420p_cif.yuv -vcodec mpeg2video -pix_fmt yuv420p -r 25 -g 25 -s cif -b:v 1024k Output.mp4
The video sequence is 15 minutes long. I found out the entire proces uses:
- 3.9% of time reading the file;
- 3.7% of time decoding;
- 91.2% of time encoding;
- 0.7% of time muxing + writing the file;
- 0.5% of time is initializing / closing ffmpeg
The total process was done in 382 seconds (58.9 fps), so decoding took 14.1 seconds in total. That seems a lot to me!
Since the encoding process is using the YUV420p pixel format, why does FFmpeg needs 3.7% of the time decoding the raw YUV420p to the same format?