VP3 to Theora: Difference between revisions

From XiphWiki
Jump to navigation Jump to search
(slight wikify)
m (cleanup)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
This is a quick guide to show how to transcode [[VP3]] (usually with [[MP3]] audio) to [[Theora]].
== About ==
 
 
This is a quick guid to show how to transcode VP3 (usually with MP3) to Theora.


Now, this quick guide involves a lot of tools which are either experimental or are known to be buggy. Beware. Use with caution.
Now, this quick guide involves a lot of tools which are either experimental or are known to be buggy. Beware. Use with caution.
Line 9: Line 5:
== NSV ==
== NSV ==


If your Video is encapsulated in NSV you first need to remux it to AVI:
If your video is encapsulated in [[NSV]] you first need to remux it to [[AVI]]:


mencoder -oac copy -ovc copy -fafmttag 0x55 -o vp31.avi input.nsv
mencoder -oac copy -ovc copy -fafmttag 0x55 -o vp31.avi input.nsv
You can skip this step if your input file already is an AVI.


== Get the Theora code ==
== Get the Theora code ==


Download the Theora source code (svn co http://svn.xiph.org/trunk/theora).
Download the Theora source code: <tt>svn co http://svn.xiph.org/trunk/theora</tt>


== Build the avi2vp3 tool ==
== Build the avi2vp3 tool ==
Line 26: Line 24:


Copy theora/win32/experimental/transcoder/transcoder_example.c to theora/examples/encoder_example.c - this will replace the usual Theora encoder example with the application creating a Theora stream from the raw VP3 data.
Copy theora/win32/experimental/transcoder/transcoder_example.c to theora/examples/encoder_example.c - this will replace the usual Theora encoder example with the application creating a Theora stream from the raw VP3 data.


Configure your copy of Theora (run autogen.sh). This has a few dependencies. The configuration process will guide you. Be patient. Once configuration didn't complain because of missing dependencies: Invoke make.
Configure your copy of Theora (run autogen.sh). This has a few dependencies. The configuration process will guide you. Be patient. Once configuration didn't complain because of missing dependencies: Invoke make.
Line 34: Line 31:
== Process your videos ==
== Process your videos ==


* Use avi2vp3 to converter your VP3 AVI. The input file *must* be named vp31.avi, the output file will always be output.vp3
* Use avi2vp3 to convert your VP3 AVI. The input file *must* be named vp31.avi, the output file will always be outfile.vp3
* Use transcoder_example to create an Ogg Theora stream: transcoder_example output.vp3 > video.ogg
* Use transcoder_example to create an Ogg Theora stream: transcoder_example outfile.vp3 > video.ogg
* Use e.g. mplayer to decode the audio in the AVI file: mplayer -vo null -ao pcm vp31.avi
* Use e.g. mplayer to decode the audio in the AVI file: mplayer -vo null -ao pcm vp31.avi
* The audio will be in audiodump.wav. Encode it with e.g. oggenc: oggenc -q 1 audiodump.wav
* The audio will be in audiodump.wav. Encode it with e.g. oggenc: oggenc -q 1 audiodump.wav
Line 41: Line 38:


theora.ogg now should be a valid Theora + Vorbis Ogg file. Congratulations!
theora.ogg now should be a valid Theora + Vorbis Ogg file. Congratulations!
== Bugs ==
If the VP3 video input has dropped frames (this is common on broadcasted videos with narrow bandwidth constraints) you may notice that the created Theora file is distorted in affected parts of the video (apparently because the information that frames were dropped is lost, thus some video frames predict from the wrong predecessors).
[[Category:Theora]]

Latest revision as of 13:59, 6 July 2008

This is a quick guide to show how to transcode VP3 (usually with MP3 audio) to Theora.

Now, this quick guide involves a lot of tools which are either experimental or are known to be buggy. Beware. Use with caution.

NSV

If your video is encapsulated in NSV you first need to remux it to AVI:

mencoder -oac copy -ovc copy -fafmttag 0x55 -o vp31.avi input.nsv

You can skip this step if your input file already is an AVI.

Get the Theora code

Download the Theora source code: svn co http://svn.xiph.org/trunk/theora

Build the avi2vp3 tool

Go to theora/win32/experimental/transcoder/avi2vp3/

Compile the tool which will extract the VP3 data out of your AVI file: gcc *.c -o avi2vp3

Build transcoder_example

Copy theora/win32/experimental/transcoder/transcoder_example.c to theora/examples/encoder_example.c - this will replace the usual Theora encoder example with the application creating a Theora stream from the raw VP3 data.

Configure your copy of Theora (run autogen.sh). This has a few dependencies. The configuration process will guide you. Be patient. Once configuration didn't complain because of missing dependencies: Invoke make.

After everything compiled you should rename the encoder_example binary (which is in the examples directory) to e.g. transcoder_example to avoid confusion.

Process your videos

  • Use avi2vp3 to convert your VP3 AVI. The input file *must* be named vp31.avi, the output file will always be outfile.vp3
  • Use transcoder_example to create an Ogg Theora stream: transcoder_example outfile.vp3 > video.ogg
  • Use e.g. mplayer to decode the audio in the AVI file: mplayer -vo null -ao pcm vp31.avi
  • The audio will be in audiodump.wav. Encode it with e.g. oggenc: oggenc -q 1 audiodump.wav
  • Now you need to combine video.ogg and audiodump.ogg. Use oggzmerge from the oggz-tools package (at least in Ubuntu it's oggz-tools): oggzmerge video.ogg audiodump.ogg > theora.ogg

theora.ogg now should be a valid Theora + Vorbis Ogg file. Congratulations!

Bugs

If the VP3 video input has dropped frames (this is common on broadcasted videos with narrow bandwidth constraints) you may notice that the created Theora file is distorted in affected parts of the video (apparently because the information that frames were dropped is lost, thus some video frames predict from the wrong predecessors).