Opened 10 years ago

Last modified 10 years ago

#3097 new enhancement

-report option with parallel ffmpeg instances overwrites existing report files

Reported by: foldaway Owned by:
Priority: normal Component: ffmpeg
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I regularly use two instances of ffmpeg in parallel. With the output of the 1st instance being piped to the input of the 2nd instance.

I would like to be able to generate independent '-report' files from each. Currently only 1 report is generated, as the report file from the 1st instance is overwritten by the 2nd instance.

I understand that report output can be specified using the FFREPORT environment variable but this does not allow sending the report of each instance to a different file. I also understand that specifying a report filename as an option is problematic.

So here's a couple of imagined potential solutions:
1: The unique filename is generated using date,hours,mins,secs at the end. If this included milliseconds, the files are unlikely to collide.
2: Check for the existence of the report file before write & if it does exist change the report filename eg. add '-2' at the end.

Change History (6)

in reply to:  description ; comment:1 by Cigaes, 10 years ago

Replying to foldaway:

I understand that report output can be specified using the FFREPORT environment variable but this does not allow sending the report of each instance to a different file.

I believe it does allow it:

export FFREPORT=file=some-file-name

Or maybe I misunderstood your issue.

in reply to:  1 comment:2 by foldaway, 10 years ago

If running 2 instances in parallel like so:

ffmpeg -report -i input ... -f mpegts - | ffmpeg -report -f mpegts -i - ... output

Setting the environment variable FFREPORT will apply to both. Meaning only 1 report file is generated not 2, as required.

comment:3 by Cigaes, 10 years ago

You can set different environment variables in different elements of a pipeline:

FFREPORT=file=a.txt ffmpeg ... - |
FFREPORT=file=b.txt ffmpeg -i - ...

in reply to:  3 ; comment:4 by foldaway, 10 years ago

Sorry, I failed to mention I'm running on Windows. I don't think this is possible on Windows.

in reply to:  4 ; comment:5 by Carl Eugen Hoyos, 10 years ago

Replying to foldaway:

Sorry, I failed to mention I'm running on Windows.

I don't think this is possible on Windows.

Why do you think so?

in reply to:  5 comment:6 by foldaway, 10 years ago

Because AFAICT it isn't possible from the command line. As a workaround, I'm calling FFmpeg through CreateProcess so I can define the environment (/FFREPORT) uniquely for each instance.

Note: See TracTickets for help on using tickets.