Hoping for ffmpeg2webm
by Stephen Fluin 2010.05.20One of the biggest strengths of Theora was the ability to easily re-encode video on the command line with the tool ffmpeg2theora. Theora encoding could be accomplished by passing flags to ffmpeg, but the ffmpeg2theora handled common settings and detection and made converting existing files even easier.
For me, one of the biggest successes for WebM will be when a command becomes available, and is released in the package systems that allows users to simply run ffmpeg2webm when encoding. I'll be re-releasing my videos as a WebM gallery as soon as Firefox and Chromium stable builds have WebM support, or sooner.
Desired man page
Take the following man page as an example of what I'm hoping for.
ffmpeg2webm 0.24
Usage: ffmpeg2webm [options] input
General output options:
-o, --output alternative output filename
--no-skeleton disables ogg skeleton metadata output
-s, --starttime start encoding at this time (in sec.)
-e, --endtime end encoding at this time (in sec.)
-p, --preset encode file with preset.
Right now there is preview, pro and videobin. Run
'ffmpeg2webm -p info' for more informations
Video output options:
-v, --videoquality [0 to 10] encoding quality for video (default: 5)
use higher values for better quality
-V, --videobitrate [1 to 16778] encoding bitrate for video (kb/s)
--optimize optimize video output filesize (slower) (same as speedlevel 0)
--speedlevel [0 2] encoding is faster with higher values the cost is quality and bandwidth
-x, --width scale to given width (in pixels)
-y, --height scale to given height (in pixels)
--max_size scale output frame to be withing box of
given size (in pixels)
--aspect define frame aspect ratio: i.e. 4:3 or 16:9
-F, --framerate output framerate e.g 25:2 or 16
--croptop, --cropbottom, --cropleft, --cropright
crop input by given pixels before resizing
-S, --sharpness [0 to 2] sharpness of images (default: 0).
Note: lower values make the video sharper.
-K, --keyint [1 to 65536] keyframe interval (default: 64)
--no-upscaling only scale video or resample audio if input is
bigger than provided parameters
Video transfer options:
--pp Video Postprocessing, denoise, deblock, deinterlacer
use --pp help for a list of available filters.
-C, --contrast [0.1 to 10.0] contrast correction (default: 1.0)
Note: lower values make the video darker.
-B, --brightness [-1.0 to 1.0] brightness correction (default: 0.0)
Note: lower values make the video darker.
-G, --gamma [0.1 to 10.0] gamma correction (default: 1.0)
Note: lower values make the video darker.
-Z, --saturation [0.1 to 10.0] saturation correction (default: 1.0)
Note: lower values make the video grey.
Audio output options:
-a, --audioquality [-2 to 10] encoding quality for audio (default: 1)
use higher values for better quality
-A, --audiobitrate [32 to 500] encoding bitrate for audio (kb/s)
-c, --channels set number of output channels
-H, --samplerate set output samplerate (in Hz)
--noaudio disable audio from input
--novideo disable video from input
Input options:
--deinterlace force deinterlace, otherwise only material
marked as interlaced will be deinterlaced
-f, --format specify input format
--inputfps fps override input fps
--audiostream id by default the last audio stream is selected,
use this to select another audio stream
--sync use A/V sync from input container. Since this does
not work with all input format you have to manually
enable it if you have issues with A/V sync
Metadata options:
--artist Name of artist (director)
--title Title
--date Date
--location Location
--organization Name of organization (studio)
--copyright Copyright
--license License
--contact Contact link
Other options:
--nice n set niceness to n
-P, --pid fname write the process' id to a file
-h, --help this message
Examples:
ffmpeg2webm videoclip.avi (will write output to videoclip.webm)
ffmpeg2webm videoclip.avi --subtitles subtitles.srt (same, with subtitles)
cat something.dv | ffmpeg2webm -f dv -o output.webm -
Encode a series of images:
ffmpeg2webm frame%06d.png -o output.webm
Live streaming from V4L Device:
ffmpeg2webm /dev/video0 -f video4linux --inputfps 15 -x 160 -y 128 -o -
| oggfwd iccast2server 8000 password /webm.webm
Live encoding from a DV camcorder (needs a fast machine):
dvgrab - | ffmpeg2webm -f dv -x 352 -y 288 -o output.webm -
Live encoding and streaming to icecast server:
dvgrab --format raw -
| ffmpeg2webm -f dv -x 160 -y 128 -o /dev/stdout -
| oggfwd iccast2server 8000 password /webm.webm
permalink