New submission from verem <[email protected]>: I faced a problem that ffmpeg's produced file is twice longer (in time terms) as source. That happens on AVI files that is non-interleaved.
Call example:
-- cut here --
[r...@diva-proxy ffmpeg-r19698]# ./ffmpeg_g -i /home/diva/2/TEST3-non-inter.avi
-y /home/diva/2/TEST3-non-inter.mp4
FFmpeg version SVN-r19698, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/home/enctools --enable-libfaac --enable-libfaad
--enable-libmp3lame --enable-postproc --enable-pthreads --enable-libx264
--enable-libxvid --extra-cflags=-I/home/enctools/include
--extra-ldflags=-L/home/enctools/lib --enable-shared --enable-gpl
--enable-nonfree --enable-avfilter --enable-avfilter-lavf
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.32. 0 / 52.32. 0
libavformat 52.38. 0 / 52.38. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 0. 5. 0 / 0. 5. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Aug 25 2009 19:20:06, gcc: 4.3.2 20081105 (Red Hat 4.3.2-7)
[avi @ 0x8091420]non-interleaved AVI
Input #0, avi, from '/home/diva/2/TEST3-non-inter.avi':
Duration: 00:00:01.92, start: 0.000000, bitrate: 31505 kb/s
Stream #0.0: Video: dvvideo, yuv420p, 720x576, 25 tbr, 25 tbn, 25 tbc
Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Output #0, mp4, to '/home/diva/2/TEST3-non-inter.mp4':
Stream #0.0: Video: mpeg4, yuv420p, 720x576, q=2-31, 200 kb/s, 25 tbn, 25
tbc
Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 85 fps= 0 q=24.8 Lsize= 351kB time=1.77 bitrate=1621.7kbits/s
video:330kB audio:18kB global headers:0kB muxing overhead 0.719196%
-- /cut here --
As seen resulting file is at least 85 frames length but source is 48
The problem happens because of index aligning/honor code in avi_read_packet
called each function call instead of then case then (avi->stream_index < 0)
Attached patch fix that problem. And resulting transcoding process:
-- cut here --
[r...@diva-proxy ffmpeg-r19698]# ./ffmpeg_g -i /home/diva/2/TEST3-non-inter.avi
-y /home/diva/2/TEST3-non-inter.mp4
FFmpeg version SVN-r19698, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/home/enctools --enable-libfaac --enable-libfaad
--enable-libmp3lame --enable-postproc --enable-pthreads --enable-libx264
--enable-libxvid --extra-cflags=-I/home/enctools/include
--extra-ldflags=-L/home/enctools/lib --enable-shared --enable-gpl
--enable-nonfree --enable-avfilter --enable-avfilter-lavf
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.32. 0 / 52.32. 0
libavformat 52.38. 0 / 52.38. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 0. 5. 0 / 0. 5. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Aug 25 2009 19:20:06, gcc: 4.3.2 20081105 (Red Hat 4.3.2-7)
[avi @ 0x9889420]non-interleaved AVI
Input #0, avi, from '/home/diva/2/TEST3-non-inter.avi':
Duration: 00:00:01.92, start: 0.000000, bitrate: 31505 kb/s
Stream #0.0: Video: dvvideo, yuv420p, 720x576, 25 tbr, 25 tbn, 25 tbc
Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Output #0, mp4, to '/home/diva/2/TEST3-non-inter.mp4':
Stream #0.0: Video: mpeg4, yuv420p, 720x576, q=2-31, 200 kb/s, 25 tbn, 25
tbc
Stream #0.1: Audio: aac, 48000 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 48 fps= 0 q=31.0 Lsize= 267kB time=1.77 bitrate=1234.5kbits/s
video:246kB audio:18kB global headers:0kB muxing overhead 0.830652%
-- /cut here --
As seen output file has a correct length - 48 frames.
Sample file uploaded to:
ftp://upload.ffmpeg.org/MPlayer/incoming/non_interleaved_avi/non-interleaved_AVI.avi
----------
files: avidec_non_interleaved_read_packet_fix.patch
messages: 6757
priority: normal
status: new
substatus: new
title: non-interleaved AVI read fix
type: patch
_____________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/roundup/ffmpeg/issue1343>
_____________________________________________________
avidec_non_interleaved_read_packet_fix.patch
Description: Binary data
