How could I download an mms audio stream in Ruby? - ruby

I would like to access an mms:// url, and stream the file in ruby. For example,
in the same way that Net:HTTP works for http:// type urls.

The simpliest (but non-scalable) way is to ask MPlayer to -dumpstream it for you.
http://mplayerhq.hu/

Related

Chromecast MediaInfo.Builder can't play shoutcast

I have one problem regarding MediaInfo.Builder of Google Cast. I used following code:
MediaInfo mediaInfo = new MediaInfo.Builder("http://shoutcast2.index.uz.zgora.pl:8000")
.setStreamType(MediaInfo.STREAM_TYPE_LIVE)
.setContentType("audio/mpeg")
.build();
But Cast player is not working at all. The reason is, that URL leads to SHOUTCAST. Apparently, the problem is in content type. Could somebody advise which contentType to use for shoutcast streams, or at least provide some workaround for this?
Thank you.
Instead of http://shoutcast2.index.uz.zgora.pl:8000/, use http://shoutcast2.index.uz.zgora.pl:8000/;. Note the semicolon on the end.
SHOUTcast servers are going to look for Mozilla in the User-Agent request header, as a way of detecting a browser vs. a media player. If the server thinks the client is a browser, it will send the admin page rather than the stream. By passing ; in the request URI, the SHOUTcast server will use the user agent string of MPEG OVERRIDE and will send the actual stream data.
You should also know that SHOUTcast isn't truly HTTP compatible. It's close enough that it will probably work, but may stop working in the future. Icecast is one of several better alternatives.
Brad's solution worked for me. Just added a slash and a semicolon after the port. I also changed the content type from audio/mpeg to audio/mp3. My working code looks like this.
MediaInfo mediaInfo = new MediaInfo.Builder("http://shoutcast2.index.uz.zgora.pl:8000/;")
.setStreamType(MediaInfo.STREAM_TYPE_LIVE)
.setContentType("audio/mp3")
.build();

Embed M3U8 joomla 3

i have some IPTV urls as (Playliste) .M3U8 .tsformat like this:
http://123.345.543/live/abcd/123456.m3u8
http://123.345.543/abcd/123456.ts
I trying Allvideos Player component and many other player plugin without success...
Please someone can called any extension or plugin can play this type of files
thank you
If you are saying that you can't play the above streams using the HTML5 tag, then, yes, this is expected behaviour at this time.
To play HLS and DASH video streams on a web browser you typically would use a Javascript player like Dash.js, BitMovin, Shaka player etc.
You can see example players which will allow you test the streams here:
http://dashif.org/reference/players/javascript/1.4.0/samples/dash-if-reference-player/
https://bitmovin.com/hls-fragmented-mp4/
https://shaka-player-demo.appspot.com

Private video streaming for Amazon CloudFront in ruby

How does signed URLs work for streamed videos in Amazon CloudFront?
I'm using aws_cf_signer gem, but can't get signed urls work for rtmp streamed mp4-file. For static files, like text.txt it works fine, but not when I have streaming distribution.
Example:
I have file named test.mp4 so how do I get signed url out of signer.sign()?
E.g. signed_url = signer.sign('rtmp://xyz.cloudfront.net/test', :ending => Time.now + 3600) does not produce working url. I have tested URLs with VLC player and rtmpdump
The distribution itself is created with boto like this:
stream_dist = cf.create_streaming_distribution(origin=origin,
enabled=True,
trusted_signers=["Self"],
comment="test distribution")
According to the AWS: Restricting End User Access doc, the format for signed RTMP urls is different from HTTP:
With HTTP, a full URL uniquely describes an object. You can include the URL
in the signature. The content of a streaming distribution, however, cannot always
be described by a valid URL. In a streaming distribution, you only use the stream
name to create a signature. For example, if your stream including the signature is:
example/mp3_name.mp3?Expires=1258237200&Signature=TBD&Key-Pair-Id=PK12345EXAMPLE
The value for RESOURCE is:
example/mp3_name
For streaming distributions, you do not include a prefix, such as mp3: or mp4:,
for the resource name in the policy.
Also, when referencing an MPEG file, you might have to omit the file extension for
the URL enclosed in the signature. For example, you use mp3_name instead of mp3_name.mp3.
I'm not sure whether aws_cf_signer gem supports signing RTMP urls, unfortunately. If you find out, please let me know!

Uploading an mp3 audio file to Http Server

I am trying to record an audio file from the microphone and uploading the same to a server using MultiPart data POST method. I would appreciate some help.
I am currently working on C# and making the code for Windows Phone 7.
Would deeply appreciate some help and if possible, some code reference as i am a newbie on the platform.
When recording from the Microphone, your data is raw PCM data. You will have to encode it manually, which may not be an easy task if you want to encode it into an MP3. You could upload the file (example in the link ba__friend` posted) as a WAV, or simply the raw data, and convert it to an MP3 on your server.

Windows Phone 7 ASX Streaming

I'm trying a small app which play a asx streaming file. My understanding was i should parse the asx and get the URL. But in my case, REFHREF in ASX points like this www.website.com:8084. Is this the server configuration need to be modified ? Totally new to this audio streaming protocols. Any suggestion would be much appreacited ...
My code streams audio fine when i test with a ww.website.com/file.MP3
the URL from refhref may most probably lead you to another asx file, which needs to be parsed again, i would advice recursively parsing till u reach a valid playable stream! Wp7 supports asx streams but it disallows(throws an exception for some tags check here )
so you will have to parse the asx yourself, extract the URL and process it further!
Good Luck! post your findings too!

Categories

Resources