[Ffmpeg-devel] DVR-MS bug (MP2 decoding)

John Donaghy johnfdonaghy
Wed Dec 20 21:10:46 CET 2006


Hi

It's been a long time since I posted here but if anyone cares (which I
doubt) I discovered recently why the audio in this file doesn't play.
The problem seems to be that the audio in this sample is AC3 but the
'format tag' in the WAVEFORMATEX structure in the audio stream header
incorrectly indicates that the audio is MP3 (which it tends to be in
dvr-ms).

I discovered this while working on getting mplayer to play these files
using libmpdemux. I obtained a few more samples where the audio didnt
work - sometimes the audio was MP3 and sometimes it was AC3. The
'format tag' was always wrong (sometime ='0', sometime ='1' and in
this case ='80') when the audio didnt work.

I dont have a patch for this because all I've been able to do so far
is hard code the correct value which makes the audio work if it's the
right kind. I suppose the only way to fix it is to find if the audio
codec type can be read from somewhere else in the file but I'm not too
hopeful about finding it in the absence of proper documentation.

Supposedly the audio is only ever MP3 or AC3 in a dvr-ms file so maybe
it's possible to somehow try one then the other. I have looked into it
though.

John


On 4/25/06, Steve Lhomme <steve.lhomme at free.fr> wrote:
> Michael Niedermayer wrote:
> >>> I get the source width/height from AVCodecContext* catched as this:
> >>>
> >>> video_codec = avctx->streams[vidTrackId]->codec;
> >> Thanks for that.
> >>
> >>
> >>>>> So I assume it's MP2 and not AC3.
> >>>> You're right, I looked at it in GraphEdit and on my machine it chooses
> >>>> my InterVideo audio decoder for this file rather than the regular MPEG
> >>>> Audio Decoder. The properties dialog for the Intervideo decoder calim
> >>>> it is '2 speaker mode, Dolby Sound compatible (as opposed to
> >>>> stereo/mono). It says the format is MPEG2 and the attributes are
> >>>> 16bit/48k/1ch. I wonder what is different about this audio stream that
> >>>> causes it to pick the Intervideo decoder - maybe the 'dolby' setting?
> >>> All I know is that it's not AC3. DScaler has an input type
> >>> MEDIATYPE_DVD_ENCRYPTED_PACK instead of MEDIATYPE_Audio, that could be
> >>> the difference.
> >> I'm afraid I've got no more ideas about this. I looked at what the
> >> code was doing and the demuxer reports it as an mp2 stream which is
> >> presumably correct. Then the mp3 lib code makes a call to 'read_frame'
> >> which repeatedly calls 'decode_header' to try to find a valid header
> >> without success. libmad.a also fails in that it plays some strange
> >> noises instead of the real audio stream.
> >
> > hmm, what happens if you dump the audio stream into a file and try to
> > play that with mplayer or ffmpeg?
>
> I tried:
> ffmpeg -i /C/test/DivX/today.dvr-ms -vcodec copy -an dvr-ms.m2v
>
> And got a file doesn't doesn't play.
>
> Then I tried:
> ffmpeg -i /C/test/DivX/today.dvr-ms -acodec copy -vn dvr-ms.mp2
>
> And got an empty file.
>
> > and if that doesnt work, maybe post a few kb of that audio stream maybe
> > someone can spot something by looking at it ....
>
> Is my command-line correct to extract audio from the source file ?
>
> Steve
>
> --
> robUx4 on blog <http://robux4.blogspot.com/>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>




More information about the ffmpeg-devel mailing list