[FFmpeg-devel] [RFC] larger PCM packets from avidec

Maksym Veremeyenko verem
Wed Mar 10 07:35:48 CET 2010


Michael Niedermayer ???????(??):
> On Tue, Mar 09, 2010 at 09:34:04PM +0100, Reimar D?ffinger wrote:
>> Hello,
>> with the sample in MPlayer/incoming/demux-avi/mjpg-pcm.avi the AVI demuxer
>> returns audio packets of 128 bytes size each (in this case, 3ms worth of data),
>> causing quite a overhead.
I found some players had a problem playing remuxed by ffmpeg avi files 
due to large amount of 128 bytes audio chunks per one video frame chunk...

>> It's not a big issue, but it seems too extreme and since there's no comment
>> on the code how that value was chosen I'd like to hear comments.
>> I guess the 1024 of patch below would be going too far in the other direction,
>> it's just meant as an example.
> 
> your patch does not work
> sample_size=32 is the smallest and it is not increased by your patch
i think it should work. For stereo pcm_s16le ast->sample_size==4 so the 
block size is 4096 after that patch instead of 128 bytes.

Why just do not read complete audio chunk? like for minorityreport.AVI case:


Index: libavformat/avidec.c
===================================================================
--- libavformat/avidec.c	(revision 21737)
+++ libavformat/avidec.c	(working copy)
@@ -746,10 +746,8 @@
          AVIStream *ast= st->priv_data;
          int size, err;

-        if(ast->sample_size <= 1) // minorityreport.AVI 
block_align=1024 sample_size=1 IMA-ADPCM
+        if(ast->sample_size < 32)
              size= INT_MAX;
-        else if(ast->sample_size < 32)
-            size= 64*ast->sample_size;
          else
              size= ast->sample_size;

-- 
________________________________________
Maksym Veremeyenko



More information about the ffmpeg-devel mailing list