A
A
Alexander Borisovich2016-02-18 01:23:08
PHP
Alexander Borisovich, 2016-02-18 01:23:08

Why does ffmpeg always log command line options?

Some terribly clumsy debugging of ffmpeg in php via shell_exec.
Simple working mp3 ripping code

FFREPORT=file=ff%t.log:level=16 ffmpeg -y -i '/tmp/phpuloL1U'    -acodec copy '/home/test.mp3' &

Works. The debug code level=16 means to throw off the log in case of an error. You can generally do level=0, but what is that! In any case, this infection sends me logs with command line parameters:

Command line:
ffmpeg -y -i /tmp/phpuloL1U -acodec copy /home/test.mp3

Why? how? why?
If I add this >/dev/null 2>/dev/nullto turn off stdout, then the same thing is written to the log, and for some reason:
/tmp/phpuloL1U: No such file or directory
What should I do with this nonsense?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
monah_tuk, 2016-02-18
@Alexufo

Only write BugReport:

idx = locate_option(argc, argv, options, "report");
    if ((env = getenv("FFREPORT")) || idx) {
        init_report(env);
        // Код ниже сбрасывает параметры командной строки невзирая ни на что. Главное что бы файл смог открыться
        if (report_file) {
            int i;
            fprintf(report_file, "Command line:\n");
            for (i = 0; i < argc; i++) {
                dump_argument(argv[i]);
                fputc(i < argc - 1 ? ' ' : '\n', report_file);
            }
            fflush(report_file);
        }
    }

The fix is ​​also quite simple:
so you can rebuild yourself.
On the other hand, if you are not going to log at all, then why send a file for reporting?
This is the answer to the questions: "why?" And How?"
The answer to the question: "why?" - the report was originally conceived as a feature useful in resolving some bugs. They are asked to attach them to the reports, so that the exhaust on the screen does not get dirty. So this feature was more for developers. The fact that users don't use the tool as intended... Well, you won't change your mind for everyone :)

V
Vladimir Martyanov, 2016-02-18
@vilgeforce

Maybe it's written in the source code like this: command line parameters are always in the log.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question