diff options
author | Aki <please@ignore.pl> | 2021-09-29 22:52:49 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-09-29 22:52:49 +0200 |
commit | 74f4b1bc3b627ba4c7e03498234d88cacdfbe97b (patch) | |
tree | 197b5978d6e38f44069ea92583098a1da04aa635 /doc/vorbisenc/examples.html | |
download | starshatter-74f4b1bc3b627ba4c7e03498234d88cacdfbe97b.zip starshatter-74f4b1bc3b627ba4c7e03498234d88cacdfbe97b.tar.gz starshatter-74f4b1bc3b627ba4c7e03498234d88cacdfbe97b.tar.bz2 |
Squashed 'vorbis/' content from commit d22c3ab5f
git-subtree-dir: vorbis
git-subtree-split: d22c3ab5f633460abc2532feee60ca0892134cbf
Diffstat (limited to 'doc/vorbisenc/examples.html')
-rw-r--r-- | doc/vorbisenc/examples.html | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/doc/vorbisenc/examples.html b/doc/vorbisenc/examples.html new file mode 100644 index 0000000..1fcc7e0 --- /dev/null +++ b/doc/vorbisenc/examples.html @@ -0,0 +1,133 @@ +<html> + +<head> +<title>libvorbisenc - Documentation</title> +<link rel=stylesheet href="style.css" type="text/css"> +</head> + +<body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff"> +<table border=0 width=100%> +<tr> +<td><p class=tiny>libvorbisenc documentation</p></td> +<td align=right><p class=tiny>libvorbisenc version 1.3.2 - 20101101</p></td> +</tr> +</table> + +<h1>Libvorbisenc Setup Examples</h1> + +VBR is always the recommended mode for Vorbis encoding when +there's no need to impose bitrate constraints. True VBR encoding will +always produce the most consistent quality output as well as the +highest quality for a the bits used. + +<p>The following code examples prepare a +<a href="../libvorbis/vorbis_info.html">vorbis_info</a> structure for encoding +use with libvorbis.<p> + +<h2>Example: encoding using a VBR quality mode</h2> + +<table border=0 width=100% color=black cellspacing=0 cellpadding=7> +<tr bgcolor=#cccccc><td><pre><b> + vorbis_info_init(&vi); + + /********************************************************************* + Encoding using a VBR quality mode. The usable range is -.1 + (lowest quality, smallest file) to 1.0 (highest quality, largest file). + Example quality mode .4: 44kHz stereo coupled, roughly 128kbps VBR + *********************************************************************/ + + ret = vorbis_encode_init_vbr(&vi,2,44100,.4); + + /********************************************************************* + do not continue if setup failed; this can happen if we ask for a + mode that libVorbis does not support (eg, too low a quality mode, etc, + will return 'OV_EIMPL') + *********************************************************************/ + + if(ret) exit(1); +</b></pre></td></tr></table> + +<h2>Example: encoding using average bitrate (ABR)</h2> + +<table border=0 width=100% color=black cellspacing=0 cellpadding=7> +<tr bgcolor=#cccccc><td><pre><b> + vorbis_info_init(&vi); + + /********************************************************************* + Encoding using an average bitrate mode (ABR). + example: 44kHz stereo coupled, average 128kbps ABR + *********************************************************************/ + + ret = vorbis_encode_init(&vi,2,44100,-1,128000,-1); + + /********************************************************************* + do not continue if setup failed; this can happen if we ask for a + mode that libVorbis does not support (eg, too low a bitrate, etc, + will return 'OV_EIMPL') + *********************************************************************/ + + if(ret) exit(1); +</b></pre></td></tr></table> + +<h2>Example: encoding using constant bitrate (CBR)</h2> + +<table border=0 width=100% color=black cellspacing=0 cellpadding=7> +<tr bgcolor=#cccccc><td><pre><b> + vorbis_info_init(&vi); + + /********************************************************************* + Encoding using a constant bitrate mode (CBR). + example: 44kHz stereo coupled, average 128kbps CBR + *********************************************************************/ + + ret = vorbis_encode_init(&vi,2,44100,128000,128000,128000); + + /********************************************************************* + do not continue if setup failed; this can happen if we ask for a + mode that libVorbis does not support (eg, too low a bitrate, etc, + will return 'OV_EIMPL') + *********************************************************************/ + + if(ret) exit(1); +</b></pre></td></tr></table> + +<h2>Example: encoding using VBR selected by approximate bitrate</h2> + +<table border=0 width=100% color=black cellspacing=0 cellpadding=7> +<tr bgcolor=#cccccc><td><pre><b> + vorbis_info_init(&vi); + + /********************************************************************* + Encode using a quality mode, but select that quality mode by asking for + an approximate bitrate. This is not ABR, it is true VBR, but selected + using the bitrate interface, and then turning bitrate management off: + *********************************************************************/ + + ret = ( vorbis_encode_setup_managed(&vi,2,44100,-1,128000,-1) || + vorbis_encode_ctl(&vi,OV_ECTL_RATEMANAGE2_SET,NULL) || + vorbis_encode_setup_init(&vi)); + + /********************************************************************* + do not continue if setup failed; this can happen if we ask for a + mode that libVorbis does not support (eg, too low a bitrate, etc, + will return 'OV_EIMPL') + *********************************************************************/ + + if(ret) exit(1); +</b></pre></td></tr></table> + +<br><br> +<hr noshade> +<table border=0 width=100%> +<tr valign=top> +<td><p class=tiny>copyright © 2000-2010 Xiph.Org</p></td> +<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td> +</tr><tr> +<td><p class=tiny>libvorbisenc documentation</p></td> +<td align=right><p class=tiny>libvorbisenc version 1.3.2 - 20101101</p></td> +</tr> +</table> + +</body> + +</html> |