Opened 4 years ago

Last modified 4 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)

comment:1 in reply to: ↑ description ; follow-up: Changed 4 years ago by Cigaes

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.

comment:2 in reply to: ↑ 1 Changed 4 years ago by foldaway

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 follow-up: Changed 4 years ago by Cigaes

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

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

comment:4 in reply to: ↑ 3 ; follow-up: Changed 4 years ago by foldaway

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

comment:5 in reply to: ↑ 4 ; follow-up: Changed 4 years ago by cehoyos

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?

comment:6 in reply to: ↑ 5 Changed 4 years ago by foldaway

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.