Opened 12 years ago

Closed 12 years ago

#1654 closed defect (invalid)

3rd party app needs help with wma2 to pcm output

Reported by: Gary Owned by:
Priority: normal Component: avcodec
Version: 0.11.1 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Dear ffmpeg members,

I want to implement a multimedia player based on FFmpeg. Now I wrote a app to decode out audio data from a media file, extracting raw pcm audio data. This app decodes mp3 and some video file successfully. Now I meet a wmv video file which can be decoded but the output pcm data is abnormal. The pcm data should be successive but it's always interrupted. The main API used is as follows:

avformat_open_input(&pCtx, opt.finput, 0, 0);
avformat_find_stream_info(pCtx, 0);
avcodec_find_decoder(pCodecCtx->codec_id);
avcodec_open2(pCodecCtx, pCodec, 0);
avcodec_alloc_frame();
av_read_frame(pCtx, &packet);
while()
{

avcodec_decode_audio4(pCodecCtx, pFrame, &got, &packet);
write(fd, pFrame->data[0], pFrame->linesize[0]);

}

The attachments is the raw pcm wave and the video file info.

App dump info:
Input #0, asf, from 'discovery.wmv':

Metadata:

WMFSDKVersion : 9.00.00.3265
WMFSDKNeeded : 0.0.0.0000
IsVBR : 0

Duration: 00:40:20.25, start: 0.000000, bitrate: 322 kb/s

Stream #0:0(chi): Audio: wmav2 (a[1][0][0] / 0x0161), 32000 Hz, 2 channels, s16, 32 kb/s
Stream #0:1(chi): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 320x240, 284 kb/s, 25 tbr, 1k tbn, 1k tbc

Attachments (1)

attach.tar.gz (3.6 KB ) - added by Gary 12 years ago.

Download all attachments as: .zip

Change History (5)

by Gary, 12 years ago

Attachment: attach.tar.gz added

comment:1 by compn, 12 years ago

Summary: wmv(VC-1) video decoded abnormally3rd party app needs help with wma2 to pcm output

does your discovery.wmv sample work ok with ffmpeg itself? ffmpeg -i yourfile.wmv out.wav
if not, upload your sample file so we can look at it.

comment:2 by Gary, 12 years ago

Thanks. I've checked with command: ./ffmpeg -y -i discovery.wmv -f s16le -ac 2 discovery.pcm

The output pcm data is OK. So I need to check may API call. Maybe I missed some API call to set some parameter. The audio decoding example in the 0.11.1 package can't work. Can you send me a example?

in reply to:  1 comment:3 by Gary, 12 years ago

Replying to compn:

does your discovery.wmv sample work ok with ffmpeg itself? ffmpeg -i yourfile.wmv out.wav
if not, upload your sample file so we can look at it.

Please view my last comment.

comment:4 by Elon Musk, 12 years ago

Resolution: invalid
Status: newclosed

This is not support forum.

Note: See TracTickets for help on using tickets.