[MPlayer-dev-eng] divx2svcd-0.5.1

Jan Knutar jknutar at nic.fi
Sun Apr 25 14:16:29 CEST 2004


On Saturday 24 April 2004 23:48, VMiklos wrote:

> have you any sample file that divx2svcd can't convert correctly?

Several, however no efficient means of sharing them :)

Another fun thing...
> the only changed thing is that if the video is smaller than one cd,
> vcdimager gets directly the mpg that mencoder created.

mpeg's created with -of mpeg are mpeg-1 container with mpeg2video and 
mp2 audio inside, right?

To be honest, I never tried running your script before. It looked scary. 
I only read it for hints on how to make SVCD in a *nix enviroment :) 
Originally I thought the reason for dumping video+audio and 
re-multiplexing them was to move the m2v and mp2 from mpeg-1 container 
to properly aligned mpeg2 container for vcdimager... I tried using 
ffmpeg for that, with -acodec copy and -vcodec copy, but it wasn't very 
good =/

Well, vcdimager seems to accept the mencoder made mpeg's, so I'm wrong 
on that point, however, now I actually tested your script on a small 
avi :-)

Vcdimager had the audacity to whine about mencoder's mpeg's, observe:

++ WARN: mpeg stream will be padded on the fly -- hope that's ok for 
you!
++ WARN: autopadding requires to insert additional 4996980 zero bytes 
into MPEG stream (due to 18105 unaligned packets of 18106 total)
++ WARN: this VCD type should not contain MPEG1 streams
   INFO: writing track 1 (ISO9660)...
   INFO: writing track 2, MPEG1, PAL 2/3 D1 (480x576/25fps), audio[0]: 
l2/44.1kHz/128kbps/stereo ...

Ok, so it thinkign it's mpeg1 is maybe minor issue, but the 8% overhead 
because of autopadding means the smaller than cd size isn't always true 
:(

vcdimager 0.9.17-libcdio, btw

Considering that mencoder created mpeg's are still mostly in sync, when 
played with mplayer, but seem to loose sync when split into audio and 
videotrack and then remultiplexed, it seems to me we'd need something 
that could repackage the mencoder mpeg into properly aligned mpeg2 ps. 


Oh and please don't think I'm bashing your script, I'm generally 
frustrated about the seemingly endless chase of finding a way to create 
SVCD's on *nix :)

<6 hours of cola and staring at 'mplayer | tr \\r \\n' later>

I noticed something when playing stuff that eventually desynchs when 
gone through the whole avi -> mpeg1-ps (presumably) -> m2v,mp2 -> 
mpeg2-ps process.

When playing -of mpeg produced mpeg of strange avi, A-V will suddenly 
jump. MPlayer catches up soon enough though, and ct: value stabilizes 
at -2.1 (I guess that means it delayed video by 2.1 seconds in total, 
to maintain synch).
The problem is of course, as far as I'm guessing, that when the mpeg is 
dumped into m2v and mp2, whatever information that mplayer based its 
A-V correction on is lost...

But wait! There's more...
If I repeat the exact same mencoder command line that produced the 
strange mpeg above, except with -of avi instead, I now see just a jump 
in the video (I think someone described this as 'the notorious mencoder 
jerky encode'), and the A-V and ct: values stay constant.

When encoding, I get a few "1 duplicate frame(s)!" at what looks like 
pretty much the same time into the clip as the strange behaviour with 
A-V and ct: was observed. With -of mpeg, after every duplicate frames 
messages, I get the following one as well "Unknown block type, possibly 
non-MPEG stream!".
There are also at the beginning many messages like
"Error in stream: PTS to SCR delay 7956 is too little"
"Error in stream: PTS earlier than SCR!"
"Error in stream: PTS to SCR delay 0 is too little!"
"Warning: DTS to SCR delay is too small"

The number it warns about starts at 8656, goes down to 0 (and negative, 
I presume judging by the messages!), and then starts to grow, and goes 
away.

Doing dumpvideo+audio then tcmplex on that mpeg stream produces mpeg 
stream which mplayer does not play with proper audio synch, which I 
pretty much expected.

Then I had crazy idea: Have mencoder stick the .avi version into -of 
mpeg:
mencoder strange-av-fixed-in-avi.avi -oac copy -ovc copy -of mpeg -o \ 
strange-av-possiblyfixed-mpeg-via-avi.mpeg

Alas, mencoder segfaults:
Segmentation fault (core dumped) Trem:   0min   9mb  A-V:0.040 
[2043:128]

:(

Doing it with -ovc lavc reintroduces strange a-v and ct: thing into the 
resulting mpeg... Sigh.

I tried using ffmpeg a little bit too, but so far didn't manage to make 
one single mpeg with audio in sync with it :)

Unfortunately, I don't have any means to upload the avi in question I'm 
trying to svcd. I used mencoder -ss -endpos to extract part with big 
desync into a more comfortable 5.6 meg mpeg, if you want to try play 
around with it. I imagine it's not as useful when it's not the entire 
original avi before any mencoder meddling, but it's nearly same sort 
temporary -of mpeg type file your script creates, apart from using -ss 
and -endpos...



What a long mail of absolutely horrendous amount of bug observations 
without any insight into the cause and solution yet... :/
I bet there's someone out there shaking his/her head at my futile 
attempts to make SVCD's, thinking that I'm doing everything so 
fundamentally wrong that it's hopeless to even try tell me how you're 
supposed to do. :-\




More information about the MPlayer-dev-eng mailing list