Old 12th December 2010, 01:46   #1
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
new flash playback method

Shoot me if this is old news, but you no longer need red5 to stream NSV content.

flash coders, look up

code:
NetStreamAppendBytesAction


I am able to playback vp6.2 from a random nsv station without red5, directly to flash.

Smelter is offline   Reply With Quote
Old 12th December 2010, 03:00   #2
sankt
Moderator
 
sankt's Avatar
 
Join Date: Apr 2003
Location: www.ScenicRadio.com
Posts: 2,975
Package flash.net
Class public final class NetStreamAppendBytesAction
Inheritance NetStreamAppendBytesAction Inheritance Object

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10.1, AIR 2

The NetStreamAppendBytesAction class is an enumeration of the constants you can pass to the NetStream.appendBytesAction() method.

Two of the constants indicate a timescale discontinuity. Every FLV tag has a timestamp indicating its position in the timescale. Timestamps are used to synchronize video, audio, and script data playback. Timestamps for FLV tags of the same type (video, audio, script data) must not decrease as the FLV progresses.

Scenic Television is your ambient window to the world - - Television.ScenicRadio.com
sankt is offline   Reply With Quote
Old 12th December 2010, 04:06   #3
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
code:

flv_writer.createFile(Swidth,Sheight,framerate);
ns.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
ns.appendBytes(flv_writer.bytes);
flv_writer.gc();




code:

var more:ByteArray=new ByteArray();
var tag:ByteArray=flv_writer.flvTagVideo(vd, Number( 1000.0/ framerate) * frames ,vidType,true);
more.writeBytes(tag);
ns.appendBytes(more);

flv_writer.gc();

Smelter is offline   Reply With Quote
Old 12th December 2010, 10:58   #4
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
word
Attached Thumbnails
Click image for larger version

Name:	nsvReader.jpg
Views:	296
Size:	103.9 KB
ID:	48091  
Smelter is offline   Reply With Quote
Old 12th December 2010, 11:31   #5
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
upside down miss jane (you have to be australian to understand)

Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote
Old 12th December 2010, 19:29   #6
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
heh.

well I can say vp61= no pink blocks. Of course still upside down. Also no memory leak.
Smelter is offline   Reply With Quote
Old 13th December 2010, 05:45   #7
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Now includes AAC and AAC plus.

Attached Thumbnails
Click image for larger version

Name:	aacEnabled.jpg
Views:	261
Size:	110.5 KB
ID:	48098  
Smelter is offline   Reply With Quote
Old 13th December 2010, 17:47   #8
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
blog post about it.

http://www.thebitstream.com/?p=233
Smelter is offline   Reply With Quote
Old 13th December 2010, 19:15   #9
oLRi
Member
 
Join Date: May 2008
Posts: 94
Hi,

Is the full sourcecode of a sample player availible?
oLRi is offline   Reply With Quote
Old 13th December 2010, 19:43   #10
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Not at this time.
Smelter is offline   Reply With Quote
Old 13th December 2010, 23:17   #11
oLRi
Member
 
Join Date: May 2008
Posts: 94
A simple sample code would be nice.
played arround with this stuff this evening but with no success.

I guess i have to recive the nsv stream in a byte-stream format?!
oLRi is offline   Reply With Quote
Old 16th December 2010, 19:10   #12
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
There really is no such simple sample of code. Yes you need bytestream.

I sent a sample app to the fine folks at shoutcast.com to prove that aacp and vp6 works in a standalone swf.
Smelter is offline   Reply With Quote
Old 17th December 2010, 15:56   #13
oLRi
Member
 
Join Date: May 2008
Posts: 94
Hmm i thought: get it running with localfiles would be a nice point for starting:

I was able to open a flv file, load it into a bytearray and playit with NetStreamAppendBytesAction

but loading a local nsv file ends with nothing to see
oLRi is offline   Reply With Quote
Old 17th December 2010, 17:14   #14
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Yeah, that is a nice starting point.
Smelter is offline   Reply With Quote
Old 17th December 2010, 17:16   #15
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Format
Attached Files
File Type: zip NSVFormat.zip (18.1 KB, 367 views)
Smelter is offline   Reply With Quote
Old 22nd December 2010, 08:53   #16
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
does this method require crossdomain.xml policy thingo?

I read somewhere that if you want to use netstream.appendBytes, then crossdomain policies apply

Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote
Old 22nd December 2010, 17:46   #17
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Not in my experience. What is worse is that I had no trouble saving the flv tags locally.
Smelter is offline   Reply With Quote
Old 23rd December 2010, 18:08   #18
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Hey guys, I got a partner to fund the publishing and hosting of the code. coming soon to a public svn near you!
Smelter is offline   Reply With Quote
Old 24th December 2010, 22:21   #19
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
On the crossdomain.xml file, it will need one when deployed. Simply launching the file from the IDE does not need one.
Smelter is offline   Reply With Quote
Old 25th December 2010, 01:24   #20
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
if the shoutcast server is on the same domain as the flash file, no policy file is needed, unless the connection used is a socket. A Url stream does not need a socket policy file.
Smelter is offline   Reply With Quote
Old 25th December 2010, 14:20   #21
oLRi
Member
 
Join Date: May 2008
Posts: 94
Can't wait to test it...
oLRi is offline   Reply With Quote
Old 27th December 2010, 01:22   #22
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
Quote:
Originally Posted by Smelter View Post
if the shoutcast server is on the same domain as the flash file, no policy file is needed, unless the connection used is a socket. A Url stream does not need a socket policy file.
that's a problem with 99% of shoutcast hosts - they aren't likely to have a crossdomain policy file

I wonder if the (few) hosts that offer shoutcast v2 will have the flashpolicyfile setting enabled

Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote
Old 27th December 2010, 22:03   #23
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Any one with a 24/7 or 18/7 nsv/shoutcast station they can add the policy file too?

I'd like to set up some live demos very soon and test some more.
Smelter is offline   Reply With Quote
Old 28th December 2010, 09:22   #24
oLRi
Member
 
Join Date: May 2008
Posts: 94
Quote:
Originally Posted by Smelter View Post
Any one with a 24/7 or 18/7 nsv/shoutcast station they can add the policy file too?
code:
http://80.237.157.67:12000;stream.nsv
oLRi is offline   Reply With Quote
Old 28th December 2010, 16:50   #25
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
where is the crossdomain policy file?
Smelter is offline   Reply With Quote
Old 28th December 2010, 17:16   #26
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Here is an old one that you can copy, but the new one have additional attributes.

http://www.thebitstream.com/crossdomain.xml
Smelter is offline   Reply With Quote
Old 28th December 2010, 17:28   #27
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
btw olri, nice stream.


code:

[SWF] /TranscoderProto.swf - 24,893 bytes after decompression
[SWF] /Proto.swf - 29,300 bytes after decompression
[SWF] /CodecPack.swf - 31,232 bytes after decompression
playNext
Play stream type: Shoutcast Stream uri: http://bonkers.com:8000/;stream.nsv
[SWF] /Shoutcast.swf - 53,547 bytes after decompression

Provider Loaded
Metadata :
videocodec : VP62
framerate : 30
genre : Pop Top40 Charts Hits News
audiocodec : AACP
audiocodecid : 10
name : )) ~ POP-Radio POP One ~ ((::: streamed by pop-stream.de
url : http://www.pop-radio.de
br : 256
width : 320
flipVideo : 1
height : 240
pub : 0
videocodecid : 4
onCodecReady : AACP
onCodecReady : VP62
aux :SUBT
54 4
onCodecReady : SUBT
aux :SUBT
54 4

Smelter is offline   Reply With Quote
Old 28th December 2010, 23:32   #28
jaromanda
Forum King
 
Join Date: Jun 2007
Location: Under the bridge
Posts: 2,289
Quote:
br : 256
- you looking at the olri's stream??? winamp reports ~ 512kbps

Is it just me or are shoutcast users getting dumber?
jaromanda is offline   Reply With Quote
Old 28th December 2010, 23:38   #29
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
Yeah, that one you can feel it in my old pc as it parses. looks great.

btw...

No pink boxes in vp62, and subt handled. Auxa is ready for further dev, but find a stream that contains it for me...

They also spam the title as a subtitle every 2 seconds or so.
Smelter is offline   Reply With Quote
Old 30th December 2010, 07:28   #30
Smelter
Major Dude
 
Smelter's Avatar
 
Join Date: Jan 2004
Posts: 1,141
ice cast wins...

Serving the swf with its built in web server , I can use url stream and not need any crossdomain policy file at all.
Smelter is offline   Reply With Quote
Old 9th January 2011, 11:19   #31
oLRi
Member
 
Join Date: May 2008
Posts: 94
And whats the url of the svn...?
oLRi is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast TV / Nullsoft Video

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump