Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#6232 closed defect (duplicate)

mpegts demuxer cannot get pkt->duration

Reported by: stevenliu Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: h264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% ffprobe -select_streams v -show_packets ~/test.mpeg |grep duration
ffmpeg version  : git-master
localhost:flvenc liuqi$ ./ffprobe
ffprobe version N-83886-g33e997d Copyright (c) 2007-2017 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --cc='ccache gcc' --enable-nonfree
  libavutil      55. 48.100 / 55. 48.100
  libavcodec     57. 83.100 / 57. 83.100
  libavformat    57. 66.104 / 57. 66.104
  libavdevice    57.  3.100 / 57.  3.100
  libavfilter     6. 76.100 /  6. 76.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Simple multimedia streams analyzer
usage: ffprobe [OPTIONS] [INPUT_FILE]

You have to specify one input file.
Use -h to get full help or, even better, run 'man ffprobe'.

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (2)

ffprobe_no_duration.txt (340.8 KB) - added by stevenliu 2 months ago.
the_other_mpegts_have_duration (824.5 KB) - added by stevenliu 2 months ago.

Download all attachments as: .zip

Change History (10)

Changed 2 months ago by stevenliu

comment:1 follow-up: Changed 2 months ago by heleppkes

mpegts as a format just doesn't store a duration. There is no data to provide, so no data to show.

comment:2 Changed 2 months ago by stevenliu

the test input file can be download from: https://pan.baidu.com/s/1miLS5G8

comment:3 Changed 2 months ago by stevenliu

the test input file can be download from: https://pan.baidu.com/s/1miLS5G8

comment:4 in reply to: ↑ 1 ; follow-up: Changed 2 months ago by stevenliu

Replying to heleppkes:

mpegts as a format just doesn't store a duration. There is no data to provide, so no data to show.

No the audio duration can be get, but video cannot be get

comment:5 in reply to: ↑ 4 ; follow-up: Changed 2 months ago by heleppkes

Replying to stevenliu:

Replying to heleppkes:

mpegts as a format just doesn't store a duration. There is no data to provide, so no data to show.

No the audio duration can be get, but video cannot be get

The demuxer provides the information thats stored directly in the file on a container level, and there is no duration there, it is not designed to extract the audio duration of every known audio codec. You'll get the audio duration after decoding.

comment:6 in reply to: ↑ 5 Changed 2 months ago by stevenliu

Replying to heleppkes:

Replying to stevenliu:

Replying to heleppkes:

mpegts as a format just doesn't store a duration. There is no data to provide, so no data to show.

No the audio duration can be get, but video cannot be get

The demuxer provides the information thats stored directly in the file on a container level, and there is no duration there, it is not designed to extract the audio duration of every known audio codec. You'll get the audio duration after decoding.

Let me try the other mpegts format:

localhost:flvenc liuqi$ ffprobe -show_packets -select_streams v ~/Movies/Test/M1.mpg |grep duration > the_other_mpegts_have_duration
ffprobe version N-83692-gb8a7dcb Copyright (c) 2007-2017 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --cc='ccache gcc' --enable-nonfree
  libavutil      55. 47.100 / 55. 47.100
  libavcodec     57. 81.100 / 57. 81.100
  libavformat    57. 66.102 / 57. 66.102
  libavdevice    57.  3.100 / 57.  3.100
  libavfilter     6. 74.100 /  6. 74.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mpegts, from '/Users/liuqi/Movies/Test/M1.mpg':
  Duration: 00:05:06.21, start: 0.996322, bitrate: 1720 kb/s
  Program 2
    Stream #0:0[0x30]: Video: mpeg1video ([1][0][0][0] / 0x0001), yuv420p(tv), 352x240 [SAR 200:219 DAR 880:657], 1500 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 29.97 tbc
    Stream #0:1[0x31]: Audio: mp2 ([3][0][0][0] / 0x0003), 44100 Hz, stereo, s16p, 128 kb/s

I have try the other mpegts, it's can get duration;

the attechment file name : the_other_mpegts_have_duration.txt

Changed 2 months ago by stevenliu

comment:7 Changed 2 months ago by cehoyos

  • Component changed from avformat to avcodec
  • Keywords h264 added; mpegts duration removed
  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of other h264-related tickets.

comment:8 Changed 2 months ago by stevenliu

Note: See TracTickets for help on using tickets.