Ticket #1654 (closed defect: invalid)
3rd party app needs help with wma2 to pcm output
| Reported by: | 8086 | 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
Change History
comment:1 follow-up: ↓ 3 Changed 10 months ago by compn
- Summary changed from wmv(VC-1) video decoded abnormally to 3rd 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 Changed 10 months ago by 8086
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?



