Ticket #1806 (open defect)

Opened 8 months ago

Last modified 6 months ago

Audio/video stream order reversed in remuxed VOB files

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

Description

Summary of the bug:
I am using ffmpeg to edit and remultiplex unencrypted VOB files (from a HD recorder). When copying (ie not transcoding) the streams ffmpeg ALWAYS insists on making the audio stream ID 0 and video stream ID 1 even though the input file was the other way round and it reports itself as NOT doing this.

Using the -map commands also seem to be ignored wherever they appear on the command line.

(This is a problem because I am using dvdauthor on the files and it only seems to work with VOB files with video as the first stream. Fails with infamous ERR: Cannot infer pts for VOBU if there is no audio or video and it is the first VOBU.)

How to reproduce (with any vob file 'input.vob'):
% ffmpeg -i input.vob -target pal-dvd -codec copy output.vob
ffmpeg version N-45279-g1a104bf Copyright (c) 2000-2012 the FFmpeg developers

built on Oct 10 2012 19:21:13 with gcc 4.7.2 (GCC)

Input #0, mpeg, from 'input.vob':

Duration: 00:01:28.15, start: 137.626044, bitrate: 2858 kb/s

Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 352x576 [SAR 24:11 DAR 4:3], 3060 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s

Output #0, dvd, to 'output.vob':

Metadata:

encoder : Lavf54.31.100
Stream #0:0: Video: mpeg2video, yuv420p, 352x576 [SAR 24:11 DAR 4:3], q=2-31

, 3060 kb/s, 25 fps, 90k tbn, 25 tbc

Stream #0:1: Audio: ac3, 48000 Hz, stereo, 256 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)

But running ffprobe on resulting 'output.vob':
Input #0, mpeg, from 'output.vob':

Duration: 00:01:28.15, start: 1.000000, bitrate: 2877 kb/s

Stream #0:0[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 352x576 [SAR 24:11 DAR 4:3], 3060 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc

Streams swapped round!

Attachments

test-ffmpeg.vob Download (1.8 MB) - added by paulbu 7 months ago.
Short VOB file with audio-video delay.

Change History

comment:1 Changed 8 months ago by richardpl

  • Status changed from new to open
  • Version changed from unspecified to git-master
  • Component changed from FFmpeg to avformat

Changed 7 months ago by paulbu

Short VOB file with audio-video delay.

comment:2 Changed 7 months ago by paulbu

Clearer information on this issue from more investigation:
My input VOB files have a time delay between audio and video streams. When remultiplexing (using -codec copy) ffmpeg is repositioning the packets in the streams into time order SO it ends up with a whole VOBU at the start of file containing only audio packets. This causes the (incorrect) 'dvdauthor' error message as it can't determine video time from the first VOBU.

I have attached a short VOB file sample to test with. Run:
ffmpeg -i test-ffmpeg.vob -target pal-dvd -codec copy <out.vob>

and the output file will have an audio only first VOBU and ffprobe will report the audio and video stream IDs have been reversed.
In my view the excess audio before the video starts should be discarded but it maybe the problem is more with 'dvdauthor' here?

comment:3 Changed 6 months ago by cehoyos

  • Keywords mpegps added; stream VOB removed
Note: See TracTickets for help on using tickets.