[FFmpeg-devel] [PATCH] raw audio read block size align

Maksym Veremeyenko verem
Thu Nov 27 14:05:21 CET 2008


Hi!

Originally similar patch was introduced in:

http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-October/055484.html
http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-November/055683.html

and recently mentioned on looking for solution on recovering truncated 
PCM packet.

Newer version of patch attached.

It fix "6 channel raw audio input" issue, but cause regression test fail 
for some files.

Some notes about *a-g726.wav* regression test DID NOT pass:

We perform test transcode by next command:

ffmpeg -ab 128k -ac 2 -f s16le -i 
/usr/local/src/ffmpeg-r15943/tests/asynth1.sw -ab 32k -ac 1 -ar 8000 
-acodec g726 -y g726.wav

Without patch resulting file has size *24279* bytes. After applying 
patch it size become *24082* bytes.

If we just (without applying patch) modify libavformat/raw.c:
[...]
-#define RAW_PACKET_SIZE 1024
+#define RAW_PACKET_SIZE 4096
[...]
g726.wav will have *24082* bytes length

If we just (without applying patch) modify libavformat/raw.c:
[...]
-#define RAW_PACKET_SIZE 1024
+#define RAW_PACKET_SIZE 512
[...]
g726.wav will have *24858* bytes length

My conclusion: regression test do/did not pass for g726 after applying 
this patch or patch from original thread, because of buffer/packet 
length/size dependencies in g726.c

Other files that did not passed regression test also depends (IMHO) on 
*RAW_PACKET_SIZE* from libavformat/raw.c. Here results:

-rw-r--r-- 1 root root   24279 2008-11-27 13:37 a-g726.wav.1024
-rw-r--r-- 1 root root   24279 2008-11-27 13:39 a-g726.wav.2048
-rw-r--r-- 1 root root   24082 2008-11-27 13:47 a-g726.wav.4096
-rw-r--r-- 1 root root   24858 2008-11-27 13:38 a-g726.wav.512

-rw-r--r-- 1 root root 1066168 2008-11-27 13:37 a-pcm_s16be.mkv.1024
-rw-r--r-- 1 root root 1062549 2008-11-27 13:39 a-pcm_s16be.mkv.2048
-rw-r--r-- 1 root root 1060743 2008-11-27 13:47 a-pcm_s16be.mkv.4096
-rw-r--r-- 1 root root 1073405 2008-11-27 13:38 a-pcm_s16be.mkv.512

-rw-r--r-- 1 root root 1063137 2008-11-27 13:37 a-pcm_s16be.mov.1024
-rw-r--r-- 1 root root 1061069 2008-11-27 13:39 a-pcm_s16be.mov.2048
-rw-r--r-- 1 root root 1060037 2008-11-27 13:47 a-pcm_s16be.mov.4096
-rw-r--r-- 1 root root 1067273 2008-11-27 13:38 a-pcm_s16be.mov.512

-rw-r--r-- 1 root root 1066168 2008-11-27 13:37 a-pcm_s16le.mkv.1024
-rw-r--r-- 1 root root 1062549 2008-11-27 13:39 a-pcm_s16le.mkv.2048
-rw-r--r-- 1 root root 1060743 2008-11-27 13:47 a-pcm_s16le.mkv.4096
-rw-r--r-- 1 root root 1073405 2008-11-27 13:38 a-pcm_s16le.mkv.512

-rw-r--r-- 1 root root 1592337 2008-11-27 13:37 a-pcm_s24be.mov.1024
-rw-r--r-- 1 root root 1590269 2008-11-27 13:39 a-pcm_s24be.mov.2048
-rw-r--r-- 1 root root 1589237 2008-11-27 13:47 a-pcm_s24be.mov.4096
-rw-r--r-- 1 root root 1596473 2008-11-27 13:38 a-pcm_s24be.mov.512

-rw-r--r-- 1 root root 2121537 2008-11-27 13:37 a-pcm_s32be.mov.1024
-rw-r--r-- 1 root root 2119469 2008-11-27 13:39 a-pcm_s32be.mov.2048
-rw-r--r-- 1 root root 2118437 2008-11-27 13:47 a-pcm_s32be.mov.4096
-rw-r--r-- 1 root root 2125673 2008-11-27 13:38 a-pcm_s32be.mov.512

-rw-r--r-- 1 root root  533937 2008-11-27 13:37 a-pcm_s8.mov.1024
-rw-r--r-- 1 root root  531869 2008-11-27 13:39 a-pcm_s8.mov.2048
-rw-r--r-- 1 root root  530837 2008-11-27 13:47 a-pcm_s8.mov.4096
-rw-r--r-- 1 root root  538073 2008-11-27 13:38 a-pcm_s8.mov.512

So, the problem (IMHO) not in patch, i think it just discover other 
problems....

Any suggestion about patch?

-- 
________________________________________
Maksym Veremeyenko

-------------- next part --------------
A non-text attachment was scrubbed...
Name: raw_audio_div_readblock.patch
Type: text/x-patch
Size: 1604 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081127/bb79968e/attachment.bin>



More information about the ffmpeg-devel mailing list