Memaparkan catatan dengan label wowza. Papar semua catatan
Memaparkan catatan dengan label wowza. Papar semua catatan

Khamis, 23 September 2010

Flex RIA

I'm reading these 2 books at the moment,
  • Sabex - Professional Flash Video ( AS2,AS2 )
  • O'Reilly Essential Action Script 3.0
My requirements is to develop a stream publisher with these capabilities

- RTMP auth
- Camera selector
- Publish / Unpublish stream

Rabu, 22 September 2010

Flash Streamer to Wowza Server


Imagine you create your own streamer using Action Script 3. After few hours of learning and testing AS2 and 3 now I'm able to publish live event from my webcam to Wowza Flash Server.


Selasa, 7 September 2010

Wowza Recording :: Managing files

Wowza records the stream and put it into $lib/content directory. With no database connection though. So I wrote a simple file manupulation class ( thanks CakePHP File Utils ), and user can view thier own recorded video streamed using rtmp :D

Isnin, 6 September 2010

Beta Test : Stream Your Life

Register with Stream Your Life Portal

Read the Settings information, and download the necessary software


Adobe FMLE Encoder asking for Username/Password ( the one you register at the portal )

Realtime Statistics

Now you can see your streaming on the website.




The Technology
Streaming Service is a the new phenomenon nowdays. Youtube for example offering free Video On Demand Streaming based on user submitted contents using Flash technology. Now the streaming players have evolved to Live Streaming service. Realtime Streaming is possible using RTMP protocol used by Adobe Flash Media Server, Red5 and Wowza Streaming Server. So for this project the goal are :
  • User can self register to the portal
  • User download Adobe Media Live Encoder
  • User connecting to the portal from encoder by providing Username & Password
  • User start streaming and can share the stream to anyone
  • Every registered user will be given 1 stream name
  • Stream is viewable by PC, Mobile Phone using Flash Technology
  • Statistics for every stream

The Challenge For Integration
 Wowza is Java based and the API is in Java. The portal is written using CakePHP framework which is powered by PHP and the database is provided by MySQL.

A barebone Wowza doesn't have much protection
- everybody can publish to Wowza without authentication
- hotlinking from origin server ( imagine somebody stole your stream and put into their website )
- no MySQL based logs for every stream
- no limit on which encoder can publish to the server ( FMLE,Wirecast, Custom AS3 )

The most important thing is, how do I integrate my CakePHP User with Wowza and each user can only stream according to thier username only ( limit 1 stream per registered user )

After days of strolling the net ( especially in wowza media forums ), all the requirements above have been fulfilled even without proper Java knowledge :D

Skillsets Needed
To polish the system to enterprise level, I'll need the workhorses with these knowledges :
  •  Java Programming ( wowza modules development )
  •  Video/ Audio Format
  •  Wowza/ Flash Media Server
  •  Streaming Technology
  •  Mobile Phone Developer ( J2ME,Cocoa,Blackberry )
  •  Linux System Administration
  •  Web Development ( CakePHP,Ruby On Rails, Gearman, Ajax, Jquery )
  •  Flash Developer ( Action Script )
  •  MySQL Database logging / Shell Scripting
  •  Scalabity / HA / Load Balancing 

Target Clients & Possible Applications
  • Organization who want to do live streaming
  • Weddings Live Stream
  • Online TV Stations
Similar Competitors ( International )
  • Ustream
  • Flix
  • JustinTV
  • LiveStation
  • Qik

Possible Revenues
  • Advertisement by user channels
  • Advertisement preload before stream play
  • Premium stream plan ( recording, higher bitrate, HD, privacy options, more channels, statistics )
Impact To Society
  • There's no local free streaming in Malaysia. This streaming will cater user's in Malaysia and since it's located withing the country, faster streaming experience can be achieved
  • Streaming made easy with user friendly software and can be viewed using regular browser. No need special software to view the stream
  • No need to publish stream to foreign country as the same service can be done locally
Summary
The hard part ( integrations to portal, statistics, logging ,ACL permission ) have been done. Basically the framework is ready to cater more personalisation based on client's need. This technology potential is limitless. You can target both PC and Mobile user from single application.

Live demo : http://202.190.99.75

Azril Nazli Alias
Putrajaya

Sabtu, 4 September 2010

iStream.My Features

After weeks of playing WowZa, the goal of making my own user generated stream site is getting closer. So lets define what the site basic features :

1. Multiple user groups via ACL ( super, admin, user, suspended )
2. Integration with Wowza RTMP Authentication engine based on their username/password
3. Limit user's stream number/name/bitrate
4. Prevent hotlinking by only allow my server's IP in Domain Lock setting ( not embedable )
5. Statistics for each stream, number of viewers, list of active stream

Wowza RTMP Authentication and CakePHP

Adobe FMLE 3.1 asking Username/Password to Publish

URL : http://www.wowzamedia.com/forums/showthread.php?t=1281

I want to protect my stream to only authorized user ( registered users ). In order to do that, I'm using Wowza Media Security Module. After following the guide in PDF, my Adobe FMLE finally asking for username / password. The module is using plain text file to store the username/password pair and I'm intending to sync it with my CakePHP Users database. The plan will be

1. Write a wrapper class to manage users in wowza text file
2. User CakePHP callback function in Users Controller so when user registered with the system, it will sync with the flat file, so does when the user update or de-register from the site.

Rails 3 and Ruby 1.9 on Windows

Ruby on Rails 3

I'm PHP guy and i use CakePHP extensively in every project. I'm totally in love with CakePHP. But to extends my knowledge , I need to treat Ruby On Rails as my 2nd wife. Still in love hate relationship. Since Rails 3 just being release, I have new pet project now. I want to develop a mini streaming service using RoR and Wowza. The end product should enable registered users these features :
- live streaming path
- statistics for every stream
- embed code for for live streaming player
- index page listing current live streaming

RoR 3 Tutorial : http://railstutorial.org/chapters/beginning

Ahad, 22 Ogos 2010

Live Streaming & On Demand Video

Add caption
Wowza Server Console
HD quality streaming over RTMP using Flowplayer
CakePHP, WowZa VOD Demo


Web 2.0 kini semakin canggih. Sudah berlalu zaman di mana melayari internet untuk membaca text dan melihat gambar. Melihat video melalui internet kini telah menjadi satu kebiasaan. Untuk itu, saya sedang melakukan research berkaitan :

1. Teknologi yang boleh stream Live Video melalui Webcam / HD Camera
2. Menggunakan Encoder percuma seperti Adobe FMLE 2.5 / 3.0
3. Media dalam bentuk FLV / MP4 dalam format H.264
4. Boleh dilihat menggunakan Browser dan Iphone/BB/ Mobile

Pada mulanya saya memilih Adobe Flash Media Server, tetapi setelah mencuba Wowza Flash Media Server versi 2.0, saya mungkin memilih solution dari Wowza untuk solution tetap.


Ciri-ciri Wowza yang saya suka
- Anti Hotlink
- Direct MySQL Logging
- h.264, mp4,f4v,mp3
- Allow Domain ( eg, only viewable at http://azrilnazli.com )
- supports live and vod

Seharian saya setup Wowza dalam Linux CentOS dan Windows 2003 Server dan namapknya kedua-keduanya berjalan dengan lancar kecuali server saya cuma mempunyai 1 CPU sahaja ( Wowza memerlukan 4 CPU )

Ujian yang saya jalankan
1. Stream dari webcam laptop over wifi ke server di IDC @ 200kbps ~ PASSED
2. HD Video On Demand Streaming guna format RTMP/MP4 ~ PASSED
3. MySQL Database log untuk usage ~ PASSED
4. CDN integration untuk VOD/LIVE RTMP ~ PASSED
5. Wirecasting ( VOD / Live Switch ) ~ PASSED

Statistik
Disebabkan sudah ada module untuk rekod log ke dalam MySQL database, membina statistik menjadi lebih mudah. Jadi saya boleh keluarkan data seperti berikut
- TOP 10 Video On Demand
- Volume used for VOD/LIVE
- Number of users
- Total volume served
Dengan menggunakan framework CakePHP dan digabungkan dengan FusionFreeCharts, saya boleh membina antara muka interaktif untuk paparkan kegunaan video secara live.

Auto Encoding on Upload
Membina transcoding engine adalah satu tugas yang sukar, bayangkan anda membuat sistem yang boleh menerima audio/video dari pengguna dan perlu proses setiap video yang diupload ke mp4 atau flv sebelum dipaparkan ke browser. FFMPEG adalah utility yang anda perlu kuasai dan juga GEARMAN
- FFMPEG ( transcoder )
- GEARMAN ( queue engine )
- SWFUPLOAD ( flash uploader dari browser )
- CAKEPHP

Anda mungkin boleh membina Youtube versi sendiri jika menguasai semua ilmu di atas.

Kos yang mungkin terlibat
1. RM3000  untuk Wowza 1 time license
2. RM3000  untuk Wirecast
3. RM7000 4U rack + 2mb dedicated @ IDC untuk setahun
4. RM15,000 1 X 1U 4 CPU 16 GB RAM server
7. RMXXX CDN subscription untuk local deliovery dan international delivery


Boleh tahan mahal untuk running media business :D

Ahad, 8 Ogos 2010

Axis 2100 Ip Camera MJPEG stream to Wowza Server

So I have an Axis 2100 IP Camera running on the network and these are the specs :

1. 15 FPS max
2. JPG or MJPEG format
3. Direct URL will be http://10.0.0.5/cgi-bin/video640x480.mjpg

Planned Stream
1. Will be published to Wowza server using RTMP format, rtmp://x.x.x.x/live/axis.sdp
2. Will be published in FLV format
3. FFMPEG will transcode the input format in MJPEG and output in FLV

FFMPEG
1. Using Ubuntu Server Operating system
2. Network for OS will be same segment with Axis camera ( 10.0.0.X )
3. Compile FFMPEG with RTMP support
  1. 3.1 sudo apt-get install libssl-dev
  2. 3.2 svn co svn://svn.mplayerhq.hu/rtmpdump/trunk rtmpdump 
  3. 3.3 Configure;Make,Make Install rtmpdump then ldconfig
  4. 3.4. Download and compile latest FFMPEG with these options,  ./configure --enable-gpl --enable-shared --enable-librtmp
4. Now, transcode using this command
ffmpeg -f mjpeg -i http://10.0.0.5/cgi-bin/video320x240.mjpg -an   -vcodec flv   -b 100k -r 15 -f flv rtmp://x.x.x.x/live/axis.sdp

5. Grab back the video using your favorite player eg Flowplayer.

Screenshots

Flowplayer RTMP streaming from Wowza Server
FFMPEG transcoding result
MJPEG from Axis Camera Web Server

Jumaat, 6 Ogos 2010

Live Streaming menggunakan Wowza Media Server Centos


Alkisahnya, saya tengah research mengenai Wowza Media Server. Alternatif kepada Adobe Flash Media Server dan Microsoft Silverslight.

Saya mempunyai task di mana client ingin beralih dari Microsoft Media Server ke Flash. Keperluan client adalah seperti berikut :

1. HD quality streaming
2. End format in FLV
3. Smooth Streaming Technology
4. Adove Media Encoder compability mode
5. Variable streaming rate, bergantung kepada speed broadband user

Saya menggunakan VMWARE ESX virtual machine yang menggunakan CentOS 5.1 sebagai OS utama. Wowza memerlukan Java versi seperti di bawah :

[root@wowza azril]# java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.6) (rhel-1.11.b16.el5-i386)
OpenJDK Server VM (build 14.0-b16, mixed mode)

Download Wowza versi developer dalam bentuk RPM executables dan install. Kemudian isi no serial untuk developer ( percuma )

Pastikan port 1935 dan 8086 dibuka, dan run startup.sh yang terletak di dalam path /usr/local/WowzaMediaServer/bin

Wowza berjaya run
Sekarang saya akan cuba setting server untuk menerima Live Feed dari HD Webcam yang dipasang di dalam Laptop. Saya mengikuti tuorial yang dibekalkan oleh WowZa, http://www.wowzamedia.com/quickstart_2_1_2.html#live-rtmp.

Adobe Flash Media Live Encoder
 Menggunakan Feed dari Webcam laptop, saya download program Adobe Flash Media Live Encoder dan mula masukkan setting seperti berikut
URL : rtmp://x.x.x.x/live
STREAM: wowza.sdp

Kemudian saya melihat log
Log dari startup.sh
Nampaknya WowzaMediaServer berjaya menerima video feed dari Adobe FLME. Seterusnya saya ingin melihat feed menggunakan 2 player
1. Adobe Flash Media Player
2. Flowplayer dengan plugin RTMP

Streaming Live dari Mozilla Firefox menggunakan player dari Adobe Flash
Streaming Live menggunakan FLowplayer RTMP Plugin
Nampaknya, misi berjaya. Sebelum ini saya ada pengalaman menggunakan Microsoft Media Server dan Adobe Media Server.

Business Model  yang boleh dibuat dengan servis ini
===================================
1. Live streaming guna Web TV ala Youtube guna Flash. User tak perlu special player, memadai ada Flash
2. Harga berdasarkan  jumlah maksimum Concurrent Users
3  Harga berdasarkan jumlah User yang boleh Akses
4. Harga berdasarkan kualiti stream ( 50kbps - 1.5mb )
5. Sokongan CDN seperti Akamai, Jaring Speed CDN dan sebagainya
6. Anda boleh cipta sendiri plan-plan tersebut
7. Harga berdasarkan jumlah live channel

Flow Untuk Business ( self streaming user )
===================================
Sinopsis : Business ini akan menganggap user mempunyai pengalaman sendiri . Target user ini ialah wartawan yang menggunakan internet, stesen TV/Radio, blogger profesional., event management, kolej yang menawarkan course jarak jauh.


1. User akan subscribe dengan salah satu plan anda
2. User akan diberi trial akaun dan boleh login ke Control Panel
3. User boleh create sendiri live channel mereka, eg http://x.x.x.x/user/live/channelname
4. User publish stream ke channel menggunakan Adobe FLME
5. Dalam control panel akan menunjukkan stream mereka beserta HTML embed code
6. Dalam control panel akan ada statistik penggunaan update setiap 1 jam

Flow Untuk Business ( corporate client )
===================================
Sinopsis: Client yang tiada equipment dan harapkan kita sediakan semua sekali dari A-Z
Peralatan wajib
1. Camera HD, Video Camera Digital
2. Channel Switcher seperti Wirecast
3. PC based encoder yang power ( 12GB ram, highend graphics card )
4. Internet connection yang stabil, mampu hantar video feed pada kelajuan 1mbps
5. Penyediaan website untuk paparkan feed.

Peralatan untuk Server ( minimum )
===================================
1. CPU: Single Dual Core, 3.00 GHz or better
2. RAM: 2GB
3. Disk: 2 or more in RAID 0 (striping)
4. Network: 1Gb Ethernet

OS yang disokong :
1. Windows (XP, Vista, 7, Server 2003 & 2008)
2. Linux (all distributions)
3. Solaris
4. Mac OS
5. Unix

Content Delivery Network ( ini sepatutnya ada sebab untuk kurangkan kos bandwidth video feed )

Skillsets yang diperlukan untuk System Admin
================================
1. Linux basic OS maintenance
2. Network troubleshooting
3. Wowza Server Administration
4. Zabbix Realtime Monitoring

Skillsets yang diperlukan untuk Web App Developer
=====================================
1. Log file manipulations ( apache style )
2. Wowza Configuration management ( XML )
3. Statistics Generation via Flash ( Fusion Chart Free )
4. Any RAD Frameworks
5. Paypal integration

How to Market this business ?
=====================================
1. Live streaming importance
2. Cost saving in longer run
3. Subscription based
4. Technical Supports for SLA
5. CDN as value added service

 Issues dan masalah yang mendatang
=====================================
1. HTML Hotlinking ( kena prevent user dari embed HTML streaming code )
2. SWF Theft ( kena prevent SWF Player dari kena hotlinking ( boleh guna cara PHP gateway technique )
3. Limit siapa yang boleh publish ker server dan limit jenis encoder

Update 07 August 2010
===================
Saya berjaya buat testing untuk prevent Hotlinking menggunakan panduan dari ( http://www.wowzamedia.com/forums/showthread.php?t=5239 )

Untuk Package, saya menggunakan pre compiled edition dari, http://www.wowzamedia.com/forums/showthread.php?t=6565

Sample configuration
Contoh konfigurasi application/live/Application.xml
Contoh log file menunukkan module HotlinkDenial