How do I enable FFMPEG logging and where can I find the FFMPEG log file?

前端 未结 8 949
庸人自扰
庸人自扰 2021-02-01 15:25

I want to be able to log FFMPEG processes because I am trying to work out how long a minute of video takes to convert to help with capacity planning of my video encoding server.

8条回答
  •  半阙折子戏
    2021-02-01 15:59

    FFmpeg does not write to a specific log file, but rather sends its output to standard error. To capture that, you need to either

    • capture and parse it as it is generated
    • redirect standard error to a file and read that afterward the process is finished

    Example for std error redirection:

    ffmpeg -i myinput.avi {a-bunch-of-important-params} out.flv 2> /path/to/out.txt
    

    Once the process is done, you can inspect out.txt.

    It's a bit trickier to do the first option, but it is possible. (I've done it myself. So have others. Have a look around SO and the net for details.)

提交回复
热议问题