[FFmpeg-devel] [PATCH] recover from truncated aiff

Maksym Veremeyenko verem
Thu Nov 27 13:34:41 CET 2008


Michael Niedermayer ???????(??):
> On Thu, Nov 27, 2008 at 10:45:05AM +0200, Maksym Veremeyenko wrote:
[...]
>> Any suggestions?
> 
> looks ok, if it has been tested and confirmed that files for which this
> triggers have no missing samples in their output (also such files should
> cause "Multiple frames in a packet from stream" to be printed by ffmpeg

my test file *E0000535a.aiff* (4896050 bytes) has only 2 bytes in last 
sample (instead of 6):
[...]
4894512 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00
4894528 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00
4894544 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
4896032 00 00 00 00 00 00 00 00 00 30 31 32 33 34 35 36
4896048 37 38
         ^^^^^

after transcoding to 16-bit wav:
[root at dev-2 data]# ffmpeg -i E0000535a.aiff -y E0000535a.wav
FFmpeg version SVN-r15943, Copyright (c) 2000-2008 Fabrice Bellard, et al.
[...]
Input #0, aiff, from 'E0000535a.aiff':
   Duration: 00:00:17.00, start: 0.000000, bitrate: 2304 kb/s
     Stream #0.0: Audio: pcm_s24be, 48000 Hz, stereo, s16, 2304 kb/s
Output #0, wav, to 'E0000535a.wav':
     Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
   Stream #0.0 -> #0.0
Press [q] to stop encoding
Multiple frames in a packet from stream 0
[pcm_s24be @ 0x866fc70]invalid PCM packet
Error while decoding stream #0.0
size=    3188kB time=17.00 bitrate=1536.0kbits/s
video:0kB audio:3187kB global headers:0kB muxing overhead 0.001348%

it gone from resulting sample *E0000535a.wav*:
[...]
3263024 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
3263040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
3264032 00 00 00 00 32 31 35 34
3264040

that display resulting files contains last correct sample.


-- 
________________________________________
Maksym Veremeyenko




More information about the ffmpeg-devel mailing list