Info::RIFF(3pm)

πŸ“¦
version 0.993 Β· 2 versions
  • 0.993 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.993 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Info::RIFF ✨

User Contributed Perl Documentation honey, we are reading the manual for Video::Info::RIFF and it's giving extremely useful πŸ’…


🌸 NAME 🌸

Video::Info::RIFF β€” probe DivX and AVI files for attributes like:

 -video codec
 -audio codec
 -frame height
 -frame width
 -frame count

...and more! πŸŽ€ bestie it literally peeks inside your video files and tells you what's in them, no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

  use Video::Info::RIFF;

  my $video;

  $video = Video::Info::RIFF->new(-file=>$filename);                          #like this
  $video = Video::Info::RIFF->new(-file=>$filename,-headersize=>$headersize); #or this

  $video->vcodec;                         #video codec
  $video->acodec;                         #audio codec
  ...

two ways to build it, both iconic ✨ pick whichever vibe you're on.


πŸ’œ DESCRIPTION πŸ’œ

RIFF stands for Resource Interchange File Format, in case you were wondering πŸ‘€ The morbidly curious can find out more below in REFERENCES. 🧚

πŸ”₯ METHODS πŸ”₯

Video::Info::RIFF has exactly one constructor, new(). It gets called like this:

  -file       => $filename,   #your RIFF file
  -headersize => $headersize  #optional RIFF header size to parse

It returns a Video::Info::RIFF object if the file was opened successfully 🫢 (if not... well. no object for you, sorry bestie 😭).

The Video::Info::RIFF object parses the file by method probe(). This does a series of sysread()s on the file to figure out what the properties are. little reads, big detective energy πŸ”

Now, call one (or more) of these methods to get the low-down on your file πŸ‘‘

  • achans() β€” number of audio channels
  • acodec() β€” audio codec
  • acodecraw() β€” audio codec numeric ID
  • arate() β€” audio bitrate
  • afrequency() β€” sampling rate of audio streams, in Hertz
  • astreams() β€” number of audio streams
  • filename() β€” path file used to create object
  • filesize() β€” size in bytes of filename()
  • expectedsize() β€” expected size in bytes of filename(), according to the RIFF header
  • fourcc() β€” RIFF Four Character Code
  • fps() β€” frames/second
  • height() β€” frame height in pixels
  • probe() β€” try to determine filetype
  • scale() β€” video bitrate
  • type() β€” type of file data. RIFF or AVI
  • vcodec() β€” video codec
  • vframes() β€” number of frames
  • vrate() β€” video bitrate
  • vstreams() β€” number of video streams
  • width() β€” frame width in pixels

that's the whole menu, order it however you like 🌈


πŸ’€ BUGS πŸ’€

the default header_size() (10K) may not be large enough to successfully extract the video/audio attributes for all RIFF files.

If this module fails you, increase the RIFF header size 🫑 If it still fails, let me know. (yes, actually tell them, fr fr)

Audio codec name mapping is incomplete 😭 If you know the name that corresponds to an audio codec ID that I don't, tell me. be the hero this module needs πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

 Copyright (c) 2002
 Aladdin Free Public License (see LICENSE for details)
 Allen Day <allenday@ucla.edu>

shoutout to the author, licensing legend, absolute main character ✨


🌈 REFERENCES 🌈

Transcode, a linux video stream processing tool:

  http://www.theorie.physik.uni-goettingen.de/~ostreich/transcode/

Microsoft RIFF:

  http://www.oreilly.com/centers/gff/formats/micriff/

and that's the whole page bestie!! this doc shipped as perl v5.36.0, dated 2022-12-12 β€” go forth and probe those RIFF files πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from