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 | Italiano | 日本語 | Polski | Português | +/−

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

Bergensbanen 320x180.ogv
Bergen Line in Norway
(View in high quality)

When converting a large, high quality video, convert the file into two versions. One for high-bandwidth users and the other for low bandwidth users. Making a viewer with a slow connection stream a big, 80MB file in an article is not ideal. Also, the smaller version reduces traffic 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:Bergensbanen 1280x720.ogv was originally uploaded at 1280x720, 1.3Mbps form which put the filesize at 85.6MB. The video was then re-uploaded at lower quality versions, which brought down the filesize to 17MB. 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 tasks

Here are some ways to manipulate .ogv Theora and other videos:

Cut or split sections of a video
  • use oggCut
  • or use oggz-chop to losslessly extract a section, for example to extract a 5 second section starting at 10 seconds:
  • oggz-chop.exe --start 10 --end 15 --no-skeleton input.ogv -o section.ogv
Join multiple videos
Split the audio from the video
  • to extract any stream without losing information use oggz-rip from oggz-tools:
    • oggz-rip.exe -c vorbis input.ogv -o theora_audio_only.ogg
  • using ffmpeg2theora may degrade the audio: ffmpeg2theora --novideo -o outputAudio.ogg
  • or use oggSplit
Join video and audio
  • use oggjoin
  • or use oggz-merge.exe video.ogv audio.ogg --output videowithaudio.ogv
Silence the audio in a video
  • to extract any stream without losing information use oggz-rip from oggz-tools:
    • oggz-rip.exe -c theora input.ogv -o theora_video_only.ogv
  • using ffmpeg2theora will degrade the video: ffmpeg2theora --noaudio -o outPutVideo.ogv
Create video slideshow from images (jpeg or png)
Create an image snapshot from a video frame
Add metadata, such as date, license, artist, etc
  • use ffmpeg2theora --artist, --date, --license
Retrieve information about the source
  • use ffmpeg2theora --info MyVideo.ogv to view details such as framerate, bitrate, pixel aspect ratio
  • use oggz-info.exe to list details of each component stream
  • use oggz-comment.exe to list or edits comments in a Theora OGG file
  • use oggz-scan.exe to list all keyframe times
Convert video to a selected sequence of images
  • use SUPER by eRightSoft (see SUPER encoder below) by choosing Sequence Of Images in the field labeled Select the Output Container and click the Encode button; you can choose from JPG, PNG, PPM/PNM or PGM (Gray Mode).
  • or use MPlayer's "-vo" option to extract frames as PNG files as in: mplayer video.ogv -vo png:z=9
  • or, to select only specific frames from most video types, use Avidemux to save a short section of a long video and then use mplayer short_video -vo png:z=9
  • or, if IrfanView can play the video then try "Options/Extract all frames..."; to save disk space you may want to later losslessly convert the large BMPs to compact PNG files, using IrfanView's "File/Batch conversion/Rename..." menu command
convert video to a GIF
  • first convert video to a selected sequence of images, convert each image to a GIF and then use gifsicle --merge. This is not a lossless operation. You may need to reduce the original colour depth. You need to use --delay with the number of hundredths of a second that most closely matches the original frame rate. Example: gifsicle.exe --delay 20 --colors 256 --merge p*.gif --output merged5framespersecond.gif Use IrfanView for any conversions or colour depth reductions.
Extract snapshots from a video
  • use VLC's menu command "Video/Snapshot". Before using for the first time: click Tools/Preferences/Video; select a destination directory for Video snapshots, a prefix and either png or jpg format; then close and relaunch VLC
  • on Windows use fraps screenshot hotkey to take regular timed snapshots as BMP files which you then convert to PNG (shortest interval is one second)

[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.

ffmpeg2theora 0.25 has problems converting .mov (using motion jpeg codec) files with small video framerates. It's suggested you use a later version of ffmpeg2theora.

[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 the ffmpeg2theora version 0.25 parameter "--sync", or the parameter of ffmpeg2theora version 0.26 or later "--nosync", which might fix the issue.

So, for ffmpeg2theora version 0.25 try this command:

ffmpeg2theora --sync MyVideo.wmv

And, for ffmpeg2theora version 0.26 and later try this command:

ffmpeg2theora --nosync 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

See also List of Theora software encoders from Xiph.org

[edit] Miro Video Converter

The free Miro Theora video converter is available for Windows (Microsoft .NET Framework 3.5 required) and Mac computers and features a simple drag and drop interface, without the options to adjust the video quality. This is the recommended tool to convert video with a decent output quality, for users who don't want to fiddle with conversion parameters.

[edit] Firefogg

Firefogg screencast.ogv
Screencast on using Firefogg (high quality)

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 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.28, released in July 2011.

If version 0.28 is unable to convert your video correctly, try either an older version or the preview release. If all versions of ffmpeg2theora fail to correctly handle the framerate as commanded, then use Avidemux to first losslessly re-mux the source video to the desired framerate. See Help talk:Converting video#Changing frame rate with Avidemux for a walkthrough.

Use the list of ffmpeg2theora parameters to change video parameters, such as video quality.

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

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 encode 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. Double click on the pkg file.
  4. Follow the instructions
  5. The ffmpeg2theora program has been installed. Congratulations!

[edit] Operational instructions

These are instructions on using ffmpeg2theora. ffmpeg2theora must be installed for this to work.

  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 the [3] it's website.
  6. Drag the file you wish to convert into the terminal.
  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.[4]
  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] AutoFFmpegTheora

AutoFFmpegTheora is a GUI wrapper for ffmpeg2theora created by a member of the doom9.org forums. Most, if not all, ffmpeg2theora parameters are featured in this application.

Download from this website.

[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 ([5]). Older versions have been reported as working better, but no details of Vorbis capability. ([6])

[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 [7]
  2. Download and install the Quicktime alternative codec [8]
  3. Download and install Virtualdub [9]
  4. Download ffmpeg2theora [10]
  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 (an acronym for Simplified Universal Player Encoder & Renderer) by eRightSoft is a multi-purpose encoder that can convert in one step but it has fewer configuration options than the ffmpeg2theora command line. (Illustrated walkthrough in German here by chip.de; wikipedia articles in various languages: Deutsch, archive copy of now-deleted English article, Español, Français, Italiano, 日本語, 한국어.) Super 2009 build 36 uses ffmpeg2theora 0.24 as its backend. As of 2010 January 1 the latest version is v2010.Build.37 (Jan 2, 2010).

On Windows,

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

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

[edit] Online solutions

This solution allows you to upload the video file. The website will convert the video for you and present you with a link to download the converted file. The process may take several minutes depending on the size and quality of the video.

[edit] Still need help?

Start a new discussion topic on the talk page.

[edit] See also

[edit] External links

Personal tools
Namespaces
Variants
Actions
Navigation
Participate
Toolbox