Elements of a video The video container holds it all together 4 The caption format defines when captions are displayed 3 The audio codec defines how waveforms are compressed 2 The video codec defines how the pixels are compressed 1
Technology Overview
Codecs & formats
Container – Can hold multiple types of video
Format – the contents of the file (how the bits are arranged).
Codec – the encoder that created the contents of the files (arranger of bits).
Multiple encoders can write files in the same format. (DivX, Xvid -> mpeg4)
Common video codecs (*) As far as we know Source: Wikipedia No YouTube, Google Video MPEG WG H.263 HDTV broadcast Free Software hippies Blu-Ray Microsoft world domination YouTube HD, iTunes, Blu-Ray Movie pirates DVD VCD Popular usage Yes* On2, Xiph.org Theora No Microsoft VC-1 Yes* BBC Dirac No Microsoft WMV No MPEG WG MPEG-2 No MPEG WG MPEG-1 No MPEG WG H.264 No MPEG WG MPEG-4 ASP Patent-free? Inventor Codec name
Video encoders Source: DigitalContentProducer.com, doom9.org, Wikipedia Adobe Premiere ffmpeg H.263 none none Windows Media Encoder, Compressor, Squeeze Windows Media Encoder, Expression Encoder Adobe Media Encoder, Apple Compressor, On2 Flix Pro, Sorenson Squeeze, Telestream DivX, 3ivX Compressor, Sonic, TMPGEnc QuickTime Non-OSS tools oggenc, Thusnelda Theora none VC-1 dirac-research, Schroedinger Dirac none WMV ffmpeg, mpeg2enc MPEG-2 ffmpeg, MP1E MPEG-1 x264 H.264 ffmpeg, Xvid MPEG-4 ASP OSS tools Codec name
Overview of caption formats Source: Wikipedia DVD Stored as images DVD-Forum DVD Analog TV (Europe) custom BBC et. al. Teletext Analog TV (US + Canada) pseudo-ASCII Electronic Industries Alliance Line 21 UTF-8 (multiple) (multiple) UTF-8 windows-1252 Encoding Windows Media Player MSDN page SAMI MP4 files, iTunes Store QuickTime (SMIL 1.0 only) AVI files, “fansubbing” AVI files, “fansubbing” Popular usage ISO 14966-17 MPEG-4 Timed Text A doom9.org forum post from 2004 SubRip W3C Recommendation SMIL Some Word document floating around the net Advanced SubStation Alpha Spec Caption format
Overview of container formats (*) Seriously, some guys in Russia. They contributed it to the public domain, so technically you own it. Source: Wikipedia ffmpeg, MP4Box, mp4creator MPEG-LA .MP4, .M4V MPEG-4 ffmpeg Apple .MOV QuickTime ffmpeg, oggmux Xiph.org .OGG Ogg ffmpeg (in progress) Microsoft .ASF, .WMV Advanced Systems Format ffmpeg, AVIMux-GUI Microsoft .AVI Audio/Video Interchange ffmpeg, mkvtoolnix Some guys in Russia* .MKV Matroska ffmpeg Adobe .FLV Flash Video OSS tools Owner Extension Container Name
Common audio codecs (*) As far as we know Source: Wikipedia No iPod, iTunes Store videos MPEG WG AAC Blu-Ray DVD Free Software hippies Microsoft world domination Music VCD, DVD, digital TV Ringtones, VoIP Popular usage No DTS Inc. DTS No Dolby AC3 Yes* Xiph.org Vorbis No MPEG WG MP2 No 3GPP AMR No Microsoft WMA No MPEG WG MP3 Patent-free? Owner Codec name
Audio encoders Sources: HydrogenAudio.org, Wikipedia iTunes, Nero FAAC AAC DTS, Inc. Dolby none Windows Media Encoder iTunes Audio Transcoder, Easy CD-DA Extractor 3GPP reference encoder Non-OSS tools none DTS ffmpeg, Aften AC3 ffmpeg, aoTuV Vorbis TwoLAME MP2 ffmpeg, RetroCode AMR ffmpeg WMA LAME MP3 OSS tools Codec name
Encoding / Transcoding
Reasons to Transcode
Create a DVD compatible video stream
Compress an existing video
Reduce the size or bitrate of a video
Change the format so you can edit it.
Transcoding is slow. It easily take ten times as long to transcode a video as to watch it.
Thousands of options and plugins needed.
Vcdgear, transcode and ffmpeg are common tools
Transcoding Example
To convert a mpeg video into DV format for kino
transcode
-i 'funny_dog_show.mpg'
-y mov -F dv -Z720x480
-o dvz.mov
Transcoding Example
-i input-file
-y mov – Select the video output module. In this case the quicktime (mov) container.
-F dv – Select the format for use in the container. (And audio codec if applicable – only 1 codec for dv.)
-Z720x480 – Resize the video to the given amount (kino is fussy about this)
-o output-file
Transcoding Example
Time to process a 1 hour television show: 2 hours. (AMD Athlon(tm) XP 2400+)
Size of input: 877M
Size of output: 13G
Video Editing
Editing tasks
Cutting a clip out of a television show
Making DVD from a camcorder tape
Editors
kino
lve
lives
cinerama
Avidemix2
ffmpeg can be used for some editing as well!
Video editing -- Kino
Video editing -- Kino
Works well for DV (camcorder files)
Very limited input support otherwise (annoying)
Works fast enough to not be annoying
Vi like keyboard controls.
Simple edits – No complex transitions or sound editing.
Good choice for home Camcorder to DVD projects
Video editing -- Lve
Video editing -- Lve
Fast
Works well with mpeg files
Better input / output support
No documentation to speak of
Suggest avidmux2 instead. Does more and is documented.
Video editing -- Lives
Video editing -- Lives
Appears to be full featured.
Very slow open speed.
Does not import the whole file by default.
Sound does work with my system. (ALSA only?)
Video editing -- cinelerra
Video editing -- cinelerra
Supposed to be a professional class editing system.
Documentation 186 page manual
Never could figure it out.
Video editing -- avidemix2
Video editing -- avidemix2
Fast
Full set of features
Find black feature – Commercial Skip
Scripting features
ffmpeg the wonder tool
Flv to mpg conversion
convert .flv to .mpg using ffmpeg which you download using clive
First you need to download your .flv file to a folder and you need to Open a terminal window and go in to the .flv file folder and type the following command
jokes.flv is the file you want to convert, so the name must be the same as the source file.You can name jokes.mpg whatever you want as long as it has the .mpg extension.
-b bitrate: set the video bitrate in kbit/s (default = 200 kb/s)
-ab bitrate: set the audio bitrate in kbit/s (default = 64)
-ar sample rate: set the audio samplerate in Hz (default = 44100 Hz)
-s size: set frame size. The format is WxH. (default 160×128 )
Converting and encoding video
by selecting a format as one of the options (”vcd”, “svcd”, “dvd”, “dv”, “pal-vcd”, “ntsc-svcd”, all the format options (bitrate, codecs, buffer sizes) are then set automatically.
$ ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
same example but use high quality, ntsc vcd format
converting a file to mpeg using mencoder (poorer quality than ffmpeg I think, but that’s on my system - and it really depends on the file and the codec you’re using).
0 comments
Post a comment