[FFmpeg-devel] Bug with meta data writing? or empty frames added to begining of video?

Jesus Altuve jaltuve
Fri Aug 17 03:25:57 CEST 2007


(Scenario)
Source video is 49 seconds, but resulting encoded video is 54 seconds as
reported by the metadata in players such as FLV Player or Windows media
player.

Those 5 seconds of aditional video happen to show as a STILL frame at the
very begining of my encoded videos.. no matter what input file I try
(I used, mpeg's wmv, flv and even 3gp files as input) and tried outputs in
flv, mp4 and wmv formats same results I'm using FFmpeg version SVN-r10065.

I tried encoding separately AUDIO only then Video Only streams and..

Audio only encoding stats reports correctly 49 seconds
Video only encoding stats reports 54 seconds (why??)
Both Audio AND Video encoding reports 49 seconds (which is the same size of
the source file, however, media players report its lenght as 54 seconds)

Now.. there's two things here:

  * Either WRONG meta data being written to the output file or..
  * Empty frames being recorded at the beginning of the video, hence meta
data information is right, just that it doesn't match that of the video
stream.

When you write metadata you verify that both audio and video streams are the
same lenght? why not generate a warning if
video_encoding_time != audio_encoding_time?

I tried encoding with the -ss 5 switch and the resulting file was
(correctly) a 49 seconds file.. this would be a workaround *IF* it was
always 5
seconds... however it ranges from 2 seconds to 6 seconds and is not even
related to file size.. it's completely random..

Here's some info on my system:

FFmpeg version SVN-r10065, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-libmp3lame --enable-libvorbis
--enable-libogg --enable-libfaac --enable-libfaad --enable-liba52
--enable-libamr-nb

--enable-libamr-wb --disable-debug --disable-ffserver --disable-ffplay
--enable-memalign-hack --enable-libx264
  libavutil version: 49.4.1
  libavcodec version: 51.40.4
  libavformat version: 51.12.1
  built on Aug 15 2007 20:35:46, gcc: 3.4.6 20060404 (Red Hat 3.4.6-3)

sample output:

[me at somesystem ~]$ ffmpeg -i input.wmv -acodec libmp3lame -ab 32k -ar 22050
-vcodec flv -s 320x240 -b 224k -r 25 -y output.flv
FFmpeg version SVN-r10065, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-libmp3lame --enable-libvorbis
--enable-libogg --enable-libfaac --enable-libfaad --enable-liba52
--enable-libamr-nb

--enable-libamr-wb --disable-debug --disable-ffserver --disable-ffplay
--enable-memalign-hack --enable-libx264
  libavutil version: 49.4.1
  libavcodec version: 51.40.4
  libavformat version: 51.12.1
  built on Aug 15 2007 20:35:46, gcc: 3.4.6 20060404 (Red Hat 3.4.6-3)

Seems stream 1 codec frame rate differs from container frame rate:
1000.00(1000/1) ->
29.97 (30000/1001)
Input #0, asf, from 'input.wmv':
  Duration: 00:00:50.6, start: 0.000000, bitrate: 314 kb/s
  Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 64 kb/s
  Stream #0.1: Video: wmv3, yuv420p, 448x344, 250 kb/s, 29.97 fps(r)
Output #0, flv, to 'output.flv':
  Stream #0.0: Video: flv, yuv420p, 320x240, q=2-31, 224 kb/s, 25.00 fps(c)
  Stream #0.1: Audio: libmp3lame, 22050 Hz, stereo, 32 kb/s
Stream mapping:
  Stream #0.1 -> #0.0
  Stream #0.0 -> #0.1
Press [q] to stop encoding
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. Do not report crashes to FFmpeg developers.
frame= 1319 fps= 87 q=13.2 Lsize=    1929kB time=47.9 bitrate= 330.2kbits/s

video:1473kB audio:187kB global headers:0kB muxing overhead 16.193310%


[me at somesystem ~]$ uname -a
Linux somehost.some.domain 2.6.9-42.0.10.EL #1 Fri Feb 16 17:06:10 EST 2007
i686 i686 i386 GNU/Linux




More information about the ffmpeg-devel mailing list