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.
相关问题
- What is the best way to do a search in a large fil
- Spring Integration - Inbound file endpoint. How to
- I want to trace logs using a Macro multi parameter
- Error message 'No handlers could be found for
- ruby 1.9 wrong file encoding on windows
相关文章
- how do I log requests and responses for debugging
- Handling ffmpeg library interface change when upgr
- How to use a framework build of Python with Anacon
- What is the correct way to declare and use a FILE
- Making new files automatically executable?
- Android Studio doesn't display logs by package
- How to serialize data into indented json [duplicat
- Creating a custom file like object python suggesti
You must declare the reportfile as variable for console.
Problem is all the Dokumentations you can find are not running so .. I was give 1 day of my live to find the right way ....
Example: for batch/console
cmd.exe /K set FFREPORT=file='C:\ffmpeg\proto\test.log':level=32 && C:\ffmpeg\bin\ffmpeg.exe -loglevel warning -report -i inputfile f outputfile
Exemple Javascript:
var reortlogfile = "cmd.exe /K set FFREPORT=file='C:\ffmpeg\proto\" + filename + ".log':level=32 && C:\ffmpeg\bin\ffmpeg.exe" .......;
You can change the dir and filename how ever you want.
Frank from Berlin
You can find more debugging info just simply adding the option -loglevel debug, full command will be
ffmpeg logs to stderr, and can log to a file with a different log-level from stderr. The
-report
command-line option doesn't give you control of the log file name or the log level, so setting the environment variable is preferable.(
-v
is a synonym for-loglevel
. Runffmpeg -v help
to see the levels. Runffmpeg -h full | less
to see EVERYTHING. Or consult the online docs, or their wiki pages like the h.264 encode guide).That will trancode
src.mp4
with x264, and set the log level for stderr to "verbose", and the log level forout.mkv.log
to "status".(
AV_LOG_WARNING=24
,AV_LOG_INFO=32
,AV_LOG_VERBOSE=40
, etc.). Support for this was added 2 years ago, so you need a non-ancient version of ffmpeg. (Always a good idea anyway, for security / bugfixes and speedups)A few codecs, like
-c:v libx265
, write directly to stderr instead of using ffmpeg's logging infrastructure. So their log messages don't end up in the report file. I assume this is a bug / TODO-list item.To log stderr, while still seeing it in a terminal, you can use
tee(1)
.If you use a log level that includes status line updates (the default
-v info
, or higher), they will be included in the log file, separated with^M
(carriage return aka\r
). There's no log level that includes encoder stats (like SSIM) but not status-line updates, so the best option is probably to filter that stream.If don't want to filter (e.g. so the fps / bitrate at each status-update interval is there in the file), you can use
less -r
to pass them through directly to your terminal so you can view the files cleanly. If you have.enc
logs from several encodes that you want to flip through,less -r ++G *.enc
works great. (++G means start at the end of the file, for all files). With single-key key bindings like.
and,
for next file and previous file, you can flip through some log files very nicely. (the default bindings are:n
and:p
).If you do want to filter,
sed 's/.*\r//'
works perfectly for ffmpeg output. (In the general case, you need something likevt100.py
, but not for just carriage returns). There are (at least) two ways to do this with tee + sed:tee
to /dev/tty and pipe tee's output into sed, or use a process substitution to tee into a pipe to sed.For testing a few different encode parameters, you can make a function like this one that I used recently to test some stuff. I had it all on one line so I could easily up-arrow and edit it, but I'll un-obfuscate it here. (That's why there are
;
s at the end of each line)Note that it tests for existence of the output video file to avoid spewing extra garbage into the log file if it already exists. Even so, I used and append (
>>
) redirect.It would be "cleaner" to write a shell function that took args instead of looking at shell variables, but this was convenient and easy to write for my own use. That's also why I saved space by not properly quoting all my variable expansions. (
$v
instead of"$v"
)I find the answer. 1/First put in the presets, i have this example "Output format MPEG2 DVD HQ"
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.
appears that if you add this to the command line:
or
You get more verbose debugging output to the command line.
FFmpeg does not write to a specific log file, but rather sends its output to standard error. To capture that, you need to either
Example for std error redirection:
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.)