video tools

Download video tools

Post on 16-Apr-2017

2.957 views

Category:

Education

0 download

Embed Size (px)

TRANSCRIPT

Linux Video Tools

Elements of a video

The video container holds it all together4The caption format defines when captions are displayed3The audio codec defines how waveforms are compressed2The video codec defines how the pixels are compressed1

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

NoYouTube, Google VideoMPEG WGH.263HDTV broadcastFree Software hippiesBlu-RayMicrosoft world dominationYouTube HD, iTunes, Blu-RayMovie piratesDVDVCDPopular usageYes*On2, Xiph.orgTheoraNoMicrosoftVC-1Yes*BBCDiracNoMicrosoftWMVNoMPEG WGMPEG-2NoMPEG WGMPEG-1NoMPEG WGH.264NoMPEG WGMPEG-4 ASPPatent-free?InventorCodec name

(*) As far as we knowSource: Wikipedia

Video encoders

Adobe PremiereffmpegH.263nonenoneWindows Media Encoder, Compressor, SqueezeWindows Media Encoder, Expression EncoderAdobe Media Encoder, Apple Compressor, On2 Flix Pro, Sorenson Squeeze, TelestreamDivX, 3ivXCompressor, Sonic, TMPGEncQuickTimeNon-OSS toolsoggenc, ThusneldaTheoranoneVC-1dirac-research, SchroedingerDiracnoneWMVffmpeg, mpeg2encMPEG-2ffmpeg, MP1EMPEG-1x264H.264ffmpeg, XvidMPEG-4 ASPOSS toolsCodec name

Source: DigitalContentProducer.com, doom9.org, Wikipedia

Overview of caption formats

DVDStored as imagesDVD-ForumDVDAnalog TV (Europe)customBBC et. al.TeletextAnalog TV (US + Canada)pseudo-ASCIIElectronic Industries AllianceLine 21UTF-8(multiple)(multiple)UTF-8windows-1252EncodingWindows Media PlayerMSDN pageSAMIMP4 files, iTunes StoreQuickTime (SMIL 1.0 only)AVI files, fansubbingAVI files, fansubbingPopular usageISO 14966-17MPEG-4 Timed TextA doom9.org forum post from 2004SubRipW3C RecommendationSMILSome Word document floating around the netAdvanced SubStation AlphaSpecCaption format

Source: Wikipedia

Overview of container formats

ffmpeg, MP4Box, mp4creatorMPEG-LA.MP4, .M4VMPEG-4ffmpegApple.MOVQuickTimeffmpeg, oggmuxXiph.org.OGGOggffmpeg (in progress)Microsoft.ASF, .WMVAdvanced Systems Formatffmpeg, AVIMux-GUIMicrosoft.AVIAudio/Video Interchangeffmpeg, mkvtoolnixSome guys in Russia*.MKVMatroskaffmpegAdobe.FLVFlash VideoOSS toolsOwnerExtensionContainer Name

(*) Seriously, some guys in Russia. They contributed it to the public domain, so technically you own it.Source: Wikipedia

Common audio codecs

NoiPod, iTunes Store videosMPEG WGAACBlu-RayDVDFree Software hippiesMicrosoft world dominationMusicVCD, DVD, digital TVRingtones, VoIPPopular usageNoDTS Inc.DTSNoDolbyAC3Yes*Xiph.orgVorbisNoMPEG WGMP2No3GPPAMRNoMicrosoftWMANoMPEG WGMP3Patent-free?OwnerCodec name

(*) As far as we knowSource: Wikipedia

Audio encoders

iTunes, NeroFAACAACDTS, Inc.DolbynoneWindows Media EncoderiTunesAudio Transcoder, Easy CD-DA Extractor3GPP reference encoderNon-OSS toolsnoneDTSffmpeg, AftenAC3ffmpeg, aoTuVVorbisTwoLAMEMP2ffmpeg, RetroCodeAMRffmpegWMALAMEMP3OSS toolsCodec name

Sources: HydrogenAudio.org, Wikipedia

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

ffmpeg -i jokes.flv -ab 56 -ar 22050 -b 500 -s 320240 jokes.mpg

DAT to MPG Converter

Converting and encoding video

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 160128 )

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

$ ffmpeg -i myfile.avi -hq -target ntsc-vcd /tmp/vcd.mpg

same example but dvd quality

$ ffmpeg -i myfile.avi -target ntsc-dvd /tmp/dvd.mpg

same example use same quality as source

$ ffmpeg -1 myfile.avi -sameq -target vcd /tmp/vcd.mpg

converting a file for VCD format using a and b frames for MPEG 2

$ ffmpeg -i myfile.avi -target ntsc-vcd -bf 2 /home/user/Video/vcd.mpg

same conversion, but start at 0 seconds and convert only first 45 minutes. #use -ss for start position and -t for duration

$ ffmpeg -i myfile.avi -target ntsc-vcd -bf 2 -ss 00:00:00 -t 00:45:00 /home/user/Video/vcd.mpg (useful to extract songs!)

converting a file to mpeg using mencoder (poorer quality than ffmpeg I think, but thats on my system - and it really depends on the file and the codec youre using).

$ mencoder -oac copy -ovc lavc -of mpeg -o output_file.mpg your_file.wmv

Using ffmpeg, its possible to rip the audio from any video file (it can convert) directly to an mp3 file like this:

$ ffmpeg -i video.mpg -f mp3 audio_track.mp3

video.mp3 is your input file and audio_track.mp3 is your output mp3 file. It works great!

Converting MOV to FLV using FFMPEG

ffmpeg -i movie1.mov movie1.flv

Converting Mpeg to FLV using FFMPEG

ffmpeg -i movie1.mpeg movie1.flv

Converting AVI to FLV using FFMPEG video resolution to 500500

ffmpeg -i movie1.avi -s 500500 movie1.flv

Converting 3GP to FLV using FFMPEG

ffmpeg -i movie1.3gp -sameq -an movie1.flv

This will convert movie1.3gp file to movie1.flv and will keep the original file settings and will disable the audio content

Audio tips and tricks

Extracting audio from video and more!

mplayer -ao pcm "$1" -ao pcm:file=temp.wav (for mp4 files can be done with faad!).

temp.wav is your audio out which you can convert to any format you want using suitable encoder. (lame for mp3).

Soundconverter is a good GUI tool for ripping CDs and converting files.

kid3-qt can be used for tagging the files.

Amarok is a good media player for managing your collection!

Mp3report to get collection details!

You can install goldwave 4.26 over wine too provided you have the mfc42.dll

For the conversion you need the following tools installed:

mplayer (with faad2 support compiled in!)

faad2

for mp3: lame

for ogg: oggenc (vorbis-tools)

Converting rate and zip

ffmpeg for audio 1

Converting aac to mp3 using FFMPEG with MetaData

ffmpeg -i audio1.aac -ar 22050 -ab 32 -map_meta_data audio1.mp3:audio1.aac audio1.mp3

This will convert audio1.aac to audio1.mp3 hav