ffmpeg set report log filename

微笑、不失礼 提交于 2020-01-23 09:57:08

问题


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.



来源:https://stackoverflow.com/questions/11241878/ffmpeg-set-report-log-filename

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!