Opened 9 years ago

Closed 9 years ago

#4088 closed defect (worksforme)

Theora video duration different depending on scale

Reported by: mlinnosk Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: libtheora ogg
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When converting PNG image sequence to 'Ogg/Theora' video.
With same input, but different output scaling the resulting video file has different duration and drops frames from the end.

Tested with same setup but with '-vcodec mpeg4' and can't reproduce. Observed with '-vcodec libtheora'. Also the '-sws_flags lancoz' doesn't seem to make difference.

The test material has 392 frames and ffmpeg seems to process them all.

How to reproduce:

unzip -p $INPUT_FILE $IMAGE_GLOB | -loglevel quiet -f image2pipe -c:v png -r 25 -i - -s $RESOLUTION -aspect 16:10 -sws_flags lanczos -vcodec libtheora -pix_fmt yuv420p -an -qscale:v $QS -r 25 -y $OUTPUT_FILE

Info:

ffmpeg version 2.4.3-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
built on Nov  4 2014 13:14:24 with gcc 4.8 (Debian 4.8.3-13)
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
libavutil      54.  7.100 / 54.  7.100
libavcodec     56.  1.100 / 56.  1.100
libavformat    56.  4.101 / 56.  4.101
libavdevice    56.  0.100 / 56.  0.100
libavfilter     5.  1.100 /  5.  1.100
libswscale      3.  0.100 /  3.  0.100
libswresample   1.  1.100 /  1.  1.100
libpostproc    53.  0.100 / 53.  0.100


Output1:
Input #0, ogg, from 'file1.ogv':
  Duration: 00:00:15.68, start: 0.000000, bitrate: 2423 kb/s
    Stream #0:0: Video: theora, yuv420p, 1280x800 [SAR 1:1 DAR 8:5], 25 tbr, 25 tbn, 25 tbc
    Metadata:
      ENCODER         : Lavc56.1.100 libtheora

Output2:
Input #0, ogg, from 'file2.ogv':
  Duration: 00:00:15.24, start: 0.000000, bitrate: 1773 kb/s
    Stream #0:0: Video: theora, yuv420p, 1024x640 [SAR 1:1 DAR 8:5], 25 tbr, 25 tbn, 25 tbc
    Metadata:
      ENCODER         : Lavc56.1.100 libtheora

Change History (18)

comment:1 by mlinnosk, 9 years ago

More info:
The original image files are 24bit PNG with resolution 1920x1200. Scaling down to 1280x800 and above seems to work but under that (1024x640...) seems to break.

comment:2 by Carl Eugen Hoyos, 9 years ago

Please understand that bug reports with -loglevel quiet are not valid (except if you want to report an issue with the option). Please provide the actual command line that allows to reproduce the issue (without using variables) together with the complete, uncut console output, either with default or increased loglevel.

comment:3 by mlinnosk, 9 years ago

Sorry about that. I didn't think theres any usefull information in the actual output.

But here it is, with out variables:

unzip -p input.zip 1920x1200/raw/f_*.png | ~/bin/ffmpeg-2.4.3-64bit-static/ffmpeg -f image2pipe -c:v png -r 25 -i - -s 1024x640 -aspect 16:10 -sws_flags lanczos -vcodec libtheora -pix_fmt yuv420p -an -qscale:v 7 -r 25 -y output.ogv
ffmpeg version 2.4.3-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  4 2014 13:14:24 with gcc 4.8 (Debian 4.8.3-13)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, image2pipe, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1200, 25 fps, 25 tbr, 25 tbn, 25 tbc
Output #0, ogg, to 'output.ogv':
  Metadata:
    encoder         : Lavf56.4.101
    Stream #0:0: Video: theora (libtheora), yuv420p, 1024x640 [SAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.1.100 libtheora
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> theora (libtheora))
frame=  392 fps= 18 q=0.0 Lsize=    3299kB time=00:00:15.68 bitrate=1723.4kbits/s    
video:3280kB audio:0kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.576610%

I can't provided the actual files since they are proprietary.

Last edited 9 years ago by mlinnosk (previous) (diff)

comment:4 by mlinnosk, 9 years ago

Weird. By changeing the Y dimension to '600' instead of of '640' the duration is OK.

comment:5 by Cigaes, 9 years ago

Your console output for encoding shows 15.68 seconds, that makes the whole 392 images. How do you examine the duration of the output file? What happens if you use a different output format, Matroska or Nut for example?

in reply to:  5 comment:6 by mlinnosk, 9 years ago

Replying to Cigaes:

Your console output for encoding shows 15.68 seconds, that makes the whole 392 images. How do you examine the duration of the output file? What happens if you use a different output format, Matroska or Nut for example?

Actually it shows duration '15.24' for the broken file and '15.68' for the OK file.

I will try different container...

comment:7 by mlinnosk, 9 years ago

Broken:

unzip -p input.zip 1920x1200/raw/f_*.png | ffmpeg2 -loglevel verbose -f image2pipe -c:v png -r 25 -i - -s 1024x640 -aspect 16:10 -sws_flags lanczos -vcodec libtheora -pix_fmt yuv420p -an -qscale:v 7 -r 25 -y output.ogv
ffmpeg version 2.4.3-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  4 2014 13:14:24 with gcc 4.8 (Debian 4.8.3-13)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, image2pipe, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1200, 25 fps, 25 tbr, 25 tbn, 25 tbc
[graph 0 input from stream 0:0 @ 0x44681c0] w:1920 h:1200 pixfmt:rgba tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[scaler for output stream 0:0 @ 0x4460e00] w:1024 h:640 flags:'0x200' interl:0
[graph 0 input from stream 0:0 @ 0x44681c0] TB:0.040000 FRAME_RATE:25.000000 SAMPLE_RATE:nan
[scaler for output stream 0:0 @ 0x4460e00] w:1920 h:1200 fmt:rgba sar:0/1 -> w:1024 h:640 fmt:yuv420p sar:0/1 flags:0x200
Output #0, ogg, to 'output.ogv':
  Metadata:
    encoder         : Lavf56.4.101
    Stream #0:0: Video: theora (libtheora), yuv420p, 1024x640 [SAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.1.100 libtheora
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> theora (libtheora))
No more output streams to write to, finishing.=00:00:15.28 bitrate=1760.5kbits/s    
frame=  392 fps= 18 q=0.0 Lsize=    3299kB time=00:00:15.68 bitrate=1723.4kbits/s    
video:3280kB audio:0kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.576610%
Input file #0 (pipe:):
  Input stream #0:0 (video): 392 packets read (609131299 bytes); 392 frames decoded; 
  Total: 392 packets (609131299 bytes) demuxed
Output file #0 (output.ogv):
  Output stream #0:0 (video): 392 frames encoded; 392 packets muxed (3358425 bytes); 
  Total: 392 packets (3358425 bytes) muxed

OK:

unzip -p input.zip 1920x1200/raw/f_*.png | ffmpeg2 -loglevel verbose -f image2pipe -c:v png -r 25 -i - -s 1280x800 -aspect 16:10 -sws_flags lanczos -vcodec libtheora -pix_fmt yuv420p -an -qscale:v 7 -r 25 -y output.ogv
ffmpeg version 2.4.3-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  4 2014 13:14:24 with gcc 4.8 (Debian 4.8.3-13)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, image2pipe, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1200, 25 fps, 25 tbr, 25 tbn, 25 tbc
[graph 0 input from stream 0:0 @ 0x3b3e1c0] w:1920 h:1200 pixfmt:rgba tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[scaler for output stream 0:0 @ 0x3b36e00] w:1280 h:800 flags:'0x200' interl:0
[graph 0 input from stream 0:0 @ 0x3b3e1c0] TB:0.040000 FRAME_RATE:25.000000 SAMPLE_RATE:nan
[scaler for output stream 0:0 @ 0x3b36e00] w:1920 h:1200 fmt:rgba sar:0/1 -> w:1280 h:800 fmt:yuv420p sar:0/1 flags:0x200
Output #0, ogg, to 'output.ogv':
  Metadata:
    encoder         : Lavf56.4.101
    Stream #0:0: Video: theora (libtheora), yuv420p, 1280x800 [SAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.1.100 libtheora
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> theora (libtheora))
No more output streams to write to, finishing.=00:00:15.56 bitrate=2434.7kbits/s    
frame=  392 fps= 14 q=0.0 Lsize=    4639kB time=00:00:15.68 bitrate=2423.7kbits/s    
video:4614kB audio:0kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.536514%
Input file #0 (pipe:):
  Input stream #0:0 (video): 392 packets read (609131299 bytes); 392 frames decoded; 
  Total: 392 packets (609131299 bytes) demuxed
Output file #0 (output.ogv):
  Output stream #0:0 (video): 392 frames encoded; 392 packets muxed (4725135 bytes); 
  Total: 392 packets (4725135 bytes) muxed

comment:8 by mlinnosk, 9 years ago

Using 'MKV' container seems to produce duration of '15.68' which is correct. Even more weird!

unzip -p input.zip 1920x1200/raw/f_*.png | ffmpeg2 -loglevel verbose -f image2pipe -c:v png -r 25 -i - -s 1024x640 -aspect 16:10 -sws_flags lanczos -vcodec libtheora -pix_fmt yuv420p -an -qscale:v 7 -r 25 -y output.mkv
ffmpeg version 2.4.3-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  4 2014 13:14:24 with gcc 4.8 (Debian 4.8.3-13)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, image2pipe, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1200, 25 fps, 25 tbr, 25 tbn, 25 tbc
[graph 0 input from stream 0:0 @ 0x39231c0] w:1920 h:1200 pixfmt:rgba tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[scaler for output stream 0:0 @ 0x391bd80] w:1024 h:640 flags:'0x200' interl:0
[graph 0 input from stream 0:0 @ 0x39231c0] TB:0.040000 FRAME_RATE:25.000000 SAMPLE_RATE:nan
[scaler for output stream 0:0 @ 0x391bd80] w:1920 h:1200 fmt:rgba sar:0/1 -> w:1024 h:640 fmt:yuv420p sar:0/1 flags:0x200
Output #0, matroska, to 'output.mkv':
  Metadata:
    encoder         : Lavf56.4.101
    Stream #0:0: Video: theora (libtheora) (theo / 0x6F656874), yuv420p, 1024x640 [SAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.1.100 libtheora
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> theora (libtheora))
No more output streams to write to, finishing.=00:00:15.60 bitrate=1726.0kbits/s    
frame=  392 fps= 18 q=0.0 Lsize=    3288kB time=00:00:15.68 bitrate=1717.6kbits/s    
video:3280kB audio:0kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.238594%
Input file #0 (pipe:):
  Input stream #0:0 (video): 392 packets read (609131299 bytes); 392 frames decoded; 
  Total: 392 packets (609131299 bytes) demuxed
Output file #0 (output.mkv):
  Output stream #0:0 (video): 392 frames encoded; 392 packets muxed (3358425 bytes); 
  Total: 392 packets (3358425 bytes) muxed

comment:9 by mlinnosk, 9 years ago

Running again with '1024x640' resolution, ffmpeg says "time=00:00:15.68" but running 'ffmpeg -i' for the file says "Duration: 00:00:15.24".

comment:10 by Cigaes, 9 years ago

All the encoding output you posted show time=00:00:15.68. There is no problem there.

Again, please explain how you test the duration exactly.

Furthermore, these console outputs do not look like they were produced by genuine ffmpeg. Please try latest Git head.

in reply to:  10 ; comment:11 by mlinnosk, 9 years ago

Replying to Cigaes:

All the encoding output you posted show time=00:00:15.68. There is no problem there.

Again, please explain how you test the duration exactly.

Furthermore, these console outputs do not look like they were produced by genuine ffmpeg. Please try latest Git head.

The ffmpeg is downloaded from: http://johnvansickle.com/ffmpeg/
I know it's not the Git head version, but as I understand the latest stable. I'd rather not compile it my self!

The duration can be seen in 'ffmpeg -i' output or 'ogginfo' that shows the same.

The 'ffmpeg2' in the command line is just mu home local link to local install of version 2.4.3, in case you were wondering.

comment:12 by Carl Eugen Hoyos, 9 years ago

Please provide the command (ffmpeg -i file) including console output that shows the wrong duration.

in reply to:  11 comment:13 by Carl Eugen Hoyos, 9 years ago

Replying to mlinnosk:

I'd rather not compile it my self!

Why?
We are very interested in reports about compilation problems!.

comment:14 by Carl Eugen Hoyos, 9 years ago

If you don't want to compile yourself, please download a current version from the same website: No release is more stable than git head.

in reply to:  14 comment:15 by mlinnosk, 9 years ago

Replying to cehoyos:

If you don't want to compile yourself, please download a current version from the same website: No release is more stable than git head.

Ok. I retested with version 'ffmpeg-git-20141106-64bit-static'. Same result.

OK:

 ~/bin/ffmpeg-git-20141106-64bit-static/ffmpeg -i output1.ogv 
ffmpeg version N-41884-g8176638-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  6 2014 01:21:52 with gcc 4.8 (Debian 4.8.3-13)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
  libavutil      54. 11.100 / 54. 11.100
  libavcodec     56. 10.102 / 56. 10.102
  libavformat    56. 12.101 / 56. 12.101
  libavdevice    56.  2.100 / 56.  2.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, ogg, from 'output1.ogv':
  Duration: 00:00:15.68, start: 0.000000, bitrate: 2423 kb/s
    Stream #0:0: Video: theora, yuv420p, 1280x800 [SAR 1:1 DAR 8:5], 25 tbr, 25 tbn, 25 tbc
    Metadata:
      ENCODER         : Lavc56.10.102 libtheora

Broken:

~/bin/ffmpeg-git-20141106-64bit-static/ffmpeg -i output2.ogv 
ffmpeg version N-41884-g8176638-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  6 2014 01:21:52 with gcc 4.8 (Debian 4.8.3-13)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
  libavutil      54. 11.100 / 54. 11.100
  libavcodec     56. 10.102 / 56. 10.102
  libavformat    56. 12.101 / 56. 12.101
  libavdevice    56.  2.100 / 56.  2.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, ogg, from 'output2.ogv':
  Duration: 00:00:15.24, start: 0.000000, bitrate: 1773 kb/s
    Stream #0:0: Video: theora, yuv420p, 1024x640 [SAR 1:1 DAR 8:5], 25 tbr, 25 tbn, 25 tbc
    Metadata:
      ENCODER         : Lavc56.10.102 libtheora

in reply to:  11 ; comment:16 by Cigaes, 9 years ago

Replying to mlinnosk:

Replying to Cigaes:
The ffmpeg is downloaded from: http://johnvansickle.com/ffmpeg/
I know it's not the Git head version, but as I understand the latest stable. I'd rather not compile it my self!

I was confused by the summary at verbose level, forget I said anything.

The duration can be seen in 'ffmpeg -i' output or 'ogginfo' that shows the same.

You wrote in the initial description "and drops frames from the end", but neither ffmpeg -i nor ogginfo can show that. It could be just a matter of the duration being badly estimated.

It would be of course much easier if you could provide a way to reproduce the bug. Otherwise, you need to run all the tests yourself.

in reply to:  16 comment:17 by mlinnosk, 9 years ago

Replying to Cigaes:

Replying to mlinnosk:

Replying to Cigaes:
The ffmpeg is downloaded from: http://johnvansickle.com/ffmpeg/
I know it's not the Git head version, but as I understand the latest stable. I'd rather not compile it my self!

I was confused by the summary at verbose level, forget I said anything.

The duration can be seen in 'ffmpeg -i' output or 'ogginfo' that shows the same.

You wrote in the initial description "and drops frames from the end", but neither ffmpeg -i nor ogginfo can show that. It could be just a matter of the duration being badly estimated.

It would be of course much easier if you could provide a way to reproduce the bug. Otherwise, you need to run all the tests yourself.

Indeed. The reason I observed this in the first place was that the video ended prematurely. The material has 24 frames of the same image at the end and it was cur short by the player (tested mplayer and vlc).

The fact that puzzles me is how can the length estimate be dependant on the resolution of the video. Offcause this can be libtheora problem, not ffmpeg, but ffmpeg (and it's scaling library) is the component that feeds the raw frame data to libtheora, right? And the encoding of the raw frame should be quite deterministic.

comment:18 by Carl Eugen Hoyos, 9 years ago

Keywords: libtheora ogg added; theora pipe removed
Resolution: worksforme
Status: newclosed
Version: 2.4.3git-master

Feel free to reopen this ticket if you can provide source files that allow to reproduce the issue (or if this is unzip-related).

$ ffmpeg -f lavfi -i testsrc=r=1 -pix_fmt rgba -vframes 392 testsrc%3d.png
$ cat testsrc* | ffmpeg -f image2pipe -i - -s 1024x640 -aspect 16:10 -sws_flags lanczos -qscale:v 7 -pix_fmt yuv420p out1.ogv
ffmpeg version N-67446-gc11f731 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  7 2014 09:43:19 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --enable-libtheora
  libavutil      54. 11.100 / 54. 11.100
  libavcodec     56. 12.100 / 56. 12.100
  libavformat    56. 12.101 / 56. 12.101
  libavdevice    56.  2.100 / 56.  2.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, image2pipe, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1080 [SAR 3:4 DAR 4:3], 25 fps, 25 tbr, 25 tbn, 25 tbc
Output #0, ogg, to 'out1.ogv':
  Metadata:
    encoder         : Lavf56.12.101
    Stream #0:0: Video: theora (libtheora), yuv420p, 1024x640 [SAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.12.100 libtheora
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> theora (libtheora))
frame=  392 fps= 28 q=0.0 Lsize=    2375kB time=00:00:15.68 bitrate=1240.7kbits/s
video:2360kB audio:0kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.613787%
$ cat testsrc* | ffmpeg -f image2pipe -i - -s 1280x800 -aspect 16:10 -sws_flags lanczos -qscale:v 7 -pix_fmt yuv420p out2.ogv
ffmpeg version N-67446-gc11f731 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  7 2014 09:43:19 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --enable-libtheora
  libavutil      54. 11.100 / 54. 11.100
  libavcodec     56. 12.100 / 56. 12.100
  libavformat    56. 12.101 / 56. 12.101
  libavdevice    56.  2.100 / 56.  2.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, image2pipe, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgba, 1920x1080 [SAR 3:4 DAR 4:3], 25 fps, 25 tbr, 25 tbn, 25 tbc
Output #0, ogg, to 'out2.ogv':
  Metadata:
    encoder         : Lavf56.12.101
    Stream #0:0: Video: theora (libtheora), yuv420p, 1280x800 [SAR 1:1 DAR 8:5], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.12.100 libtheora
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> theora (libtheora))
frame=  392 fps= 19 q=0.0 Lsize=    3240kB time=00:00:15.68 bitrate=1692.7kbits/s
video:3221kB audio:0kB subtitle:0kB other streams:0kB global headers:3kB muxing overhead: 0.580756%
$ ffmpeg -i out1.ogv -i out2.ogv
ffmpeg version N-67446-gc11f731 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  7 2014 09:43:19 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --enable-libtheora
  libavutil      54. 11.100 / 54. 11.100
  libavcodec     56. 12.100 / 56. 12.100
  libavformat    56. 12.101 / 56. 12.101
  libavdevice    56.  2.100 / 56.  2.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, ogg, from 'out1.ogv':
  Duration: 00:00:15.68, start: 0.000000, bitrate: 1240 kb/s
    Stream #0:0: Video: theora, yuv420p, 1024x640 [SAR 1:1 DAR 8:5], 25 tbr, 25 tbn, 25 tbc
    Metadata:
      ENCODER         : Lavc56.12.100 libtheora
Input #1, ogg, from 'out2.ogv':
  Duration: 00:00:15.68, start: 0.000000, bitrate: 1692 kb/s
    Stream #1:0: Video: theora, yuv420p, 1280x800 [SAR 1:1 DAR 8:5], 25 tbr, 25 tbn, 25 tbc
    Metadata:
      ENCODER         : Lavc56.12.100 libtheora
At least one output file must be specified

The following command lines also produce files of identical length:

$ ffmpeg -i testsrc%3d.png -s 1024x640 -aspect 16:10 -sws_flags lanczos -qscale:v 7 -pix_fmt yuv420p out1.ogv
$ ffmpeg -i testsrc%3d.png -s 1280x800 -aspect 16:10 -sws_flags lanczos -qscale:v 7 -pix_fmt yuv420p out2.ogv
Note: See TracTickets for help on using tickets.