Opened 11 years ago

Last modified 10 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 Carl Eugen Hoyos 11 years ago.
5s_clip.flv (137.0 KB ) - added by Carl Eugen Hoyos 11 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Carl Eugen Hoyos, 11 years ago

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 by Underground78, 11 years ago

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 by Carl Eugen Hoyos, 11 years ago

Keywords: h264 added

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

by Carl Eugen Hoyos, 11 years ago

Attachment: 10s_clip.flv added

in reply to:  3 comment:4 by Underground78, 11 years ago

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

by Carl Eugen Hoyos, 11 years ago

Attachment: 5s_clip.flv added

comment:5 by Carl Eugen Hoyos, 11 years ago

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

comment:6 by Underground78, 11 years ago

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 by Carl Eugen Hoyos, 11 years ago

Priority: normalwish
Reproduced by developer: set
Status: newopen
Type: defectenhancement

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 by Carl Eugen Hoyos, 11 years ago

Keywords: duration added
Priority: wishnormal
Type: enhancementdefect

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

comment:9 by Carl Eugen Hoyos, 11 years ago

Summary: No duration detected for some FLV filesWrong duration shown for some FLV files

comment:10 by Michael Niedermayer, 10 years ago

Type: defectenhancement

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 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavformat
Priority: normalwish
Note: See TracTickets for help on using tickets.