[MPlayer-users] How to get the duration(ID_LENGTH) of a Sony MTS video file use "mplayer"?
littlebat
dashing.meng at gmail.com
Wed Aug 29 05:58:33 CEST 2012
Hi,
I always use "mplayer filename -identify -ao null -vo null -frames 0"
to get the information of a video file. But, I found mplayer can't get
the correct duration of a Sony DV MTS file(ID_LENGTH=0.00) while the
"ffmpeg -i MTSfilename" can get the correct duration time. I compiled
the mplayer from lastest svn source.
My question is:
Why "mplayer" can't get the correct duration time of a MTS file?
How to get the duration(ID_LENGTH) of a Sony MTS video file use
"mplayer"?
Thanks.
PS:
Below is the command output(mplayer, ffmpeg, mediainfo, please tell me
if need sample file):
1), mplayer output:
mdx at debian:~/desk/testmm$ mplayer 00142.MTS -identify -ao null -vo null
-frames 0
MPlayer SVN-r35126-4.4.5 (C) 2000-2012 MPlayer Team
正在播放 00142.MTS。
libavformat version 54.25.104 (internal)
检测到文件格式 TS。
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
VIDEO H264(pid=4113) AUDIO A52(pid=4352) NO SUBS (yet)! PROGRAM N. 1
ID_VIDEO_ID=4113
ID_AUDIO_ID=4352
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
SUBSTREAM_ID=113 (0x71)
PROGRAM_ID=1 (0x01), PMT_PID: 256(0x100)
PROGRAM_ID=0 (0x00), PMT_PID: 31(0x1F)
SUBSTREAM_ID=113 (0x71)
FPS seems to be: 25.000000
Load subtitles in ./
ID_FILENAME=00142.MTS
ID_DEMUXER=mpegts
ID_VIDEO_FORMAT=0x10000005
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=1440
ID_VIDEO_HEIGHT=1088
ID_VIDEO_FPS=25.000
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=8192
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_START_TIME=0.86
ID_LENGTH=0.00
ID_SEEKABLE=1
ID_CHAPTERS=0
==========================================================================
正打开视频解码器:[ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 54.54.100 (internal)
所选视频编解码器为:[ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
==========================================================================
正打开音频解码器:[ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 256.0 kbit/16.67% (ratio: 32000->192000)
ID_AUDIO_BITRATE=256000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
所选音频编解码器为:[ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [null] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=ffac3
开始播放...
正在退出...(文件末尾)
ID_EXIT=EOF
mdx at debian:~/desk/testmm$
2), ffmpeg output:
mdx at debian:~/desk/testmm$ /usr/bin/ffmpeg -i 00142.MTS
ffmpeg version 0.7.12, Copyright (c) 2000-2011 the FFmpeg developers
built on Apr 11 2012 07:30:33 with gcc 4.4.5
configuration: --enable-libdc1394 --prefix=/usr --extra-cflags='-Wall
-g ' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl
--enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid
--enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264
--enable-libspeex --enable-nonfree --disable-stripping
--enable-avfilter --enable-libdirac --disable-decoder=libdirac
--enable-libfreetype --enable-libschroedinger
--disable-encoder=libschroedinger --enable-version3
--enable-libopenjpeg --enable-libvpx --enable-librtmp
--extra-libs=-lgcrypt --disable-altivec --disable-armv5te
--disable-armv6 --disable-vis libavutil 50. 43. 0 / 50. 43. 0
libavcodec 52.123. 0 / 52.123. 0 libavformat 52.111. 0 / 52.111. 0
libavdevice 52. 5. 0 / 52. 5. 0 libavfilter 1. 80. 0 / 1. 80. 0
libswscale 0. 14. 1 / 0. 14. 1 libpostproc 51. 2. 0 / 51. 2. 0
Seems stream 0 codec frame rate differs from container frame rate:
50.00 (50/1) -> 50.00 (50/1) Input #0, mpegts, from '00142.MTS':
Duration: 00:00:50.88, start: 0.820033, bitrate: 12615 kb/s
Program 1
Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1440x1080 [PAR
4:3 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc Stream #0.1[0x1100]:
Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s At least one output file
must be specified mdx at debian:~/desk/testmm$
3), mediainfo output:
dx at debian:~/desk/testmm$ mediainfo --version
MediaInfo Command line,
MediaInfoLib - v0.7.41
mdx at debian:~/desk/testmm$ mediainfo 00142.MTS
General
ID : 0 (0x0)
Complete name : 00142.MTS
Format : BDAV
Format/Info : Blu-ray Video
File size : 76.5 MiB
Duration : 51s 120ms
Overall bit rate : 12.6 Mbps
Maximum Overall bit rate : 13.7 Mbps
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High at L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : 27
Duration : 50s 780ms
Bit rate mode : Variable
Bit rate : 11.8 Mbps
Maximum bit rate : 12.0 Mbps
Width : 1 440 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.303
Stream size : 71.4 MiB (93%)
Audio
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Codec ID : 129
Duration : 50s 880ms
Bit rate mode : Constant
Bit rate : 256 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -80ms
Stream size : 1.55 MiB (2%)
More information about the MPlayer-users
mailing list