[theora-dev] building under NetBSD

Jeremy C. Reed reed at reedmedia.net
Wed May 21 09:28:49 PDT 2003



On Wed, 21 May 2003, Ralph Giles wrote:

> So this patch lets it build and use OSS on *BSD?

I have a new patch. It works. See below.

> > This built, but this is not tested yet. I need to make some data to

> There's a test clip http://www.theora.org/test/test.zip you can use to
> verify decoding and encoding (only the first 5 seconds on uncompressed
> data are included)

Had problem with decoding:

$ work.rainier/theora/examples/player_example < /usr/pkg/tmp/theora/testlong.ogg
Error parsing Theora stream headers; corrupt stream?

The encoding seemed to work:

$ work.rainier/theora/examples/encoder_example /usr/pkg/tmp/theora/tkal_aud_short.wav /usr/pkg/tmp/theora/tkal_vid_short.yuv > J.ogg
File /usr/pkg/tmp/theora/tkal_aud_short.wav is 16 bit 2 channel 44100 Hz
RIFF WAV audio.
File /usr/pkg/tmp/theora/tkal_vid_short.yuv is 352x208 24.00 fps YUV12
video.
Compressing....
      0:00:05.07 audio: 73kbps video: 173kbps
done.

The encoded version was a different size than provided with the test.zip:

$ ls -l J.ogg /usr/pkg/tmp/theora/test*ogg
-rw-r--r--  1 reed  wheel   136826 Sep 30  2002 /usr/pkg/tmp/theora/test.ogg
-rw-r--r--  1 reed  wheel   707280 Sep 30  2002 /usr/pkg/tmp/theora/testlong.ogg
-rw-r--r--  1 reed  pkgsrc  163825 May 21 08:58 J.ogg

I assume the old format has changed in the new CVS (which is fine because
I understand that format is changing):

$ work.rainier/theora/examples/player_example < J.ogg
Encoded by Xiph.Org libTheora I 20030511 3 1 0
Ogg logical stream 46634f9f is Theora 352x208 24.00 fps video.
Ogg logical stream 47a4053e is Vorbis 2 channel 44100 Hz audio.
Could not open audio device /dev/dsp.

So I patched player_example again. (Thanks for updating CVS so quick!)

--- examples/player_example.c.orig	Wed May 21 03:41:43 2003
+++ examples/player_example.c
@@ -51,10 +51,13 @@
    just a little bit important */
 #if defined(__FreeBSD__)
 #include <machine/soundcard.h>
+#define AUDIO_DEVICE "/dev/audio"
 #elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include <soundcard.h>
+#define AUDIO_DEVICE "/dev/audio"
 #else
 #include <sys/soundcard.h>
+#define AUDIO_DEVICE "/dev/dsp"
 #endif
 #include <sys/ioctl.h>

@@ -146,9 +149,9 @@ static void open_audio(){
   int rate=vi.rate;
   int ret;

-  audiofd=open("/dev/dsp",O_RDWR);
+  audiofd=open(AUDIO_DEVICE,O_RDWR);
   if(audiofd<0){
-    fprintf(stderr,"Could not open audio device /dev/dsp.\n");
+    fprintf(stderr,"Could not open audio device " AUDIO_DEVICE ".\n");
     exit(1);
   }

<p>Then I could play the video (under NetBSD/i386 1.6; later I'll test
under FreeBSD and OpenBSD):

$ time work.rainier/theora/examples/player_example < J.ogg
Encoded by Xiph.Org libTheora I 20030511 3 1 0
Ogg logical stream 46634f9f is Theora 352x208 24.00 fps video.
Ogg logical stream 47a4053e is Vorbis 2 channel 44100 Hz audio.

Done.

real    0m5.561s
user    0m2.379s
sys     0m0.270s

<p>"... I love you like I do ..." (from the video above)

<p>   Jeremy C. Reed
   http://bsd.reedmedia.net/

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'theora-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Theora-dev mailing list