Log in

View Full Version : not all muxers / demuxers are born equal ...


DCK21
25th February 2003, 17:04
Hi all,

A friend purchased a second hand DVD movie, and it
included a SVCD backup, in 2 CDs. She was unable
to see it on her standalone, and brang it to me. I could
neither. So, I got curious and did some experimenting.

DVD: PAL, 25fps, 177"

SVCD: 2CDs. First one, 79'57" Second one, 79'45"
(around 17' less ... what was cut?)
1 audio stream.

later edit: amongst DVD2SVCD 1.1.0b1c bugs is
"Last DVD chapter was omited" (?)

It contains a log file with the tipical DVD2SVCD info.
Was produced using CEE. As DVD2SVCD is not logging
which version, I have got no further information.

later edit: DVD2SVCD logs that information. It was
produced with AVI2SVCD 1.1.0b1c. CEE 2.50.1

After experimentation, I tend to believe that the
"backuper's cut" was "hand made" starting out from
a DVD2SVCD output.

I was finally able to produce a working SVCD, it played
ok in the standalones with just an small bad passage,
after demuxing, muxing, authoring and burning, and got
some conclusions along the process that I would like to
share. By the way, I was able to find very few info
regarding muxing/demuxing and nothing comparing one
to other. Only people telling this is better or
this is not good. Any hints to good info is welcomed!
Resume:

Demuxing
--------
Moonlight xmuxer and mpgtx (GNU, see mpgtx.sourceforge.net)
seem to do a correct demuxing work;
both work with mpg copied with Explorer & xriped, of course

To my surprise, TMPGEnc failed to demux properly!

Muxing
------
TMPGEnc seems to do a correct work.
Surprisingly, bbMPEG fails!


Notes: mpgtx doc says it demuxes the elementary
streams. Perhaps (not tried) is able to extract two
audios and private streams (subs) ?
Xmuxer seems able to extract several elementary
streams ...


Those who would like to read the full _long_ story,
enjoy!
DCK21<-HAL

======================================================

Initial analysis, CD1
(all file comparisons made using md5 file fingerprints)

a) Got copies of AVSEQ01.MPG to the HD in three
manners:
- windows explorer, copy; both W98SE and WXP
- VcdImager Xrip, via VCDEasy, 1.1.4; both W98SE and XP
- Isobuster, 1.2; WXP

-----------------------------------------------------
conclusions:

Verified that VCDEasy and Isobuster, both W98SE
and WXP, produce the same copy in the Hard Disk:
File size: 813040KB (i.e. 793MB)

Both under W98SE and WXP, Explorer gave the same
File size: 822835KB (i.e. 803.5MB)

(hint 822835/813040 = 2352/2324)

(well, I did this to check how tools behave in front of
those different AVSEQ01.MPGs)
-----------------------------------------------------

b) As first step, tried to re-author the Xrip´ed file
with VCDEasy.

VCDEasy / VcdImager failed to generate a .bin

Messages:
- unexpected start code
- non-MPEG-1 audio stream header seen
- buflen 2321!=2324
- invalid mpeg packet found at packet #307100

-----------------------------------------------------

conclusions:

so ... it seems that there is a broken mpeg stream
there: let's start with the demux - mux game
-----------------------------------------------------

c.1) demuxers that gave problems and/or unacceptable
results:

TMPGEnc 2.58 and also 2.57
- Both with Xriped mpg and with explorer copied ones:
produced a parcial output:
m2v=624089KB
mp2=62294KB
(identical files for the four cases)

BBDMUX v1.9 (Beyeler):
- Both with explorer mpg, and xriped mpg:
produced a parcial output:
m2v=624089
mp2=62294
(identical files for the two cases)

Demuxone (1.0.0.1):
- with Explorer copied mpg, crashes: "demultiplex buffer
overflow"
- with Xriped mpg, produces a parcial output after
"demultiplexer buffer is full".
m2v=628704KB
mp2=62765KB

MPegRepair 1.591
- explorer mpg, crashes: "invalid picture type at
offset 13728173"
- xriped mpg, produced good results (see later)

--------------------------------------------------------

c.2) Successfull demuxers (more or less ...)

mpgxt:
- Both with Explorer copied mpg (needed -X to work) as with
Xriped copies (no needed -X):
produced valid files:
m2v=716608KB
mp2=74961KB
(identical files for the two cases)

XMuxer 2.03
- Both with Explorer copied mpg and with Xriped ones:
produced valid files:
m2v=716605KB (note that it is 3KB less than above!)
mp2=74961KB -same as above with mpgtx-
(identical files for the two cases)

MPegRepair 1.591
- xriped mpg: produced same sized files as mpgxt,
audio was the same file, but video was different file.
-------------------------------------------------------

Conclusions:

With respect to muxing

Not a good choice for this particular broken
stream for demuxing:

TMPGEnc
Demuxone
bbdmux
MPegRepair (if used with Explorer extracted file)
Those will not be further used.


Good choices for this broken stream:

MPGTX
XMuxer
(there is an small discrepancy, to be cheked later)

With respect to the way of obtaining the mpg file
(explorer copy vs xrip):

TMPGEnc: irrelevant
Demuxone: not tested
BBDMUX: irrelevant
MPegRepair: essential using xrip

MPGTX: irrelevant
XMuxer: irrelevant

(would there be a common code base in the demuxing parts
of BBDMUX, TMPGEnc and MpegRepair ?)
---------------------------------------------------------

Next fase, muxing, just for MPGTX and XMUXER demuxed files

---------------------------------------------------------

d.1) Muxers that produced non-aceptable results:

Xmuxer 2.03: files were double sized than other muxers (with
almost a 50% padding packets!) No option found to tune that!

BBMPEG: the demuxed files have some error in that makes
BBMPEG muxing fail: when playing, audio is lost from 65' 57"
onwards

later edit: according to http://www.michaeldvd.com.au/Reviews/Reviews.asp?ReviewID=242
"There is a major image skip at 69:01" (!?)

---------------------------------------------------------

d.2) Muxers that produced aceptable results:

TMPGEnc 2.59: Sound ok. mpg 801395KB
VCDEasy complains:
- non-MPEG1 audio stream header seen
- mpeg some marker is not set
.bin=??KB
SVCD OK in standalone player!!!
(even tested to "recreate" the mp2 stream using BeSweet,
but VCDEasy messages did not dissapear).

TMPGEnc 2.58 Sound ok. mpg 803862KB (file slightly bigger!)
VCDEasy complains:
- non-MPEG1 audio stream header seen
- mpeg some marker is not set
.bin=814925KB
SVCD OK in standalone player!!!
----------------------------------------------------------

Other tests / conclusions

----------------------------------------------------------

e.1) Broken stream and TMPGEnc.

Trying to mux with TMPGEnc 2.59 the files demuxed with
also TMPGEnc 2.59 (that is, the files shorter than they
should be), TMPGEnc crashed with message:
"2 s packets cause buffer underflow"

That message seems to be linked with broken streams.

---------------------------------------------------------

e.2) Demux, mux, demux again

mpgs generated with TMPGEnc were again demuxed, with mpgtx,
tmpgenc and xmuxer.

Courious results found:

- audio demuxed file was always the same file (for the
demuxed ones with either mpgtx or xmuxer), irrespective
of the explorer copy / xrip and/or mpgtx/tmpgenc/xmuxer
demux.
That is, the audio stream was "invariant"

- video demuxed file was never the same file to the
demuxed original one. Nevertheless, in one ocasion
(explorer copy + xmuxer demux + tmpgenc mux + mpgtx demux)
the video demuxed file coincided with the original one. I
have been unable to reproduce the case, perhaps due to the
installation of some sw "in-between" (particularly,
riff-cdxa-filter-test6b)

---------------------------------------------------------

Final conclusions (for this very specific case)

1.- The SVCD was "recovered"

2.- Demuxing

xmuxer and mpgtx seem to do a correct demuxing work;
both work with mpg copied with Explorer & xriped, of course.
tmpgenc failed to demux properly!

3.- Muxing

TMPGEnc seems to do a correct work.
Surprisingly, bbMPEG fails!!

---------------------------------------------------------

Sorry for the long post!