Opened 4 years ago

Last modified 3 years ago

#3551 open enhancement

Wrong duration shown for some FLV files

Reported by: Underground78 Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: flv h264 duration
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
ffmpeg cannot detect the duration of some FLV files while some other splitters seem to be able to do that.

NB: I am not completely sure if it is a bug, a feature request or just an invalid file.

How to reproduce:
Use ffplay for example with this sample.

Attachments (2)

10s_clip.flv (268.0 KB) - added by cehoyos 4 years ago.
5s_clip.flv (137.0 KB) - added by cehoyos 4 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 4 years ago by cehoyos

  • Keywords flv added

Is the problem only reproducible with ffplay or also with ffmpeg? Please only report problems with ffplay if they are not reproducible with ffmpeg.

Please provide the failing command line (probably ffmpeg -i 10s_clip.flv) to make this a valid ticket.

comment:2 Changed 4 years ago by Underground78

The problem is reproducible with ffmpeg.

> ffmpeg.exe -i 10s_clip.flv
ffmpeg version N-62340-g1de8a4f Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr 10 2014 22:01:45 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 75.100 / 52. 75.100
  libavcodec     55. 58.103 / 55. 58.103
  libavformat    55. 36.103 / 55. 36.103
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  4.100 /  4.  4.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 04277d20] AVC: nal size 21823518
[h264 @ 04277d20] missing picture in access unit with size 40
[h264 @ 04277d20] AVC: nal size 21823518
[h264 @ 04277d20] missing picture in access unit with size 40
[h264 @ 04277d20] AVC: nal size 21823518
[h264 @ 04277d20] missing picture in access unit with size 40
Input #0, flv, from 'MPC-HC\debug\1.7.3.201\10s_clip.flv':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(tv), 320x240 [SAR 1:1 DAR 4:3], 30.
33 fps, 30 tbr, 1k tbn, 60 tbc
    Stream #0:1: Audio: speex, 16000 Hz, mono, s16

comment:3 follow-up: Changed 4 years ago by cehoyos

  • Keywords h264 added

Which duration do other players show? Do they still show the correct duration if you cut the sample?

Changed 4 years ago by cehoyos

comment:4 in reply to: ↑ 3 Changed 4 years ago by Underground78

Another splitter shows 10s. What tool do you have in mind to cut the file?

Changed 4 years ago by cehoyos

comment:5 Changed 4 years ago by cehoyos

Which splitter?
Please test the attached five seconds sample with it.

comment:6 Changed 4 years ago by Underground78

Which splitter?

It's a Windows DirectShow filter, MPC-HC FLV Splitter (which was deprecated in favor of ffmpeg based LAV Splitter some times ago).

Please test the attached five seconds sample with it.

It seems to work fine, it does detect it as 5s length.

comment:7 Changed 4 years ago by cehoyos

  • Priority changed from normal to wish
  • Reproduced by developer set
  • Status changed from new to open
  • Type changed from defect to enhancement

I have no idea how this should work except by decoding the file (decode_hrd_parameters() is not called in the H264 decoder so I assume there is no bitrate set in the video stream) but the fact that FFmpeg shows neither bitrate nor duration is definitely reproducible.

I just sent a patch to the ffmpeg-devel mailing list that would make the situation worse by setting a (not exactly correct) bitrate when decoding speex and therefore assuming a duration of ten minutes for the 10 seconds clip.

comment:8 Changed 4 years ago by cehoyos

  • Keywords duration added
  • Priority changed from wish to normal
  • Type changed from enhancement to defect

A wrong duration is now shown since ef48ac65
The problem may be a duplicate of ticket #3392.

comment:9 Changed 4 years ago by cehoyos

  • Summary changed from No duration detected for some FLV files to Wrong duration shown for some FLV files

comment:10 Changed 3 years ago by michael

  • Type changed from defect to enhancement

This file is invalid as it has been randomly truncated. The truncation is the reason why the duration is not successfully estimated. Its probably possible to get the duration out anyway but it seems that would either be tricky or slow

comment:11 Changed 3 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Priority changed from normal to wish
Note: See TracTickets for help on using tickets.