| 1 |
OGMtools 1.5 |
| 2 |
============== |
| 3 |
|
| 4 |
--[ IMPORTANT ] --------------------------------------------------- |
| 5 |
Up to version 1.2 ogmmerge produced broken headers. Version 1.2 is |
| 6 |
now able to read both the old headers and the proper new ones and |
| 7 |
will only write proper headers. In order to fix the broken headers |
| 8 |
in old files you can simply run something like: |
| 9 |
ogmmerge -o good.ogm old_and_broken.ogm |
| 10 |
--[ IMPORTANT ] --------------------------------------------------- |
| 11 |
|
| 12 |
These tools allow information about (ogminfo) or extraction |
| 13 |
from (ogmdemux) or creation of (ogmmerge) or the splitting of |
| 14 |
(ogmsplit) OGG media streams. OGM is used for "OGG media streams". |
| 15 |
|
| 16 |
Base code taken from Ogg/Vorbis CVS repository at |
| 17 |
http://www.xiph.org/ |
| 18 |
|
| 19 |
Installation is simple. Run './configure' followed by 'make' and |
| 20 |
'make install'. If, for some reason, there is no 'configure' script then |
| 21 |
run './autogen.sh' which will recreate it. |
| 22 |
|
| 23 |
The full documentation for each command is now maintained in its |
| 24 |
man page only. Type 'ogmmerge -h' to get you started. |
| 25 |
|
| 26 |
This code comes under the GPL (see www.gnu.org or the file COPYING). |
| 27 |
Modify as needed. |
| 28 |
|
| 29 |
The newest version can always be found at |
| 30 |
http://www.bunkus.org/videotools/ogmtools/index.html |
| 31 |
|
| 32 |
Moritz Bunkus <[email protected]> |
| 33 |
|
| 34 |
------------------ |
| 35 |
Example |
| 36 |
======= |
| 37 |
|
| 38 |
Here's a *very* brief example of how you could use the ogmtools |
| 39 |
with mencoder in order to rip a DVD: |
| 40 |
|
| 41 |
a) Extract the audio to PCM audio and let mencoder calculate the |
| 42 |
video frame numbers: |
| 43 |
|
| 44 |
mencoder -dvd 1 -ovc frameno -oac pcm -o frameno.avi |
| 45 |
|
| 46 |
b) Extract the audio again, this time to a plain WAV file: |
| 47 |
|
| 48 |
mplayer -dvd 1 -vc dummy -vo null -hardframedrop -ao pcm -aofile audio.wav |
| 49 |
|
| 50 |
At the moment selecting a non-existant video codec with -vc results |
| 51 |
in the fastest audio dump. |
| 52 |
|
| 53 |
c) Normalize the sound (optional) |
| 54 |
|
| 55 |
normalize audio.wav |
| 56 |
|
| 57 |
d) Encode the audio to Vorbis: |
| 58 |
|
| 59 |
oggenc -q3 -oaudio-q3.ogg audio.wav |
| 60 |
|
| 61 |
e) Somehow calculate the bitrate for your video. Use something like... |
| 62 |
|
| 63 |
video_size = (target_size - audio-size) / 1.0115 |
| 64 |
video_bitrate = video_size / length / 1000 * 8 |
| 65 |
|
| 66 |
target_size, audio_size in bytes |
| 67 |
length in seconds |
| 68 |
1.0115 is the overhead caused by putting the streams into an OGM file. |
| 69 |
video_bitrate will be in kbit/s |
| 70 |
|
| 71 |
f) Use the two-pass encoding for the video: |
| 72 |
|
| 73 |
mencoder -dvd 1 -oac copy -ovc lavc \ |
| 74 |
-lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vqmin=2:vpass=1 \ |
| 75 |
-vop scale=....,crop=..... \ |
| 76 |
-o /dev/null |
| 77 |
|
| 78 |
mencoder -dvd 1 -oac copy -ovc lavc \ |
| 79 |
-lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vqmin=2:vpass=2 \ |
| 80 |
-vop scale=....,crop=..... \ |
| 81 |
-o movie.avi |
| 82 |
|
| 83 |
g) Merge: |
| 84 |
|
| 85 |
ogmmerge -o movie.ogm -A movie.avi audio-q3.ogg |
| 86 |
|
| 87 |
The option -A should be given to avoid copying the raw PCM audio stream. |