I am running ffmpeg.exe on command prompt. I am trying to generate a report file using the -report
option. How to explicitly specify the report name?
问题:
回答1:
looks like it can only be set [?] with an environment variable
export FFREPORT=file=/home/someone/log/ffmpeg-$(date +%Y%m%s).log
this is because, otherwise, it would have to parse the output filename from the command line parameters, which means "ffmpeg is already running, so has already started logging things" so kind of a cat or mouse game, apparently.
ref: https://ffmpeg.org/trac/ffmpeg/ticket/1823 and some mailing list posts.
回答2:
The easy method on Windows 7 is:
ffmpeg -i filename.mp4 -hide_banner 2> filename_Info.txt
.
My prefered solution in a batch file is:
:: Location of file
SET file=filename
:: Location of FFMPEG
SET ffmpeg=C:\Program Files\FFmpeg\ffmpeg.exe
:: Analyse File
"%ffmpeg%" -i "%file%.mp4" -hide_banner 2> "%file%_Info.txt"
For my single option "-hide_banner" you can substitute whatever you need to use in the way of options/switches for your intended command line.
You please yourself as to the name and path of the report file, which can be any valid filepath.