Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6232 closed defect (duplicate)

mpegts demuxer cannot get pkt->duration

Reported by: Steven Liu 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 Steven Liu 7 years ago.
the_other_mpegts_have_duration (824.5 KB ) - added by Steven Liu 7 years ago.

Download all attachments as: .zip

Change History (10)

by Steven Liu, 7 years ago

Attachment: ffprobe_no_duration.txt added

comment:1 by Hendrik, 7 years ago

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

comment:2 by Steven Liu, 7 years ago

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

comment:3 by Steven Liu, 7 years ago

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

in reply to:  1 ; comment:4 by Steven Liu, 7 years ago

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

in reply to:  4 ; comment:5 by Hendrik, 7 years ago

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.

in reply to:  5 comment:6 by Steven Liu, 7 years ago

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

by Steven Liu, 7 years ago

comment:7 by Carl Eugen Hoyos, 7 years ago

Component: avformatavcodec
Keywords: h264 added; mpegts duration removed
Resolution: duplicate
Status: newclosed

This is a duplicate of other h264-related tickets.

comment:8 by Steven Liu, 7 years ago

Note: See TracTickets for help on using tickets.