Help:Converting video

From Wikimedia Commons, the free media repository
(Redirected from Help:Converting audio)
Jump to navigation Jump to search

Shortcut: Help:CV

Video conversion help in other languages:

català | Deutsch | English | español | français | galego | italiano | 日本語 | polski | português | 中文 | +/−

Wikimedia Commons seeks video files which are within the project scope, such as educational videos, and which are in a free file format, which currently only means WebM and Ogg Theora (and WebM is preferred).

Most recording devices produce videos in other formats. Although the Wikimedia community wishes to encourage the use of free and open source software, as of November 2017 no one has identified any available free software which is easy for typical, non-technical editors to use for video conversions. This means that anyone seeking to upload video to Commons will either need to find a open software solution which works for them, or otherwise, use one of the non-open software solutions which others have recommended.

Easiest way for most users[edit]

The easiest way to get video into Wikimedia Commons is as follows:

  1. Identify the video file which you wish to share
    1. Confirm that either you own the copyright to the video and are willing to apply a free license to it, or otherwise that the video already has a free copyright license
    2. Confirm that the video is within the scope of what Commons will accept
  2. Upload the video file to Vimeo, a commercial video hosting service
    1. You have to create a Vimeo account
    2. the service is free for up to 500mb / week per user
    3. Vimeo can accept all common file types in full resolution
    4. You can configure Vimeo settings to automatically tag your videos with Creative Commons licenses, if you like
  3. After you have uploaded the file to Vimeo, use Video2commons to convert the file to a free format and import it to Commons
    1. The conversion happens in the cloud on the Wikimedia server side
    2. No software configuration required
  4. The file is now in Commons; process it here
    1. Categorize it, fix metadata
    2. Integrate the video with other Wikimedia projects, if you like

Another way to convert video format is as follows: If you are working in UBUNTU platform, click APPLICATIONS -> SOUND&VIDEOS-> TRANSMAGEDDON VIDEO TRANSCODER to convert a video format to another.

General conversion tips[edit]

  • When uploading a video (for use on Wikipedia), TimedMediaHandler will convert it into different versions, so you don’t need to provide separate versions for people on slow Internet connection. It is strongly recommended to upload your video with the best quality (bit rate and frame size) possible. If your resulting video file is larger than 100MB (104,857,600 Bytes) you should use UploadWizard (or another tool supporting chunked upload) allowing 4 GB; or use the Server-side upload (request help from a privileged user; no preset size limit).
  • WebM is the preferred format, but please do not convert from Ogg Theora unnecessarily, as it is also supported.
  • Some of the tools listed here for converting to Theora output the converted file with a .ogg filename extension. Rename the file to a .ogv extension, as this is now the preferred extension. For details see RFC 5334 and xiph.org. Pay attention to repeat the .ogv file type during upload; otherwise it (wrongly) defaults to .ogg again...
  • RFC 5334 .ogx for MIME type application/ogg is not yet widely supported; you can use .ogg for Theora video with FLAC instead of Vorbis audio.

Online conversion tools[edit]

Videoconvert[edit]

Commons Video Convert on the Wikimedia Toollabs is a simple, web-based solution allowing users to convert common video formats into WebM and uploading them directly to Commons. See Special:OAuthListConsumers/view/4301b5f1f4fd2d196e174d5352bcf978 for version 0.2, use Special:OAuthManageMyGrants to manage connected apps.

Video2commons[edit]

Video2commons is a tool to upload videos from a url to Wikimedia Commons, it automatically converts the video to a commons compatible format. It includes function such as removing audio, subtitles, video. The tool uses OAuth to login. You can find a description of this tool at Commons:video2commons.

Internet Archive[edit]

Internet Archive offers a video upload tool which automatically converts it to a number of formats, including ogg.

Convert-video-online.com[edit]

Convert-video-online.com allows you to upload the video file (max. 2Gb). Uploading speed depends on the internet connection speed. A free web app that converts video files, allowing you to change the video format, resolution or size right in a browser. All the app features are accessible free of charge and has no limit on the number of files you can convert. Moreover, users don’t even need to sign up or sign in.

Online-convert.com[edit]

Video.online-convert.com allows you to upload the video file (max. 100MB without registration). 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.

Multi-platform command-line conversion tools[edit]

ffmpeg[edit]

FFmpeg is the project upon which the ffmpeg2theora mentioned below is based. It provides a command-line program "ffmpeg", with which you can convert also to WebM, cf. TheoraVorbisEncodingGuide. (If you are Mac, you can use the ffmpegmac binaries)

.webm[edit]

Video (no audio):

ffmpeg -i input.mp4 -vcodec vp9 output.webm

Video (with audio):

ffmpeg -i input.mp4 -vcodec vp9 -acodec libopus output.webm

.ogv[edit]

ffprobe -show_entries stream=codec_name,codec_type:format=format_name,duration -of compact "demo.mp4"
ffmpeg -i "demo.mp4" -c:v libtheora -q:v 7 -c:a libvorbis -q:a 6 "demo.ogv"
ffmpeg -i "demo.mp4" -c:v libtheora -q:v 7 -c:a flac -sample_fmt s16 "demo.ogv"
ffmpeg -i "demo.mp4" -c:v libtheora -q:v 7 -an "demo.ogv"

Note on pixel formats[edit]

Note that certain pixel formats such as yuvj420p (e.g. in Motion JPEG files) will be converted by ffmpeg to yuv422p by default, which creates video files that will not play in some browsers like Chrome and Firefox. In this case, add -pix_fmt yuv420p to the ffmpeg command to convert to yuv420p.

avconv[edit]

Libav is a fork of FFmpeg providing the similar command-line program "avconv". It appears that the quality is not as good as oggconvert. Also the first and last seconds of an mp3 file can be lost (which is certainly not OK).

apt-get install libav-tools
  • To extract 325 seconds of audio starting at second 475 with a bitrate of 64 Mbit/s:
avconv -i input-file.mp3 -b 64k -ss 475 -t 325 output-file.mp3

The input file bit rate should be higher or equal to the output file bit rate... otherwise bad audio quality will be the result.

  • To convert multiple mp3 files at once to ogg format:
for i in *.mp3 ;do avconv -i ${i} ${i:%mp3}ogg ;done
  • To remove the (bad) sound from a video:
avconv -i infile -c copy -an outfile

ffmpeg2theora[edit]

ffmpeg2theora command-line tool converting a video file

ffmpeg2theora was a popular converter recommended at the Theora project page. It is a cross-platform command-line tool. The latest version is 0.29, released in July 2012.

In most cases you will only need a simple command indicating the name of the file to convert. (Video and audio quality is set to max.)

Command line examples
ffmpeg2theora file.avi -v 10 -a 10
ffmpeg2theora file.avi --noaudio -v 10

MPlayer[edit]

MPlayer is an open source multimedia player also being capable to transcode files but having the advantage of supporting both a GUI as well as the command line; available for most operating systems including Windows, Linux, and macOS. The MPlayer included by some SMPlayer distributions for Windows does not contain mencoder.exe.

OggConvert[edit]

OggConvert allows you to produce ogg/ogv output files. To install:

apt-get install oggconvert

VLC media player[edit]

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.

XiphQT[edit]

Xiph's QuickTime Components can be used to add OGG support to QuickTime Pro, under both macOS (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. On macOS, you can only do this using QuickTime 7, and you can download QuickTime 7 by visiting Apple.

Tools for Windows[edit]

XMedia Recode - Conversion to OGV
See above for multi-platform solutions. Frequent FFmpeg builds and a user forum are offered by zeranoe.
FFCoder

FFCoder (v2.2 BETA, 2013-02) is a .NET 2.0 frontend for FFmpeg and MEncoder.

Video to Theora

Video to Theora (version 2.0, 2013) is an AutoIt GUI for ffmpeg2theora.

XMedia Recode

XMedia Recode was recommended by the WebM project. Download an installer from xmedia-recode.de; a portable version is also available.

Tools for Linux[edit]

See above for multi-platform solutions.

Multi-platform editing tools[edit]

Using mkvmerge to cut a video
See above for the command line tools avconv, ffmpeg, and ffmpeg2theora.
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.

Shotcut

Shotcut is a free and open source software for Windows, Linux, macOS. It is based on FFmpeg, Media Lovin' Toolkit, Frei0r, Qt, and ICU, among others. Versions 14.11 (2014-11) and later support OPUS.

WebM with mkvtoolnix

WebM files are just MKV (Matroska) files which use a subset of the features for this format. With mkvtoolnix (GPLv2 for all platforms) it's very easy to manipulate them. VP9 video and OPUS audio in a WebM container are supported since 2013.

OpenShot

OpenShot Video Editor is an Open source graphical video editing tool available for all current platforms. It is an ideal platform to edit and export videos to ogv format. Choose the "All Formats OGG High" format with the highest possible resolution.

Kdenlive

Kdenlive is an open-source video editor for GNU/Linux, BSD, macOS and (recently) Windows.

See also[edit]

External links[edit]