Opened 5 years ago

Closed 5 years ago

#7809 closed defect (invalid)

Encoding: Flac header is not correct in stream mode

Reported by: RuralHunter Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I believe this problem also exists for other format.
In stream mode:
ffmpeg -i 'test.ape' -f flac - >test.flac
In file mode:
ffmpeg -i 'test.ape' -f flac test.flac

The output files of above 2 commands are different. The first one lacks the correct flac header. It is similar at least for wav output.
I just use this to transcode music files on the fly and found some players rely on the correct header to determine the stream duration and when to stop the playback.
It checked the encoding code and found the header is updated at the end of the encoding. This won't work in stream mode. I suggest write the header with correct values in the beginning though this might require an additional scan on the source file.

Change History (2)

comment:1 by RuralHunter, 5 years ago

Summary: Encoding: Flac header is not write in stream modeEncoding: Flac header is not correct in stream mode

comment:2 by Gyan, 5 years ago

Resolution: invalid
Status: newclosed

The duration is updated by the encoder in extradata at the end of encoding, and it can't know where the end is, in advance, since filters may have been applied, the timestamps could have been scaled..etc. Output destination has to be seekable if you need this information stored.

Note: See TracTickets for help on using tickets.