Re: [Mjpeg-users] mplex problem

2006-01-21 Thread Bernhard Praschinger
Hallo

> > - Grab the source code and modify the AC3 reader loop so it simply ignores
> > some number of broken CRC's and just extrapolates from previous AC3 frames
> > instead of giving up immediately.   Not rocket-science (see
> > mplex/ac3stream.cpp - its obvious whats going on).
> Wow.. Modify source codeNo, may not be rocket science, but isn't
> calculus/logic 101 either. Way over my head. I would have to understand what
> it is that I am looking at/doing, and that is beyond my mere mortal
> capabilities at this time.
In the other mail you wrote that you use transcode. What commands does
transcode use ? 
Have you tried running that commands "by hand" on your commandline ?

> I am an old guy (70 yoa) There were no computers when I was a young man,
> except maybe that IBM behemoth with vacuum tubes. I started out with DOS and
> Win 3.11 many years ago (15+ ?). Have no formal training whatsoever. Started
> with Linux RH 5.something 5(?) years ago? I have little desire nor the time
> to explore the depths of DVD authoring/conversion. Just fascinated by it and
> trying to reproduce usable DVDs for my grandchildren. (Charlotte's Web
> etc. ?)
That sound as if you would not need AC3 sound. When you decode the audio
you should get a AC3 file, you should be able to convert that to mp2 (2
chanels only) file with mp2enc from the mjpegtools. 
Take a look a a52dec package. 
With a command like that you should be able to create a stereo wav file:
cat test2.mpg | extract_a52 - -s | a52dec -o wav 2>dev/null >sound.wav

With:
cat sound.wav | mp2enc --o sound.mp2 
you should be able to create a mp2 audio file. 

You can use the mp2 audio file for you DVD, but is is only allowed for
PAL DVD's, for NTSC, you should not use it, but it works most of the
time. 

auf hoffentlich bald,

Berni the Chaos of Woodquarter

Email: [EMAIL PROTECTED]
www: http://www.lysator.liu.se/~gz/bernhard


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] mplex problem

2006-01-21 Thread Bob Stia
On Saturday 21 January 2006 05:41, Andrew Stevens wrote:
> Hi,
>
> > Joined this and the transcode list about a week ago and have been lurking
> > to see if I am in the right place
>
> You're in the right place for mplex!
>
> > Anyway, I can still build my vob's separate my audio and video, and
> > shrink my video using tc. Problem comes when I try to rebuild the files
> > to an mpeg with mplex using the command; "mplex -f 8 -o "movie%d.mpg"
> > shrink.m2v movie.ac3" The command errors out with the following. Here are
> > some lines from the first try:
> >
> >
> > **ERROR: [mplex] Can't find next AC3 frame: @ 349129984 we have 04c3 -
> > broken bit-stream?
> > linux:/workspace #                                    
>
> AC3 audio frames have a header that starts with a 16-bit byte-aligned
> 'syncword' 0x0b77 and includes a encoded frame-length.

OK, I think.
>
> This error message is generated if, when mplex tries to read the next AC3
> frame it does not find the sync word.  The hex printed out after 'we have'
> is what it found in place of the syncword.

OK.
>
> There are really only two possible causes.
>
> 1. There is a bug in mplex' look-up table that gives the length of AC3
> frames from the encoded frame-length.

Ummm...Not likely, right?
>
> 2. The AC3 stream is corrupt.

Could be, I guess. More below.
>
> Mplex reckons it at byte 349129984 in the AC3 stream.  Now 448 kbit/sec
> corresponds to a mere 56000 bytes per second.  So mplex reckons it is 103
> minutes into the audio stream.   If this is very near or at the end of the
> video stream the probable cause is simple: something upstream truncated /
> corrupted the last AC3 frame.  Simply chopping of 1-2KB from the end of the
> stream should solve your problem (mplex can recover from the last frame
> being chopped off).

W... OK, I think I know what you are saying. But certainly don't know what 
to do about that. How does one "chop off" a couple of kb?
>
> Other things to try:
>
> - Try re-extracting the AC3.

Did that twice, with two different DVDs. same result

> - Use a hex-editor to patch the AC3 stream.  The frames appear to be all
> 1792 bytes long.  Copy the bytes from  349129984-1792 to 349129984-1
> incluse to 349129984 to 349129984+1791 inclusive.  You'll get a 'pop' in
> the audio but mplex should be able to recover.

I have no idea how I would do that. Have seen others talk about this but 
wouldn't even know where to start or what to put there once I did.
>
> - Grab the source code and modify the AC3 reader loop so it simply ignores
> some number of broken CRC's and just extrapolates from previous AC3 frames
> instead of giving up immediately.   Not rocket-science (see
> mplex/ac3stream.cpp - its obvious whats going on).

Wow.. Modify source codeNo, may not be rocket science, but isn't 
calculus/logic 101 either. Way over my head. I would have to understand what 
it is that I am looking at/doing, and that is beyond my mere mortal 
capabilities at this time.
>
How about this, I muddle along trying the various things that I understand/ 
are capable of doing, and report back hoping that benevolent gurus like 
yourself have the patience to guide me along the proper path. Mind you, I am 
not seeking a tutorial on this. Just some guidance on what to do next or 
where to find it,

I am an old guy (70 yoa) There were no computers when I was a young man, 
except maybe that IBM behemoth with vacuum tubes. I started out with DOS and 
Win 3.11 many years ago (15+ ?). Have no formal training whatsoever. Started 
with Linux RH 5.something 5(?) years ago? I have little desire nor the time 
to explore the depths of DVD authoring/conversion. Just fascinated by it and 
trying to reproduce usable DVDs for my grandchildren. (Charlotte's Web 
etc. ?)

Anyway, I really appreciate your reply which gives me better understanding but 
not necessarily solutions to these things.

Thanks again,
Bob S.


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] mplex problem

2006-01-21 Thread Andrew Stevens
Hi,

> Joined this and the transcode list about a week ago and have been lurking
> to see if I am in the right place

You're in the right place for mplex!
>
> Sent a very similar message to the transcode list and they provided a few
> suggestions which did not work out. They told me this is where the mplex
> experts hang out, so here I am.
>
> Anyway, I can still build my vob's separate my audio and video, and shrink
> my video using tc. Problem comes when I try to rebuild the files to an mpeg
> with mplex using the command; "mplex -f 8 -o "movie%d.mpg" shrink.m2v
> movie.ac3" The command errors out with the following. Here are some lines
> from the first try:


> **ERROR: [mplex] Can't find next AC3 frame: @ 349129984 we have 04c3 -
> broken bit-stream?
> linux:/workspace #                                    

AC3 audio frames have a header that starts with a 16-bit byte-aligned 
'syncword' 0x0b77 and includes a encoded frame-length.

This error message is generated if, when mplex tries to read the next AC3 
frame it does not find the sync word.  The hex printed out after 'we have' is 
what it found in place of the syncword.

There are really only two possible causes.

1. There is a bug in mplex' look-up table that gives the length of AC3 frames 
from the encoded frame-length.

2. The AC3 stream is corrupt.

Mplex reckons it at byte 349129984 in the AC3 stream.  Now 448 kbit/sec 
corresponds to a mere 56000 bytes per second.  So mplex reckons it is 103 
minutes into the audio stream.   If this is very near or at the end of the 
video stream the probable cause is simple: something upstream truncated / 
corrupted the last AC3 frame.  Simply chopping of 1-2KB from the end of the 
stream should solve your problem (mplex can recover from the last frame being 
chopped off).

Other things to try:

- Try re-extracting the AC3.
- Use a hex-editor to patch the AC3 stream.  The frames appear to be all 1792
bytes long.  Copy the bytes from  349129984-1792 to 349129984-1 incluse to
349129984 to 349129984+1791 inclusive.  You'll get a 'pop' in the audio but 
mplex should be able to recover.

- Grab the source code and modify the AC3 reader loop so it simply ignores 
some number of broken CRC's and just extrapolates from previous AC3 frames 
instead of giving up immediately.   Not rocket-science (see 
mplex/ac3stream.cpp - its obvious whats going on).

cheers,

Andrew


>
> On my last attempt, I got this:
>
>    INFO: [mplex] target data-rate specified               : 1008
> ++ WARN: [mplex] Target data rate lower than computed requirement!
> ++ WARN: [mplex] N.b. a 20% or so discrepancy in variable bit-rate
> ++ WARN: [mplex] streams is common and harmless provided no time-outs will
> occur
>    INFO: [mplex] Run-in Sectors = 89 Video delay = 13019 Audio delay =
> 16022 INFO: [mplex] New sequence commences...
>    INFO: [mplex] Video e0: buf=      0 frame=00 sector=
>    INFO: [mplex] Audio bd: buf=      0 frame=00 sector=
> ++ WARN: [mplex] Stream e0: data will arrive too late sent(SCR)=102253
> required(DTS)=13019
> ++ WARN: [mplex] Video e0: buf=  32875 frame=61 sector=0037
> ++ WARN: [mplex] Audio bd: buf=  14781 frame=38 sector=0034
>
> From those warnings I am guessing that somehow the audio & video are out of
> sync. (bitrate?) but I just don't know, or if so, how to fix it. Nothing in
> man mplex jumps out at me.
>
> More info: I deleted everything and tried again. Same result. Then I tried
> a different DVD ( that I had copied successfully before) and got the same
> result.
>
> I have google-d, howto-ed man-ed and faq-ed for hours on end without
> finding the answer. The most helpful was LinuxQuestions but even there,
> although the problem was brought up, there were no answers.
>
> Really hope this is the right place and that somebody can help me. As I
> said before, I never had any problems in SuSE 9.2 with the older versions
> of this software.
>
> Bob S.
>
>
> ---
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
> ___
> Mjpeg-users mailing list
> Mjpeg-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mjpeg-users


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/lis