Help:Converting video

From Wikimedia Commons, the free media repository

Jump to: navigation, search

Shortcut: Help:CV

Video conversion help in other languages:

Català | Deutsch | English | Español | Français | Galego | 日本語 | +/−

See also: Commons:Video

Wikimedia accepts only video files in the Theora Ogg format. To upload videos on Commons, you'll probably have to convert the video file into the Theora format. On this page, you'll find a collection of tools and methods for doing so. Note, .ogv is now the preferred file extension for Theora video files. More about the Theora format can be found at Theora.org.

Contents

[edit] Ogg-Theora conversion

At this moment, there are several tools that are capable of converting videos to Theora from various formats. However, depending on the source format (and especially when working with videos taken with a digital photo camera), the conversion may lead to the audio track being out of sync. Usually, you can overcome this problem by converting the source video to the MPEG format first, followed by converting the MPEG to Theora.

Some of the tools listed here output the converted file with a .ogg filename extension. Rename the file to have a .ogv extension, as this is now the preferred extension.[1]

[edit] General conversion tips

A woman demonstrates a hand-cranked washing machine outdoors. The machine has clothes and water in a metal drum about 1 meter in diameter and half a meter thick, rotating with its axis horizontal in a metal tub containing water.
An early Miele washing machine
(View in high quality)

When converting a high quality video, convert the file into two versions. One for high-bandwidth users and the other for low bandwidth. Making a viewer on a slow connection stream a 40mb file is not ideal. This also puts less stress on Wikimedia's servers. There is currently no defined method to offer readers multiple video versions, in order to select a quality and speed most suitable for their network bandwidth. While any video may be fully downloaded first for local playback, streaming of video requires that the file size be small enough to be reliably streamed continuously to the user within their bandwidth limits.

For example, File:Rhof-histWaschmaschine.ogg was originally uploaded at 412x320, 1.1mbps form which put the filesize at 9.0MB. The video was then re-uploaded at lower quality versions, which brought down the filesize to 2.2MB and less. When embedding the video on articles, embed the lower quality version. Then in the caption, provide a link to the original, higher quality file.

There are several changes you can do to the video file to decrease its filesize to make the video better for streaming, albeit with lower quality output:

  • Decrease the video frame size. Maintain the same ratio by decreasing the original frame size by 50%. For example, reducing a video from 640x480 to 320x240. See this image for possible resolutions to scale down to. Find the resolution of the original video and then follow the line to a lower resolution size.
  • Decrease the bitrate. For example, a bitrate of 220kbps will work for users with Internet DSL. Very high bitrates near or over 1Mb/sec may outstrip the ability of Wikipedia or the Commons to deliver the streaming data fast enough. This can be configured by the --videoquality parameter in ffmpeg2theora; set it to 6.
  • Consider removing the audio on the video if it does not improve the video. This may also improve the video if the sound is distracting (e.g. if there's strong wind or loud background noise)
  • Any combination of these three techniques further reduces filesize. For example, decreasing the video quality and reducing the video resolution.

[edit] Editing options

Here are some editing functions on .ogv Theora video using freely licensed tools:

  • Cut or split sections of a videos - using oggcut
  • Join multiple videos - using oggcat
  • Split the audio from the video - using ffmpeg2theora --novideo or oggSplit
  • Join video and audio - using oggjoin
  • Silence the audio - using ffmpeg2theora --noaudio -o outPutVideo.ogv
  • Extract audio from the video - using ffmpeg2theora --novideo -o outputAudio.ogg
  • Create video slideshow from images (jpeg or png) - using oggSlideshow
  • Create an image snapshot from a video frame - using oggThumb
  • Add metadata, such as date, license, artist, etc - using ffmpeg2theora --artist, --date, --license
  • Retrieve information about the source, including framerate, bitrate, pixel aspect ratio - using ffmpeg2theora --info MyVideo.ogv

[edit] Limitations

Although Theora and its tools are maturing, there may still be some problems when converting to this format. ffmpeg2theora uses ffmpeg. If ffmpeg is not able to decode the video, then ffmpeg2theora is unlikely to be able to convert it into a Theora video. Here is a list of codecs decodable by ffmpeg. You may find the codec being used in your video by using MediaInfo. Most popular formats and codecs are supported.

The latest version of ffmpeg2theora (0.25) has problems converting .mov (using motion jpeg codec) files with small video framerates. It's suggested you use ffmpeg2theora 0.24 for these files.

[edit] Audio sync issues

Converting certain video files, especially wmv video, may sometimes result in audio that is out of sync. In these cases, there is a ffmpeg2theora parameter which sometimes fixes the issue.

ffmpeg2theora --sync MyVideo.wmv

If this does not work, split the source video into audio and video streams and convert them separately into Theora and Ogg Vorbis files. Then join both streams using oggJoin.

[edit] Ogg-Theora - Multi-platform solutions

Firefogg web interface
See also List of Theora software encoders from Xiph.org

[edit] Firefogg

Firefogg is a cross platform browser extension for Firefox that lets websites use the ffmpeg2theora encoder for converting to ogg theora. In addition to encoding the file, firefogg allows other options to be set, including removing audio and changing the aspect ratio. All converting is done on your computer; the file is never uploaded on the firefogg website.

Firefogg is planned to be integrated with Wikimedia Commons.[2]

[edit] ffmpeg2theora

ffmpeg2theora command-line tool converting a video file

ffmpeg2theora is probably the most popular converter and is recommended at the Theora project page. It is a cross-platform command-line tool. The latest version is 0.25, released in September 2009. Use the list of ffmpeg2theora parameters to change specific settings.

In most cases you will only need a simple command indicating the name of the file to convert.

ffmpeg2theora file.avi

To convert without audio, input

ffmpeg2theora --noaudio file.avi

In most cases, one pass with ffmpeg2theora is enough. But if you have some audio problems, you can do a first w:transcoding in mpeg using tovid.

Some additional documentation, such as removing audio and clipping sections, is available at the official website and TheoraCookbook

[edit] VLC media player

VLC is a GUI version media player with conversion capabilities. A helpful tutorial can be found at TheoraCookbook. Encoding using the GUI requires a targeted bitrate which yields inferior quality than encoding for a specified video quality.

[edit] XiphQT

Xiph's QuickTime Components can be used to add OGG support to QuickTime Pro, under both OSX (version 10.3.9 or later) and Windows. Download and install the component, and it will add a "Movie to OGG" option to the File->Export dialog.

[edit] Ogg Video Tools

The Xiph oggz tool is able to 'chop' or split a theora file between given start and end times and 'merge' or join two Theora-encoded videos.

Ogg Video Tools is a collection of command-line tools that help with OGG video editing, including resizing, splitting and joining, creating slideshows from png files, and joining or separating audio and video streams from a .ogv file.

[edit] Ogg-Theora - Tools for Macs

[edit] Simple Theora Encoder

Simple Theora Encoder is an easy to use program.

[edit] Instructions

  1. Open "Simple Theora Encoder"
  2. Click the "Add…" button.
  3. Select the file you wish to convert. Note: Simple Theora Encoder does not accept files without extensions (e.g. ".mov" ".mpg" ".avi" ".wmv") If the file you wish to convert does not have an extension, please add the appropriate extension before attempting to select it with Simple Theora Encoder. Additional note: Although Simple Theora Encoder will accept many video files, they will appear to be low-quality unless they have been encoded with an MPEG codec. For optimal video quality, please save your video with an MPEG codec such as MPEG-4.
  4. Add any additional files that you wish to be included in the Ogg. Simple Theora Encoder will concatenate them together for you.
  5. Click the "Encode…" button to convert your file(s) into an Ogg Theora file. Note: Files that you are going to will have a status that reads "waiting…." You do not have to wait for them. The "waiting…" status means that the program is waiting for you.

[edit] Simple Theora Encoder problems and solutions

  • Problem: Simple Theora Encoder creates poor-quality video files
    • Solution: Your source file is probably not compressed with an MPEG codec. Simple Theora Encoder works much much better with video files encoded in an MPEG codec. Try converting your source file into a file using an MPEG codec, such as a QuickTime video with the MPEG-4 video codec that is available in programs such as iMovie, GraphicConverter, and QuickTime Pro.
  • Problem: Simple Theora Encoder won't open my file.
    • Solution: Make sure your file has a file extension such as ".mov" ".mpg" ".avi" and ".wmv." If it still won't open it them it must not like your file format.
  • Problem: Simple Theora Encoder is stuck. It says "waiting…" and is not doing anything.
    • Solution: Simple Theora Encoder says, "waiting…" when the file has been successfully been added to the conversion queue. The program is not frozen. Press "Encode…" to save the file as an Ogg, or press "Add…" to add more files to convert.
  • Problem: Simple Theora Encoder is stuck. It says "encoding…" and is not doing anything.
    • Solution: You probably tried to convert a QuickTime movie with audio. Simple Theora Encoder can't convert QuickTime movies with audio tracks.

[edit] Comparison with ffmpeg2theora

Simple Theora Encoder is a much much easier option for Mac users than the ffmpeg2theora command-line program. Simple Theora Encoder is possibly a graphical shell for ffmpeg2theora as they are both subject to the same bug (both programs stretch the video vertically), however, Simple Theora Encoder seems to be compatible with more files than ffmpeg2theora. Perhaps it has an additional program to convert files into MPEG before converting then to Ogg. One disadvantage of Simple Theora Encoder is its lack of options. There are no options at all, unless you count its capability of concatenating several files together into one Ogg file. The ffmpeg2theora program includes video and audio compression options as well as many other options.

[edit] ffmpeg2theora

[edit] Manual installation

Manual installation instruction for those that the installer failed and for those that do not wish to wait on the installer program.

Note:This was written for version 0.19 of ffmpeg2theora; it may not work with other versions.

  1. Download the Mac version of ffmpeg2theora.
  2. Decompress the downloaded file if it has not already been so. (Decompress it by double-clicking it - open it.) A package file will appear.
  3. Right click (or cntr-click) on the pkg file.
  4. Select "Show Package Contents." A window will open.
  5. Open the "Contents" folder in this new window.
  6. Decompress the file "Archive.pax.gz" by opening it (double-click it.) The folder "usr" will appear.
  7. Open the folder "usr."
  8. Open the folder "local."
  9. Open the folder "bin."
  10. You have found the command-line application! Copy "ffmpeg2theora" to the "bin" folder inside the "usr" folder of the root directory of your startup disc. To get to this folder, copy and paste "file:///usr/bin" into the address bar of your browser and hit return. Due to imposed limits of WikiMedia onto MediaWiki, I could not provide you with a direct link. WikiMedia can be a real douche sometimes.
  11. A window will appear asking you for authorisation to perform this manual installation. You must have an administrator username and password to perform the installation.
  12. Click "Authenticate."
  13. Enter the username and password of an administrator of your computer. (You may be an administrator. Try your own username and password.)
  14. After you have copied "ffmpeg2theora" into the "file:///usr/bin" folder, the ffmpeg2theora program has been installed. Congratulations!

[edit] Operational instructions

These are instructions on using ffmpeg2theora. ffmpeg2theora must be installed for this to work. Important: I've never gotten audio to work in this. Files with audio were either mutilated or froze the program.

  1. Open the Terminal. It is located within the Utilities folder of your Applications folder.
  2. Within the terminal, type "ffmpeg2theora " including the space and without the quotes, of course.
  3. To adjust the video quality, type "-v " including the space and then enter a number from 0 through 10. 10 is maximum quality and 0 is minimal quality. Note: This is case sensitive.
  4. To adjust the audio quality, type "-a " including the space and then enter a number from 0 through 10. 10 is maximum quality and 0 is minimal quality. Note: This is case sensitive.
  5. Additional commands can be found (at time of writting) at the Ffmpeg2theora article at en.linuxreviews.org.
  6. Drag the file you wish to convert into the terminal. Important note: You cannot convert files that are not encoded with an MPEG codec. The ffmpeg2theora program only accepts video files that have been encoded with an MPEG codec, such as a QuickTime .mov file with the MPEG-4 codec. QuickTime movies with audio will freeze the program. Please remove the audio from QuickTime files or convert them into MPEG files to convert them. Audio will still not convert in the MPEG format, but it will not freeze the program.
  7. Hit return.
  8. File should now be saved to the location of the original file with the ".ogv" extension.

[edit] Ogg-Theora - Tools for Windows

[edit] ffmpeg2theora

Here's the super-executive summary of how to use ff2mpeg for Windows XP:

  1. Save ffmpeg2theora to your desktop
  2. Go to start -> run
  3. Type "cmd" and hit enter. A black screen will pop up. This is the command prompt
  4. Drag the ffmpeg2theora icon (the one on your desktop) into the window. The ffmpeg2theora's location will be copied into the command prompt window, unless you are using Windows Vista or newer.[3]
  5. Click the window and hit the space bar once (to put a space a after the address)
  6. Drag the file you want decoded (let's call it xyz.mpg) into the command prompt window
  7. Click the command prompt window and hit enter
  8. Assuming you did everything correct, ffmpeg2theora will convert the file. The new location will be xyz.ogv.

[edit] FFCoder

FFCoder is a (portable) Windows program that uses ffmpeg and ffmpeg2theora for converting to Theora. Can be used for batch encoding. FFCoder 0.95 uses ffmpeg2theora 0.24. The default encoder is ffmpeg. If this does not work, try using ffmpeg2theora by changing it in the encoder menu.

  1. Add the files
  2. In the General field, select OGG. Change file extension to .ogv
  3. In Audio, choose Vorbis (libvorbis)
  4. In Video, choose Theora. Configure as needed.
  5. Set the output folder. Start the encoding.

[edit] MediaCoder

MediaCoder is a free gui-based tool for Windows with which one can convert between various encodings.

MediaCoder is a universal media transcoder capable of batch transcoding, audio-video conversions. The MediaCoder distribution is closed source with its own MediaCoder EULA, together with separately licensed components not included in the binary.

On WINE: MediaCoder version 0.7.0.4370 was tested on WINE version 1.1.18 on Ubuntu 9.04 "Jaunty" and although "almost everything" worked, "Vorbis" and "xvid + vorbis (ogm)" did not work ([4]). Older versions have been reported as working better, but no details of Vorbis capability. ([5])

[edit] Using RAD Video Tools

Here's a method for converting Quicktime movies into Ogg Theora videos using RAD Tools. It does require two transcodings (instead of the ideal single-step).

  1. Download and install RAD Video Tools [6]
  2. Download and install the Quicktime alternative codec [7]
  3. Download and install Virtualdub [8]
  4. Download ffmpeg2theora [9]
  5. Using the Rad video tools, convert the movie from Quicktime (.mov) to uncompressed AVI
  6. (Optional) Use Virtualdub to do any necessary editing (such as rotating the video using the "rotate" filter) and save as an uncompressed AVI
  7. Use ffmpeg2theora to convert from uncompressed AVI to Ogg theora

[edit] SUPER encoder

SUPER is a multi-purpose encoder that can convert in one step but it has fewer configuration options than the ffmpeg2theora command line. Super 2009 build 36 uses ffmpeg2theora 0.24 as its backend.

On Windows,

  1. drag the movie file into the SUPER window
  2. select output container ogg
  3. slect video codec theora
  4. click Encode.

The result file will have extension ".OGG". Change this to .ogv before uploading to Commons.

[edit] Online solutions

Upload the file and choose Ogg video as output. You'll receive an email when the video has been converted. May take up to an hour or two.

[edit] Still need help?

Start a new discussion topic on the talk page.

[edit] See also

[edit] External links