views:

746

answers:

4

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. How do I enable logging and where is the log file saved. I have FFMPEG installed on a CentOS LAMP machine.

+3  A: 

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.)

Stu Thompson
While ffmpeg may not provide an option to write log files, depending on your codec and options the encoder will create logs. And that can be very disruptive since it's written where it's been executed, which can lead to permission issues. In my instance, it was a problem with **PHP** and using `-pass 1/2`.
Cawas
+1  A: 

If you just want to know how many time it takes, you should consider using the time command. You could do for example time ffmpeg -i myvideoofoneminute.aformat out.anotherformat

Valentin Rocher
A: 

Dear stu. I find the answer. 1/First put in the presets, i have this example "Output format MPEG2 DVD HQ"

"-vcodec mpeg2video -vstats_file MFRfile.txt -r 29.97 -s 352x480 -aspect 4:3 -b 4000k -mbd rd -trellis -mv0 -cmp 2 -subcmp 2 -acodec mp2 -ab 192k -ar 48000 -ac 2"

If you want a report includes the commands -vstats_file MFRfile.txt into the presets like the example. this can make a report which it's ubicadet in the folder source of your file Source. you can put any name if you want , i solved my problem "i write many times in this forum" reading a complete .docx about mpeg properties. finally i can do my progress bar reading this txt file generated.

Regards.

Ramses1974
A: 

Hi all, I am using ffmpeg for converting video to *.flv and it is working fine , but for some videos it is storing 0 bytes when video is converted to flv and it only shows ! mark when i play the video i think there is some problem with codec, I want to generate log file when error occurs while flv conversion but i dont know how it generates and how to see that log file can any one help me

Thanks in advance

Rahul

Rahul Hanchate