Command line to to get video file properties?

The old Video Software Help forum, left visible as an archive.

Command line to to get video file properties?

Postby Phade » Wed Dec 04, 2002 8:03 pm

Hey All,

Does anyone know of a Linux command line tool to get video file properties? It would return information like duration, codec, etc. Any help would be nice.

Thanks in advance! ^_^

Phade.
User avatar
Phade
Site Admin
 
Joined: 20 Oct 2000
Location: Little cabin in the woods...

Postby trythil » Wed Dec 04, 2002 11:44 pm

tcprobe will do the job when applied to AVIs and QuickTime files:

Code: Select all
sh-2.05a$ tcprobe -i Dark_Moon_Studios_-_In_My_Arms_Again.avi
[tcprobe] RIFF data, AVI video
[avilib] V: 29.970 fps, codec=DX50, frames=11297, width=352, height=240
[avilib] A: 44100 Hz, format=0x11, bits=4, channels=2, bitrate=354 kbps,
[avilib]    8135 chunks, 16678912 bytes
[tcprobe] summary for Dark_Moon_Studios_-_In_My_Arms_Again.avi, (*) = not default, 0 = not detected
import frame size: -g 352x240 [720x576] (*)
       frame rate: -f 29.970 [25.000] frc=4 (*)
      audio track: -a 0 [0] -e 44100,4,2 [48000,16,2] -n 0x11 [0x2000] (*)
                   bitrate=354 kbps
           length: 11297 frames, frame_time=33 msec


Unfortunately, when it comes to MPEG files:

Code: Select all
sh-2.05a$ tcprobe -i ~/AMVs/For_Every_Dream.mpg
[tcprobe] MPEG program stream (PS)
[tcprobe] summary for /home/trythil/AMVs/For_Every_Dream.mpg, (*) = not default, 0 = not detected
import frame size: -g 480x320 [720x576] (*)
     aspect ratio: 4:3 (*)
       frame rate: -f 29.970 [25.000] frc=4 (*)
                   PTS=47692.8898, frame_time=33 ms, bitrate=104857 kbps
      audio track: -a 0 [0] -e 44100,16,2 [48000,16,2] -n 0x50 [0x2000] (*)
                   bitrate=192 kbps


Notice how the bitrate on the video stream is really messed up: VBR does weird things to tcprobe. I'm not sure if tcprobe 0.62 has fixed those problems or not. There's also no duration info, although the length of CBR MPEG files is pretty easy to calculate.

AFAIK it's impossible to calculate the length of a VBR MPEG file anyway...

Anyway, tcprobe and accompanying tools can be found at:

http://www.theorie.physik.uni-goettinge ... transcode/


Hope this helps.
This is a block of text that can be added to posts you make. There is a 512 character limit.
trythil
is
 
Joined: 23 Jul 2002
Location: Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch

Postby trythil » Tue Dec 10, 2002 1:00 am

Follow-up:

mpeg3dump, which is part of the Heroine Virtual video editing package, will extract quite a bit of useful information from MPEG-1 and MPEG-2 files.

Examples:

Code: Select all
trythil@lothlann AMVs $ mpeg3dump For_Every_Dream.mpg
have_mmx=1
total_astreams=1
  Stream 0x0000: channels=2 rate=44100 samples=13363503 format=MPEG
total_sample_offsets=0

total_vstreams=1
  Stream 0x0000: w=480 h=320 framerate=29.970 frames=9081 coding=420
total_frame_offsets=0

total_keyframe_numbers=0

total_titles=1
  Title path=For_Every_Dream.mpg total_bytes=3df7004 cell_table_size=1
    Cell: 0-3df7004 program=0


Code: Select all
trythil@lothlann vob $ mpeg3dump VTS13A.vob
have_mmx=1
total_astreams=0
total_vstreams=1
  Stream 0x0000: w=720 h=480 framerate=29.970 frames=6020 coding=420
total_frame_offsets=0

total_keyframe_numbers=0

total_titles=1
  Title path=VTS13A.vob total_bytes=9dd8800 cell_table_size=1
    Cell: 0-9dd8800 program=0


You can grab the Heroine Virtual source code package at http://www.heroinewarrior.com. What you're looking for is the source tree, which, when unpacked, will look like this:

Code: Select all
trythil@lothlann hvirtual-110802 $ ls
COPYING            doc             libavc         mplexlo        tiff
CVS                esound          libmpeg3       plugin_config  trackarm.patch
Makefile           freetype-2.0.4  libsndfile     plugins        xmovie
alsa-lib-0.9.0rc2  global_config   make_packages  quicktime
audiofile          guicast         mix            robot
build              i686            mix2002        soundtest.c
cinelerra          ipc.c           mplexhi        swab.h


Go into libmpeg3 and just start the build process.

Hope this helps.
This is a block of text that can be added to posts you make. There is a 512 character limit.
trythil
is
 
Joined: 23 Jul 2002
Location: Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch


Return to Video Software Help Archive

Who is online

Users browsing this forum: No registered users and 1 guest