LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-11-2008, 03:09 PM   #1
btbx
Member
 
Registered: Jun 2007
Posts: 67

Rep: Reputation: 15
Question Utility for Reading Detailed Video Header


I need a small utility that can read detailed technical information on the header of a video / multimedia file: What codec, resolutions, decompression etc.

The output will be text mode / console.

The utility should be able to tell the differences between:

* mpeg4 - ISO standard MPEG-4 (DivX 5, XVID compatible)
* msmpeg4 - pre-standard MPEG-4 variant by MS, v3 (aka DivX3)
* msmpeg4v2 - pre-standard MPEG-4 by MS, v2 (used in old asf files)

What is the name of such utility?
Thank you.
 
Old 06-11-2008, 05:09 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I don't know of any stand-alone utility to do this, but looking at the output of MPlayer will show you all of the pertinent video information. You can instruct MPlayer to not play any audio or video, and just let it print out the file info and exit.
 
Old 06-12-2008, 08:09 AM   #3
btbx
Member
 
Registered: Jun 2007
Posts: 67

Original Poster
Rep: Reputation: 15
Smile

I had created a single script line.
Is there any correction /improvement for this script?

Content of videoheader.sh

mplayer -vo null -ao null -frames 0 "$1" |grep -i '\['
 
Old 06-12-2008, 08:48 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Only that you should get rid of stderr and you don't need case sensitivity here.

You said "small" and 'mediainfo' is decidedly smaller than 'mplayer'. I edited out the second mplayer line as I realise it shows exactly the same output the 'mediainfo' line below shows. So if you like easily parsable output but don't want to install another utility then you could use 'mplayer -noquiet -v -identify -nocache -vo null -ss 99999 file 2>/dev/null| grep -i "^id_[av]"'.

Code:
]$ mplayer -vo null -ao null -frames 0 file 2>/dev/null|grep -i '\['
VIDEO:  [DIV3]  576x304  24bpp  23.976 fps  804.9 kbps (98.3 kbyte/s)
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffdivx] vfm: ffmpeg (FFmpeg DivX ;-) (MS MPEG-4 v3))
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
AO: [null] 48000Hz 2ch s16le (2 bytes per sample)
Code:
]$ mediainfo file 2>/dev/null| grep -i "^id_[av]"
ID_VIDEO_ID=0
ID_AUDIO_ID=1
ID_VIDEO_FORMAT=DIV3
ID_VIDEO_BITRATE=804904
ID_VIDEO_WIDTH=576
ID_VIDEO_HEIGHT=304
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=85
ID_AUDIO_BITRATE=128176
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_VIDEO_CODEC=ffdivx
ID_AUDIO_BITRATE=32000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_AUDIO_CODEC=mp3

Last edited by unSpawn; 06-12-2008 at 08:56 AM. Reason: I R see error!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Utility For Reading Bittorrent File btbx Linux - Software 1 01-07-2008 03:53 AM
Reading JPEG Header info lucky6969b Programming 4 06-05-2006 05:12 AM
how to find detailed indo about a video file dwaldie Linux - Software 3 08-03-2005 10:42 PM
.wav header utility ilikejam Linux - Software 1 02-13-2005 05:29 PM
Error 2: reading header: cpio: Bad magic sujitshah Linux - Software 1 03-20-2004 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration