18 May '13 - 19:33 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: EncoderCMDLN opus  (Read 864 times)
PapaBearPW
Posts: 33


« on: 15 Aug '12 - 23:14 »
Reply with quoteQuote

Hi,

I'm trying to work out how to use EncoderCMDLN for opus encoding. Here is what I have so far:

                    // OPUS
                    EncoderCMDLN opus = new EncoderCMDLN(mixerStream);

                    opus.EncoderDirectory = Path.Combine(Application.StartupPath, "encoders");
                    opus.CMDLN_Executable = "opusenc.exe";
                    opus.CMDLN_DefaultOutputExtension = ".opus";
                   
                    opus.InputFile = null;
                    opus.OutputFile = null;
                    opus.CMDLN_Bitrate = kbps;
                   
                    if (opus.EncoderExists)
                    {
                        encoder = opus;
                        encoder.UseAsyncQueue = true;
                    }
                    else
                    {
                        MessageBox.Show(this, "OPUS encoder can not be found or does not exist in " + opus.EncoderDirectory + " ."
                            + "\r\n The encoder can be found here: http://www.opus-codec.org/downloads/.");
                        return;
                    }

Opus website gives me the following example for the command line execution:

Quote
Record and send a live stream to an Icecast HTTP streaming server using oggfwd:
        arecord -c 2 -r 48000 -twav - | opusenc --bitrate 96 - - | oggfwd icecast.somewhere.org 8000 password /stream.opus

I'm just not sure how something like that should be setup within EncoderCMDLN. Any help would be appreciated.

Paul
Logged
Chris
Posts: 1501


« Reply #1 on: 15 Aug '12 - 23:58 »
Reply with quoteQuote

You are mixing 2 different things.
In your sourcecode you are using opusenc.exe the other thing is arecord.
The better way is using opusenc and if you want to record and send it to a icecast server just use the Streaming Server Framework from Bass.net.
Here the switches of opusenc
https://mf4.xiph.org/jenkins/view/opus/job/opus-tools/ws/man/opusenc.html
Logged
PapaBearPW
Posts: 33


« Reply #2 on: 16 Aug '12 - 08:33 »
Reply with quoteQuote

Hi Chris,

If you scroll down to the bottom of the page for that link you posted, you'll see an Examples section. That's where I got the quote I posted (arecord ... ).
I'm just not sure how to setup Bass.net to work with opusenc. It was only an example and not exactly what I was trying to use.

I've looked over all the switches from the opus man page, and I'm sure I could get the encoder working from a command line. But, like I say, I don't know how to make it work with Bass.net so I can have it encode an Icecast stream from one of my mixers (mixerStream).

The code I posted does not work by the way (using EncoderCMDLN). It returns an "Invalid EncoderType" error saying that .mp3, .aac, .ogg are the only valid encoder types (or something to that effect). So, I'm kind of left scratching my head on this one.
Logged
Chris
Posts: 1501


« Reply #3 on: 16 Aug '12 - 13:58 »
Reply with quoteQuote

I thing you have to wait til Radio42 have implement the Opus Stuff inside a new Bass_net Release.
Chris
Logged
radio42
Posts: 4012


« Reply #4 on: 16 Aug '12 - 20:08 »
Reply with quoteQuote

You might try to set the EncoderCMDLN channel type to OGG like this:
opus.CMDLN_EncoderType = BASSChannelType.BASS_CTYPE_STREAM_OGG;
The Broadcast class checks the provided channel type to validate the encoder. so setting this to OGG should actually also work for opus.
Logged
PapaBearPW
Posts: 33


« Reply #5 on: 17 Aug '12 - 08:14 »
Reply with quoteQuote

Thanks radio42. That did indeed clear the encoderType error. Now I get "Not connected! Encoder died!". So, I am at least further than before. Smiley

Still trying to see what else I need to do though.
Logged
radio42
Posts: 4012


« Reply #6 on: 17 Aug '12 - 13:01 »
Reply with quoteQuote

What "CMDLN_CBRString" have you set with the EncoderCMDLN?
It should be something like this:
opus.EncoderDirectory = Path.Combine(Application.StartupPath, "encoders");
opus.CMDLN_Executable = "opusenc.exe";
opus.CMDLN_DefaultOutputExtension = ".opus";
opus.InputFile = null;
opus.OutputFile = null;
opus.CMDLN_Bitrate = 96;
opus.CMDLN_CBRString = "--bitrate ${kbps} ${input} ${output}"
Logged
PapaBearPW
Posts: 33


« Reply #7 on: 17 Aug '12 - 18:00 »
Reply with quoteQuote

Thanks again radio42. That's what I was trying to figure out. The correct usage of CMDLN_CBRString within EncoderCMDLN.
I'll have to do some streaming tests now. I'll post the results here as soon as possible.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines