[MPlayer-users] mplayer -identify reports incorrect information for some files
littlebat
dashing.meng at gmail.com
Wed Sep 12 11:18:30 CEST 2012
On Sat, 8 Sep 2012 15:00:01 +0200
Robert Szelepcsényi <robert at tankred.sk> wrote:
> Hi,
>
>
> I am building a web application, which users can use to upload images
> and videos to the server. I need to check each uploaded file for
> basic information like media type, dimensions, duration, etc., which
> are then inserted into the database.
>
> To check videos and obtain basic information I use:
>
> mplayer -vo null -ao null -frames 0 -identify <filename>
>
> However:
>
> 1. For some files zero length (duration) is reported. Examples of
> such files are in http://www.tankred.sk/samples/zerolength/
>
I have a similar question about this, some people say some files'
duration is guessed by ffmpeg(see links below), but mplayer don't use
this way, so mplayer will report zero length for these files, like your
mpeg-ps files and my mpeg-ts files. You can get this estimated duration
by adding extra mplayer parameter "-demuxer lavf".
[MPlayer-users] How to get the duration(ID_LENGTH) of a Sony MTS video
file use "mplayer"?
http://lists.mplayerhq.hu/pipermail/mplayer-users/2012-September/085284.html
http://lists.mplayerhq.hu/pipermail/mplayer-users/2012-September/085292.html
http://lists.mplayerhq.hu/pipermail/mplayer-users/2012-September/085322.html
> 2. For some files incorrect framerate is reported. Examples of such
> files are in http://www.tankred.sk/samples/badfps/. In the case of
> these files instead of fps mplayer seems to report tbr. Or more
> probably mplayer always reports tbr (being equal to fps in most
> case). Probable the best solution would be to report both.
I also found this question in my mpeg-ts file created by Sony DV.
Adding "-demuxer lavf" to mplayer get the same result as ffmpeg does.
My file is(10M): http://www.learndiary.com/test.MTS
"mplayer -identify -vo null -ao null -frames 0 test.MTS" output:
ID_FILENAME=test.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
"mplayer -demuxer lavf -identify -vo null -ao null -frames 0 test.MTS"
output:
ID_FILENAME=test.MTS
ID_DEMUXER=lavf
ID_VIDEO_FORMAT=H264
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=1440
ID_VIDEO_HEIGHT=1080
ID_VIDEO_FPS=50.000
ID_VIDEO_ASPECT=1.7778
ID_AUDIO_FORMAT=8192
ID_AUDIO_BITRATE=256000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_START_TIME=0.86
ID_LENGTH=6.72
ID_SEEKABLE=1
ID_CHAPTERS=0
"ffmpeg -i test.MTS" output:
Seems stream 0 codec frame rate differs from container frame rate:
50.00 (50/1) -> 50.00 (50/1) Input #0, mpegts, from 'test.MTS':
Duration: 00:00:06.71, start: 0.820033, bitrate: 12190 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
>
> In all cases
>
> ffmpeg -i <filename>
>
> reports correct information.
More information about the MPlayer-users
mailing list