{"id":2139,"date":"2011-08-15T13:23:03","date_gmt":"2011-08-15T09:23:03","guid":{"rendered":"http:\/\/blog.denivip.ru\/?p=2139"},"modified":"2013-08-05T14:11:40","modified_gmt":"2013-08-05T10:11:40","slug":"flash-access-live-video-protection","status":"publish","type":"post","link":"http:\/\/blog.denivip.ru\/index.php\/2011\/08\/flash-access-live-video-protection\/?lang=en","title":{"rendered":"Flash Access: Live Video Protection"},"content":{"rendered":"<p style=\"text-align: center;\"><a href=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/livestream.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2113        aligncenter\" title=\"live stream\" src=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/livestream.jpg\" alt=\"live stream\" width=\"320\" height=\"240\" srcset=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/livestream.jpg 320w, http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/livestream-300x225.jpg 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">\n<p style=\"text-align: left;\">As live streaming is gaining popularity, the necessity to protect the content from illegal copying and unauthorized use is also growing. In this post, we will describe how you can implement content protection based on Adobe Flash Media Server and Adobe Flash Access to further optimize your live streaming. <!--more--><br \/>\nTo set up the configuration, you\u2019ll need to install and configure Flash Media Server and Flash Access 2.0. For online content encryption FMS has a built-in component called Live Packager. Here we will consider it in more detail. It is noteworthy that currently the only reliable technology to protect live video is the combination of HTTP Dynamic Streaming + DRM (RTMPE much less reliable). When you use HTTP DS to deliver live video, the data is delivered in short segments that can be encrypted using the standard VOD approach.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/scheme777.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2050 aligncenter\" title=\"scheme777\" src=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/scheme777-300x194.png\" alt=\"\" width=\"300\" height=\"194\" srcset=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/scheme777-300x194.png 300w, http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/scheme777.png 831w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>To store your live stream files, you can use NFS\/CIFS based data storage.<\/p>\n<p>To set the rules applied to your live stream passed to FMS, you can use the Event.xml configuration file. By default, it is located in the following directory:<br \/>\n<i>applications\/livepkgr\/events\/_definst_\/liveevent\/<\/i><br \/>\nEvent.xml is drafted below (to use it, you\u2019ll need a properly running Flash Access server)<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:540px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/><\/div><\/td><td><div class=\"text codecolorer\">&amp;lt;Event&amp;gt;<br \/>\n&amp;lt;EventID&amp;gt;liveevent&amp;lt;\/EventID&amp;gt; # Define the name of your live-event stream <br \/>\n&amp;lt;Recording&amp;gt;<br \/>\n# Set the live streams and define duration of fragments and<br \/>\n# segments<br \/>\n&amp;lt;FragmentDuration&amp;gt;1000&amp;lt;\/FragmentDuration&amp;gt;<br \/>\n&amp;lt;SegmentDuration&amp;gt;10000&amp;lt;\/SegmentDuration&amp;gt;<br \/>\n&amp;lt;ContentProtection enabled=&quot;true&quot;&amp;gt; &nbsp;#Enable FA 2.0 encryption <br \/>\n&amp;lt;ProtectionScheme&amp;gt;FlashAccessV2&amp;lt;\/ProtectionScheme&amp;gt;<br \/>\n&amp;lt;FlashAccessV2&amp;gt;<br \/>\n&amp;lt;ContentID&amp;gt;livestream1&amp;lt;\/ContentID&amp;gt; #Define the live stream &nbsp;name <br \/>\n&amp;lt;CommonKeyFile&amp;gt;common-key.bin&amp;lt;\/CommonKeyFile&amp;gt;<br \/>\n&amp;lt;LicenseServerURL&amp;gt;http:\/\/{IP}\/flashaccessserver\/prod&amp;lt;\/LicenseServerURL&amp;gt;<br \/>\n&amp;lt;TransportCertFile&amp;gt;denivip-ru-t.der&amp;lt;\/TransportCertFile&amp;gt;<br \/>\n&amp;lt;LicenseServerCertFile&amp;gt;denivip-ru-ls.der&amp;lt;\/LicenseServerCertFile&amp;gt;<br \/>\n&amp;lt;PackagerCredentialFile&amp;gt;denivip-ru-p.pfx&amp;lt;\/PackagerCredentialFile&amp;gt;<br \/>\n&amp;lt;PackagerCredentialPassword&amp;gt;*****&amp;lt;\/PackagerCredentialPassword&amp;gt;<br \/>\n&amp;lt;PolicyFile&amp;gt;ad-policy.pol&amp;lt;\/PolicyFile&amp;gt;<br \/>\n&amp;lt;\/FlashAccessV2&amp;gt;<br \/>\n&amp;lt;\/ContentProtection&amp;gt;<br \/>\n&amp;lt;\/Recording&amp;gt;<br \/>\n&amp;lt;\/Event&amp;gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Having configured the Event, you\u2019ll need to define live streams in Manifest.xml. This is a configuration file used to generate f4m for the video player.<\/p>\n<p>In this file, let\u2019s define a single output stream called livestream1:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:540px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/><\/div><\/td><td><div class=\"text codecolorer\">&amp;lt;manifest xmlns=&quot;http:\/\/ns.adobe.com\/f4m\/1.0&quot;&amp;gt;<br \/>\n&amp;lt;media streamId=&quot;livestream1&quot; bitrate=&quot;1000&quot; \/&amp;gt;<br \/>\n&amp;lt;\/manifest&amp;gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>After reconfiguring is complete, you&#8217;ll need to restart the server.<\/p>\n<p>To broadcast your streams to the FMS server, let\u2019s use Adobe Flash Media Live Encoder 3.2. To generate streams, the video capture card will be used. Please note that to deliver video to iOS devices (iPad iPhone\/iPod), you\u2019ll need AAC codec for audio encoding. On MacOS, FMLE natively supports AAC without any plugin needed. However, under Windows you\u2019ll need to additionally buy an AAC plugin.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-12-\u0432-13.09.251.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2058    aligncenter\" title=\"\u0421\u043d\u0438\u043c\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u0430 2011-07-12 \u0432 13.09.25\" src=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-12-\u0432-13.09.251-300x220.png\" alt=\"\" width=\"300\" height=\"220\" srcset=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-12-\u0432-13.09.251-300x220.png 300w, http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-12-\u0432-13.09.251.png 1022w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>As FMS URL, specify <i>rtmp:\/\/fms.denivip.ru\/livepkgr<\/i>. In Stream options, enter <i>livestream%i?adbe-live-event=liveevent&#038;adbe-http-streaming-ver=1.0<\/i>. Also, in Video options, specify the video stream bitrate you have set in the Manifest.xml file. To activate DVR, enable the &#171;DVR Auto Record&#187; option.<br \/>\nNow click the Start button to publish your stream to the FMS server. As a result, a file similar to <i>MTYxMjAzMzAzMg=.stream<\/i> will appear in the  <i>applications\/livepkgr\/events\/_definst_\/liveevent\/<\/i> directory.<br \/>\nIt should be noted that to organize streaming you\u2019ll need servers of a sufficient capacity. Here are the recommendations for your Flash Media Server and Live Encoder.<\/p>\n<p><strong>FMS<\/strong><\/p>\n<ul>\n<li>Quad Core 2.4 GHz x 2<\/li>\n<li>&gt;8Gb of RAM<\/li>\n<li>SAS\/SSD 200Gb (RAID is optional)<\/li>\n<\/ul>\n<p><strong> <\/strong><\/p>\n<p>In this configuration, FMS server can receive and encrypt live streams at the rate of up to 50-70 Mbps (depending on the number of streams and their bit rate).<\/p>\n<p><strong>Live Encoder<\/strong><\/p>\n<ul>\n<li> Quad Core 2.4Ghz<\/li>\n<li>&gt;4Gb of RAM<\/li>\n<\/ul>\n<p>In this configuration, Live Encoder can broadcast three stable video streams of 10 Mbps. Often this is quite sufficient.<\/p>\n<p>To deliver video segments, Apache2 Web server with f4fmodule installed is needed. You can find details of its settings in our previous posts. Optionally, you can use NGINX as a caching server (this is especially true if your streams support DVR).<\/p>\n<p>For live stream playback, an open source Strobe Media Playback solution can be used (here is the project home page <a href=\"http:\/\/osmf.org\/strobe_mediaplayback.html\">http:\/\/osmf.org\/strobe_mediaplayback.html<\/a>).<\/p>\n<p>Now copy the source files of your player must to the server HTTP access directory. After that, open the player setup.html page.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-29-\u0432-18.02.111.png\"><br \/>\n<\/a><a href=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-29-\u0432-18.02.112.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-2127\" title=\"\u0421\u043d\u0438\u043c\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u0430 2011-07-29 \u0432 18.02.11\" src=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-29-\u0432-18.02.112-1024x428.png\" alt=\"\" width=\"491\" height=\"205\" srcset=\"http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-29-\u0432-18.02.112-1024x428.png 1024w, http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-29-\u0432-18.02.112-300x125.png 300w, http:\/\/blog.denivip.ru\/wp-content\/uploads\/2011\/08\/\u0421\u043d\u0438\u043c\u043e\u043a-\u044d\u043a\u0440\u0430\u043d\u0430-2011-07-29-\u0432-18.02.112.png 1413w\" sizes=\"(max-width: 491px) 100vw, 491px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As live streaming is gaining popularity, the necessity to protect the content from illegal copying and unauthorized use is also growing. In this post, we will describe how you can implement content protection based on Adobe Flash Media Server and Adobe Flash Access to further optimize your live streaming.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,12],"tags":[66,271,85,358,379,97],"_links":{"self":[{"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/posts\/2139"}],"collection":[{"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/comments?post=2139"}],"version-history":[{"count":14,"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/posts\/2139\/revisions"}],"predecessor-version":[{"id":2157,"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/posts\/2139\/revisions\/2157"}],"wp:attachment":[{"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/media?parent=2139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/categories?post=2139"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.denivip.ru\/index.php\/wp-json\/wp\/v2\/tags?post=2139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}