Difference between revisions of "Encoding Videos"

From Theora Playback Library
Jump to: navigation, search
(ffmpeg)
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
 
'''ffmpeg2theora uncompressed_source.avi -v 8 -o output.ogv'''
 
'''ffmpeg2theora uncompressed_source.avi -v 8 -o output.ogv'''
  
* -v 8 indicates the level of quality. values between 6 and 8 are usually the best compromise. For mor control use the -V option to specify bitrate
+
* -v 8 indicates the level of quality. values between 6 and 8 are usually the best compromise. For more control use the -V option to specify bitrate
  
 
if you have multiple images, use this:
 
if you have multiple images, use this:
Line 29: Line 29:
  
 
[[File:ffmpeg2theora_bug.jpg]]
 
[[File:ffmpeg2theora_bug.jpg]]
 +
 +
 +
== [https://handbrake.fr/ Handbrake] ==
 +
 +
[https://handbrake.fr/ Handbrake] is a wonderful piece of open source software :) You can use it to encode h264 MP4 files that can be used on iOS and Mac as described on the [[Codecs]] page.
 +
 +
[[File:handbrake.jpg]]
 +
 +
 +
=== Known bugs ===
 +
 +
Sometimes, the video will be encoded in a way that the first frame is black... It's rare, don't know why it happens, don't know how to fix it using handbrake, if you encounter this, use ffmpeg in command line to encode the problematic video.
 +
 +
 +
== [https://www.ffmpeg.org/ ffmpeg] ==
 +
 +
And last but not least, you can always use the versatile [https://www.ffmpeg.org/ ffmpeg] command line tool to convert to either Theora or MP4.
 +
 +
[http://andrebluehs.net/blog/converting-avi-to-mp4-with-ffmpeg/ Here] is a good link with detailed intstructions.

Latest revision as of 13:08, 27 November 2014

There's not an abundance of tools to encode videos in the Theora format, so here you can read our recommended tools and techniques for encoding videos.

First of all, libtheoraplayer supports multiple codecs, not just Theora, depending on which plugins you use, read more here: Codecs.

ffmpeg2theora

ffmpeg2theora is a command line tool available for all the major OS's and is the recommended way to encode Theora videos. As the name suggests, it uses ffmpeg to read the source files which means it can pretty much read any format. Make sure you encode only from uncompressed sources as described on the Best Practices page. Uncompressed sources are either a series of images or an uncompressed video file (AVI, uncompresed MOV etc).

This tool supports a lot of fancy methods, be sure to read the documentation. The simplest way to encode a video with it is by this command:

ffmpeg2theora uncompressed_source.avi -v 8 -o output.ogv

  • -v 8 indicates the level of quality. values between 6 and 8 are usually the best compromise. For more control use the -V option to specify bitrate

if you have multiple images, use this:

Ffmpeg2theora.png

ffmpeg2theora image_%d.bmp -v 8 -o output.ogv

  • the source string is formatted similarly to the way C printf() function works.

Known bugs

If you're encoding a video from separate images, do not use png files! ffmpeg2theora reads them wrong, I don't know why. We recommend BMP files. If you use png's, you get something like this:

Ffmpeg2theora bug.jpg


Handbrake

Handbrake is a wonderful piece of open source software :) You can use it to encode h264 MP4 files that can be used on iOS and Mac as described on the Codecs page.

Handbrake.jpg


Known bugs

Sometimes, the video will be encoded in a way that the first frame is black... It's rare, don't know why it happens, don't know how to fix it using handbrake, if you encounter this, use ffmpeg in command line to encode the problematic video.


ffmpeg

And last but not least, you can always use the versatile ffmpeg command line tool to convert to either Theora or MP4.

Here is a good link with detailed intstructions.