Opened 8 years ago

Closed 8 years ago

#3541 closed defect (fixed)

amr file use the last packet mode and size to calculate bit rate,

Reported by: queniao Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: amr
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% ffprobe 111.amr -show_streams
ffmpeg 2.1

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (1)

111.amr (6.1 KB ) - added by queniao 8 years ago.

Download all attachments as: .zip

Change History (6)

by queniao, 8 years ago

Attachment: 111.amr added

comment:1 by Carl Eugen Hoyos, 8 years ago

Is this not reproducible with ffmpeg (the application)?

Please test current git head and please provide the failing command line together with the complete, uncut console output to make this a valid ticket.

comment:2 by queniao, 8 years ago

~/o/FFmpeg/FFmpeg-master$ ./ffprobe ~/raw/111.amr -show_streams
ffprobe version 2.2.git Copyright (c) 2007-2014 the FFmpeg developers

built on Apr 10 2014 10:15:28 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --disable-yasm
libavutil 52. 75.100 / 52. 75.100
libavcodec 55. 58.103 / 55. 58.103
libavformat 55. 36.103 / 55. 36.103
libavdevice 55. 11.100 / 55. 11.100
libavfilter 4. 3.100 / 4. 3.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 18.100 / 0. 18.100

[amr @ 0x1bb8240] Estimating duration from bitrate, this may be inaccurate
Input #0, amr, from '/home/qiniu/raw/111.amr':

Duration: 00:00:09.56, bitrate: 5 kb/s

Stream #0:0: Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 5 kb/s

[STREAM]
index=0
codec_name=amrnb
codec_long_name=AMR-NB (Adaptive Multi-Rate NarrowBand)
profile=unknown
codec_type=audio
codec_time_base=1/8000
codec_tag_string=samr
codec_tag=0x726d6173
sample_fmt=flt
sample_rate=8000
channels=1
channel_layout=mono
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/8000
start_pts=N/A
start_time=N/A
duration_ts=76480
duration=9.560000
bit_rate=5200
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
STREAM

comment:3 by queniao, 8 years ago

fix it by set bit rate only once
FFmpeg/libavformat/amr.c View

 @@ -138,7 +138,8 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
          return AVERROR(EIO);
  
      /* Both AMR formats have 50 frames per second */
 -    s->streams[0]->codec->bit_rate = size*8*50;
 +    if ( s->streams[0]->codec->bit_rate == 0 )
 +	    s->streams[0]->codec->bit_rate = size*8*50;
  
      pkt->stream_index = 0;
      pkt->pos          = pos;
Last edited 8 years ago by Carl Eugen Hoyos (previous) (diff)

comment:4 by Carl Eugen Hoyos, 8 years ago

Is the problem not reproducible with ffmpeg -i 111.amr?

comment:5 by Carl Eugen Hoyos, 8 years ago

Component: ffprobeavformat
Keywords: amr added
Reproduced by developer: set
Resolution: fixed
Status: newclosed
Version: 2.1.4git-master

Should be fixed in c43222f4 - thank you for the report!

Note: See TracTickets for help on using tickets.