Still working to recover. Please don't edit quite yet.

Difference between revisions of "how to encode video to OGG Theora"

From Anarchopedia
Jump to: navigation, search
(s/OGG/Ogg/)
(Replacing page with 'nn')
Line 1: Line 1:
This is a HOWTO explaining how to encode a video that you have on your computer to a free format of [[Ogg Theora]]. It will concentrate how to do this on [[GNU/Linux]] [[operating system]], if your computer is still running [[MS Windows]] please see [[how to install GNU/Linux]] or [[how to install Gygwin]].
+
nn
 
+
==DVD==
+
If the video you have is in the DVD format you will have two options, you can convert directly with [[Thoggen]] (simple way, but provides less control) or you can rip the [[VOB file]] and then follow the rest of the instructions presented here.
+
 
+
===Thoggen===
+
[[Image:Thoggen DVD rip 1.png|thumb|right|Selecting the title to rip.]]
+
 
+
Thoggen is a [[graphical user interface|GUI]] DVD ripper which creates Ogg Theora as an output file. Installation procedure for Thoggen differs dependinng on your GNU/Linux distribution, on [[Debian GNU/Linux|Debian]] based systems or other systems using [[apt-get]] you can install via <code>apt-get thoggen</code>, on [[Ubuntu GNU/Linux]] you will need to type: <code>sudo apt-get thoggen</code>. After the installation you will be able to find the “Thoggen DVD Ripper” in the menu or start it by <code>thoggen</code> command.
+
 
+
After starting it up and loading DVD you will be presented with the choice of which [[DVD title|title]] you want to rip. Thoggen will automatically select the largest of the titles for ripping, and usually this is the correct choice. Click [[OK button|OK]] and you will be taken to another [[graphical user interface window|window]] were you will be asked to give some parameters. Select the audio track, video dimentions, quality or desired size of the output file, a possible settings for croppinng (removing areas of the video, normally used to remove the black padding around the actual picture). Thoggen will save the output file in your home directory by default, taking the label of the DVD and the DVD title number to generate the name, you can change this name on this page. In the area “Stream information” you can also enter the name of the video you will be ripping, this name will be displayed by many video players (such as [[VLC media player]]) (Note: actually this is a feature of Thoggen which doesn't yet exist on ffmpeg for Ogg Theora).
+
 
+
[[Image:Thoggen DVD rip 2.png|thumb|right|Configuring the output file.]]
+
 
+
After everything is finalised, click [[OK button|OK]] and the encoding will begin, you will be presented with the progress image of the recently encoded frame and encoding statistics. At this stage you can pause or cansel encoding, but you cannot change any settings.
+
 
+
Warning: Sometimes Thoggen does weird things, like encodes only part of the title, or doesnʼt finish encoding when the end of the title is reached, consider it a payment for simplicity of use. Also media players show incorrect total time for all the files encoded with Thoggen.
+
 
+
===vobcopy===
+
If you chose to use a more powerful tool to encode the video you have on the DVD, you will want to extract the VOB file to your computer by using [[vobcopy]]. Install it with <code>apt-get vobcopy</code> or a simmilar method on your distribution. You can run <code>vobcopy</code> without any parameters, and the programme will attempt to guess what you wanted it to do; specifically it will extract the largest track, name it by combining the label of the DVD and the track number, and break the files up in chuncks of 4 [[GiB]]. The latter assumption will make it more difficult to deal with the files later, so it is possible to specify <code>-l</code> tag to allow the large file support. More options are available via <code>man vobcopy</code>.
+
 
+
==ffmpeg==
+
One of the strongest tools for re-encoding video is [[ffmpeg]]. It provides the wide range of options to encode in various formats, but here will be the discussion how to encode in Ogg theora from the various other formats.
+
 
+
To install ffmpeg, you will need to compile it yourself. Although ffmpeg is distributed in packages by many different distributions, it is generally a good idea not to rely on those packages (for example [irc://irc.freenode.org/ffmpeg #ffmpeg] support channel will provide no help with such packaged distributions). Start by checking out the current trunk: <code>svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg</code>, after the source code will be downloaded change into ffmpeg and configure the package you need. The full range of configureation options is available by typing <code>./configure -h</code>, for the most uses it will be sufficient to run <code>./configure  --enable-libtheora --enable-libvorbis --enable-gpl</code>.
+
 
+
If at this stage you get errors, make sure that:
+
# On Debian-based system you have installed build-essential package (<code>apt-get install build-essential</code>)
+
# You have libtheora and libvorbis installed (<code>apt-get install libtheora-dev</code> and <code>apt-get install libvorbis-dev</code>)
+
# Read the error message, perhaps you have some other packages missing from your system
+
 
+
If everything will go fine, you only have to run <code>make install</code> as a superuser (i.e. with su or sudo). After the compilation, assuming you got no errors, you can check that everything is well by running <code>ffmpeg -codecs</code>, and one of the first lines should be the settinngs which you have passed to configure ffmpeg. (If you are getting any weird errors, and you have recently moved the source code directory, run configure with <code>--source-path=/currennt/path</code>)
+
 
+
===VOB file===
+
Example of the command: <code>ffmpeg -i NEW1-1.vob -map 0:0 -map 0:2 -map 0:1 -croptop 0 -cropbottom 0 -f ogg -aspect 4:3 -vcodec libtheora -vb 1024k -acodec vorbis -ac 2 -vol 300 -ab 128k new.ogg -acodec vorbis -ac 2 -vol 300 -ab 128k -newaudio</code>
+
 
+
This will take an input file (<code>-i</code>) “NEW1-1.vob” and map change the order of the audio streams, in here 0:0 is the video stream and 0:1 and 0:2 are audio streams. There will be no cropping done of the video (note about cropping and padding: the final width and hight must both be divisible by 16). Output format (<code>-f</code>) is [[Ogg file|ogg]]. Aspect ratio of the video (<code>-aspect</code>) is 4:3 with video codec (<code>-vcodec</code>) being Theora (note called ‘'''lib'''theora’) and the video bitrate (<code>-vb</code>) of 1024k. Audio codec (<code>-acodec</code>) is Vorbis with two audio channnels (<code>-ac</code>) increased volume (<code>-vol</code>, 256 is normal), audio bitrate (<code>-ab</code>) is 128k. The output file will be “new.ogg”. What follows after that is the parameters for additional stream of audio (<code>-newaudio</code>); there could be multiple audio, video, and subtitle streams.
+
 
+
===Flash Video===
+
[[YouTube]], [[Google Video]], and many other sites today use [[Flash Video|FLV]]. ffmpeg can easily convert the [[how to grab Flash Video off the site|FLV you grabbed]] into Ogg. The surest way is <code>ffmpeg -i 1.flv -vcodec libtheora -sameq -acodec vorbis -ac 2 -sameq 1.ogg</code>. Please see that even though Flash Video only has a mono sound, due to the bug in ffmpeg you have to force 2 chanels when implementing on the fly (optionally you can separate the streams into multiple files and them mux them later).
+
 
+
===Unimplemented features in ffmpeg===
+
Some useful features are yet not implemented for Ogg containers, Ogg Vorbis, or Ogg Theora:
+
# Ogg container with video cannot have title (<code>-title</code>) and other simmilar settings
+
# Ogg Vorbis and Ogg Theora cannot be specified by quality, only by bitrate
+
# Only maximum of 2 channels can be in Ogg Vorbis
+
# Ogg container does not accept <code>-acode</code> and <code>-scode</code> settings.
+
 
+
==VLM==
+
VLM is a tool that comes with VLC media player, which is intended for streaming video, however, if you are on the computer where you cannnot install your own software, do not have internet access, or some this is a one off task you can load the video, which is playable by VLC and force the output to a file. This method will often fail, crashing VLC with no explanation, and provides the least control over the process.
+
 
+
==See also==
+
* [[Ogg Theora]]
+
** [[why use Ogg Theora]]
+
* [[free software]]
+
* [[how to encode video]]
+
** [[how to encode video to Ogg Media]]
+
 
+
==External links==
+
* [http://vobcopy.org/ vobcopy]
+
* [http://ffmpeg.org ffmpeg]
+
* [http://thoggen.sourceforge.net/ Thoggen]
+
 
+
[[Category:How tos]]
+
[[Category:Video encoding]]
+

Revision as of 08:04, 20 November 2008

nn