Opened 4 years ago

Closed 4 years ago

#1242 closed defect (fixed)

Remuxing Matroska to MPEG transport stream with -copyts errors out with non monotonically increasing dts

Reported by: chucks Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: av_interleaved_write_frame mkv copyts
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I am using http://serviio.org/ as a media server to a media device not supporting Matroska container formats, ffmpeg errors out with "Application provided invalid, non monotonically increasing dts to muxer in stream ...".

After testing differences between the frozen source version that the Serviio project distributes, there appears to be a regression between the working ffmpeg version 0.9 distributed by Serviio as a source tarball built on x86_64, the non-working ffmpeg versions 0.9.1-54 and 0.10.2-54 distributed by http://atrpms.net/ as Fedora 16 x86_64 RPMs, and the git sources from git://source.ffmpeg.org/ffmpeg.git as of commit b21ba20cc83c80fe56192fee3626a8087f37d806 on Sun Apr 22 03:47:53 2012 +0200.

Past experience has shown that omitting the -copyts may cause Matroska remuxed to MPEGts without -copyts may cause video and audio losing synchronization when rendering the resulting files on the client devices.

Attached are ffmpeg report logs and sample media file.

Attachments (4)

sample.mkv (2.1 MB) - added by chucks 4 years ago.
sample Matroska track with h.264 video, AAC audio
ffmpeg-20120422-161053.log (3.2 KB) - added by chucks 4 years ago.
Command line similar to what is captured from serviio
ffmpeg-20120422-161104.log (2.9 KB) - added by chucks 4 years ago.
Command line where audio is simply remuxed, not transcoded.
ffmpeg-20120422-161113.log (16.1 KB) - added by chucks 4 years ago.
Command line where audio is simply remuxed, not transcoded without -copyts

Change History (11)

comment:1 Changed 4 years ago by cehoyos

Please provide a minimal command line together with complete, uncut console output and a sample.

Since you mention a reason why you have to use -copyts: Did you report this problem?

comment:2 follow-up: Changed 4 years ago by chucks

Trying to cut a smaller sample from a larger file that exhibits this behavior. Previous sample does not appear to reproduce the issue, and I am unsure how to dice up the file properly. Copyts is default due to system integration with serviio and the default Playstation 3 DLNA player profile, not by my own experience.

Version 1, edited 4 years ago by chucks (previous) (next) (diff)

Changed 4 years ago by chucks

sample Matroska track with h.264 video, AAC audio

Changed 4 years ago by chucks

Command line similar to what is captured from serviio

Changed 4 years ago by chucks

Command line where audio is simply remuxed, not transcoded.

Changed 4 years ago by chucks

Command line where audio is simply remuxed, not transcoded without -copyts

comment:3 Changed 4 years ago by patters

Just thought I'd mention that the Serviio-distributed version of FFmpeg includes a patch specifically to fix this issue, which I believe has still never been in any release version of FFmpeg. So it's not a 'clean' version of 0.9, and therefore what you describe is not a regression as such.

I can't find the thread now, but this question comes up on the Serviio forum and I seem to recall that Zip (Serviio's developer) mentioned something of how this fix is considered by the FFmpeg developers as a somewhat dirty workaround, which is why it isn't committed.

Last edited 4 years ago by patters (previous) (diff)

comment:4 Changed 4 years ago by cehoyos

  • Keywords av_interleaved_write_frame mkv added; matroska mpegts non-monotonic dts removed

I don't think there is a problem, after all, FFmpeg by default copies the video stream fine, but I may of course be wrong.

comment:5 in reply to: ↑ 2 Changed 4 years ago by cehoyos

Replying to chucks:

Previous experience with transcoding has shown that omitting the -copyts may result in files without properly synchronized audio and video streams.

Sounds like an important bug, did you report this?

comment:6 Changed 4 years ago by chucks

I'll see what I can do to locate the offending file that was exhibiting the audio/video stream sync issues when remuxing to file a separate report concerning the issue, but spare time is a precious commodity I have little spare of at the present.

comment:7 Changed 4 years ago by michael

  • Component changed from undetermined to avformat
  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.