can't reorder streams and concatenate vob's

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

can't reorder streams and concatenate vob's

sean darcy
I'm trying to reorder streams in a VOB.

ffprobe old-B.VOB
..............
Input #0, mpeg, from 'old-B.VOB':
   Duration: 00:03:30.02, start: 0.500000, bitrate: 8112 kb/s
     Stream #0:0[0x80]: Audio: ac3, 48000 Hz, mono, fltp, 384 kb/s
     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 59.94 tbr, 90k tbn,
59.94 tbc


I do this:
ffmpeg -i old-B.VOB -map 0:1 -map 0:0 -c copy B.VOB
ffmpeg version git-snapshot-20180928-RPMFusion Copyright (c) 2000-2018
the FFmpeg developers
.........
Input #0, mpeg, from 'old-B.VOB':
   Duration: 00:03:30.02, start: 0.500000, bitrate: 8112 kb/s
     Stream #0:0[0x80]: Audio: ac3, 48000 Hz, mono, fltp, 384 kb/s
     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 59.94 tbr, 90k tbn,
59.94 tbc
[svcd @ 0x18d1380] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, svcd, to 'B.VOB':
   Metadata:
     encoder         : Lavf58.18.103
     Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, progressive),
720x480 [SAR 8:9 DAR 4:3], q=2-31, 29.97 fps, 59.94 tbr, 90k tbn, 29.97 tbc
     Stream #0:1: Audio: ac3, 48000 Hz, mono, fltp, 384 kb/s
Stream mapping:
   Stream #0:1 -> #0:0 (copy)
   Stream #0:0 -> #0:1 (copy)

which looks like it works.

BUT:

ffprobe B.VOB
............
Input #0, mpeg, from 'B.VOB':
   Duration: 00:03:30.02, start: 0.500000, bitrate: 8112 kb/s
     Stream #0:0[0x80]: Audio: ac3, 48000 Hz, mono, fltp, 384 kb/s
     Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv,
progressive), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 59.94 tbr, 90k tbn,
59.94 tbc

I'm trying to reorder the streams to make concatenation work. I can
encode each of B.VOB and C.VOB into mp4 without problems.


ffprobe C.VOB
............
Input #0, mpeg, from 'C.VOB':
   Duration: 00:02:46.50, start: 0.533367, bitrate: 6297 kb/s
     Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top
first), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
     Stream #0:1[0x80]: Audio: ac3, 48000 Hz, mono, fltp, 192 kb/s


But concatenation does not work.
cat BC.txt
file 'B.VOB'
file 'C.VOB'

ffmpeg -f concat -i BC.txt  -r 24000/1001 -flags +ilme+ildct -c:a copy
list.mp4
...........
Input #0, concat, from 'BC.txt':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0: Audio: ac3, 48000 Hz, mono, fltp, 384 kb/s
     Stream #0:1: Video: mpeg2video (Main), yuv420p(tv, progressive),
720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 59.94 tbr, 90k tbn, 90k tbc
Stream mapping:
   Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (libx264))
   Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x18ff4c0] interlace + weightp is not implemented
[libx264 @ 0x18ff4c0] using SAR=8/9
[libx264 @ 0x18ff4c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2
[libx264 @ 0x18ff4c0] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x18ff4c0] 264 - core 157 - H.264/MPEG-4 AVC codec
............
[mp4 @ 0x1744180] track 1: codec frame size is not set
Output #0, mp4, to 'list.mp4':
   Metadata:
     encoder         : Lavf58.18.103
     Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
720x480 [SAR 8:9 DAR 4:3], q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc
     Metadata:
       encoder         : Lavc58.31.101 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
     Stream #0:1: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, mono, fltp,
384 kb/s
[mpeg2video @ 0x1777e00] ignoring extra picture following a
frame-picture7kbits/s dup=12 drop=0 speed=9.43x
     Last message repeated 2 times
[mpeg2video @ 0x1777e00] Missing picture start code
[mpeg2video @ 0x1777e00] ignoring extra picture following a frame-picture
     Last message repeated 2 times
[mp4 @ 0x1744180] Non-monotonous DTS in output stream 0:1; previous:
10079232, current: 10079166; changing to 10079233. This may result in
incorrect timestamps in the output file.
[mpeg2video @ 0x1777e00] ignoring extra picture following a frame-picture
     Last message repeated 2 times
[mpeg2video @ 0x1777e00] Missing picture start code
[mpeg2video @ 0x1777e00] ignoring extra picture following a frame-picture
[mpeg2video @ 0x1777e00] Missing picture start code
[mpeg2video @ 0x1777e00] ignoring extra picture following a frame-picture
[mpeg2video @ 0x1777e00] Missing picture start code
[mpeg2video @ 0x1777e00] slice below image (128 >= 30)
Error while decoding stream #0:1: Invalid data found when processing input
[mpeg2video @ 0x1777e00] ignoring extra picture following a frame-picture
     Last message repeated 11 times
..............

The errors start about where C.VOB begins. I'm guessing the problem is
that the a/v streams are different in each vob.

I also tried -map  :

ffmpeg -f concat -i BC.txt  -r 24000/1001 -flags +ilme+ildct -map v -map
a:i#0x80 -c:a copy list.mp4

Same result.

And C.VOB encodes without error:

ffmpeg  -i C.VOB  -r 24000/1001 -flags +ilme+ildct -map v:i#0x1e0 -map
a:i#0x80 -c:a copy list.mp4
......
Input #0, mpeg, from 'C.VOB':
   Duration: 00:02:46.50, start: 0.533367, bitrate: 6297 kb/s
     Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top
first), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
     Stream #0:1[0x80]: Audio: ac3, 48000 Hz, mono, fltp, 192 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[libx264 @ 0x8899c0] interlace + weightp is not implemented
[libx264 @ 0x8899c0] using SAR=8/9
[libx264 @ 0x8899c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2
[libx264 @ 0x8899c0] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x8899c0] 264 - core 157 - H.264/MPEG-4 AVC codec
..........
[mp4 @ 0x864800] track 1: codec frame size is not set
Output #0, mp4, to 'list.mp4':
   Metadata:
     encoder         : Lavf58.18.103
     Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p,
720x480 [SAR 8:9 DAR 4:3], q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc
     Metadata:
       encoder         : Lavc58.31.101 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
     Stream #0:1: Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, mono, fltp,
192 kb/s
frame= 3994 fps=192 q=-1.0 Lsize=   26916kB time=00:02:46.46
bitrate=1324.6kbits/s dup=0 drop=12 speed=8.02x
video:22884kB audio:3900kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.492994%


Any help appreciated.


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: can't reorder streams and concatenate vob's

Nicolas George
sean darcy (2018-11-08):
> I'm trying to reorder streams in a VOB.

Not possible: the streams in a VOB are not ordered. This is not a
limitation of FFmpeg, this is a property of the format.

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: can't reorder streams and concatenate vob's

sean darcy
On 11/8/18 1:59 PM, Nicolas George wrote:
> sean darcy (2018-11-08):
>> I'm trying to reorder streams in a VOB.
>
> Not possible: the streams in a VOB are not ordered. This is not a
> limitation of FFmpeg, this is a property of the format.
>
> Regards,
>

Ok. So is it possible to concatenate 2 vob's where the audio and video
don't have the same stream numbers ?

Do I need to change the container ? If so, what container would work ?

For instance, what should be the filename extension in this script ?

for input in *.VOB ; do
   ffmpeg -i $input -c copy  $(basename $input .VOB).[???]
   echo $(basename $input .VOB).[???] >> concat.txt
done
ffmpeg -f concat -i concat.txt ..........    out.mp4

Bigger question : is the concatenation problem here the stream numbers ?

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: can't reorder streams and concatenate vob's

Nicolas George
sean darcy (2018-11-08):
> Ok. So is it possible to concatenate 2 vob's where the audio and video don't
> have the same stream numbers ?

VOB do not have stream numbers (FFmpeg is inventing them on the fly), so
the question does not make any sense.

> for input in *.VOB ; do
>   ffmpeg -i $input -c copy  $(basename $input .VOB).[???]
>   echo $(basename $input .VOB).[???] >> concat.txt
> done
> ffmpeg -f concat -i concat.txt ..........    out.mp4
>
> Bigger question : is the concatenation problem here the stream numbers ?

In this instance, if the files are the ones you have shown earlier,
yes, the order in which FFmpeg detects the streams is the problem.

I suggest you read the documentation of the concat demuxer to the end,
the answer to your question is there.

Note that VOB files are also concatenable at the container level,
provided they do not contain extra junk at the beginning or the end (if
you got them directly from a DVD Video filesystem, they do and you
should NOT be using them directly).

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: can't reorder streams and concatenate vob's

sean darcy
On 11/8/18 5:34 PM, Nicolas George wrote:

> sean darcy (2018-11-08):
>> Ok. So is it possible to concatenate 2 vob's where the audio and video don't
>> have the same stream numbers ?
>
> VOB do not have stream numbers (FFmpeg is inventing them on the fly), so
> the question does not make any sense.
>
>> for input in *.VOB ; do
>>    ffmpeg -i $input -c copy  $(basename $input .VOB).[???]
>>    echo $(basename $input .VOB).[???] >> concat.txt
>> done
>> ffmpeg -f concat -i concat.txt ..........    out.mp4
>>
>> Bigger question : is the concatenation problem here the stream numbers ?
>
> In this instance, if the files are the ones you have shown earlier,
> yes, the order in which FFmpeg detects the streams is the problem.
>
> I suggest you read the documentation of the concat demuxer to the end,
> the answer to your question is there.
>
> Note that VOB files are also concatenable at the container level,
> provided they do not contain extra junk at the beginning or the end (if
> you got them directly from a DVD Video filesystem, they do and you
> should NOT be using them directly).
>
> Regards,
>

On 11/8/18 5:34 PM, Nicolas George wrote:
 > sean darcy (2018-11-08):
 >> Ok. So is it possible to concatenate 2 vob's where the audio and
video don't
 >> have the same stream numbers ?
 >
 > VOB do not have stream numbers (FFmpeg is inventing them on the fly), so
 > the question does not make any sense.
 >
 >> for input in *.VOB ; do
 >>    ffmpeg -i $input -c copy  $(basename $input .VOB).[???]
 >>    echo $(basename $input .VOB).[???] >> concat.txt
 >> done
 >> ffmpeg -f concat -i concat.txt ..........    out.mp4
 >>
 >> Bigger question : is the concatenation problem here the stream numbers ?
 >
 > In this instance, if the files are the ones you have shown earlier,
 > yes, the order in which FFmpeg detects the streams is the problem.
 >
 > I suggest you read the documentation of the concat demuxer to the end,
 > the answer to your question is there.
 >
 > Note that VOB files are also concatenable at the container level,
 > provided they do not contain extra junk at the beginning or the end (if
 > you got them directly from a DVD Video filesystem, they do and you
 > should NOT be using them directly).
 >
 > Regards,
 >

Thanks for the help. I've set up a complex filter. That works.

But following up on:

 > if you got them directly from a DVD Video filesystem ... you
 > should NOT be using them directly

So for vob's from a video dvd :

cat VTS* | ffmpeg -i - ........... out.mp4

or

ffmpeg -f concat -i list.of.vobs  ...... out.mp4

is not a good idea ? Even though it does not generate any errors.

I should be using a complex filter for any vob's from a video dvd ? Who
knew ?


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: can't reorder streams and concatenate vob's

Nicolas George
sean darcy (2018-11-12):
> So for vob's from a video dvd :
>
> cat VTS* | ffmpeg -i - ........... out.mp4
>
> or
>
> ffmpeg -f concat -i list.of.vobs  ...... out.mp4
>
> is not a good idea ? Even though it does not generate any errors.

Not a good idea at all. It generates garbage video.

> I should be using a complex filter for any vob's from a video dvd ? Who knew
> ?

No. You need to use a tool aware of the specifics of the DVD Video
format. The VOB files there are not video containers, they are a
container for a kind of virtual filesystem on top of the real
filesystem, indexed by the IFO files. You need a tool that can
understand that.

The dvd2concat script shipped with FFmpeg is an example of such a tool,
but it is very rudimentary.

Please do not Cc me.

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment