Knowledgebase : Video Encoding & Playback
   

4K video (4096 px wide by 2160 px high) is the cutting edge video format to offer your customers. You could use this as your transcoder source but as you've probably noticed the file size is quite huge and would take a very long time(4-8 times as long per format) for the set to be created using the transcoder. Our suggestion for now is to upload the 4K file as a downloadable format(You can create a new media type that is not embedded so the system can link to it) and for you to create a 1080p @ > 8000K bitrate MP4 version that you use as your transcoder source as you normally would when uploading a new set into the 'source' folder.

Currently there is little support to stream a 4K video file because of the incredible bandwidth requirements. Eventually web browsers will support playback of the 4K streams when the adoption of the H265 codec is implemented for playback in web video players. Until then your members will need to download and playback the file on whatever medium/player has support for it(VLC player, DIVx Player, Media Player Classic)

Let us know if you have any other specific questions regarding 4K video and support for it.

Step 1) Click Utilities and then Media Types

Step 2) Create a new media type for the new format you plan to offer. Use existing media types as reference.

Step 3) Click Plug-Ins and then "Edit" for the Video Transcoder.

Step 4) Add a new entry and specify the settings for your new encoding output format. You may specify the encoder source, ourput media type, audio and video bitrates and codecs and number of clips or clip length. Use existing transcoding formats as reference.

Once this has been done, the new encoding type will show as a checkbox on the Add/Edit Set and batch utilities pages.

Allow Multiple Encoding Processes at Once

To allow multiple encodes to run at the same time have your host edit your existing crontab entry and change it to the following.

NOTE - Be sure to change "/path/to/php" to the actual path to php and change ADMINPATH to the actual path to your cms_admin directory.

*/5 * * * * /path/to/php /ADMINPATH/cms_admin/longqueue.php --thread=1
*/5 * * * * /path/to/php /ADMINPATH/cms_admin/longqueue.php --thread=2
*/5 * * * * /path/to/php /ADMINPATH/cms_admin/longqueue.php --thread=3
*/5 * * * * /path/to/php /ADMINPATH/cms_admin/longqueue.php --thread=4

For performance we do not suggest adding more entries than the  number of of processor cores on their server, or else CPU will be maxed out. For example on a quad core server you would want no more than 4 processes.

NOTE - If you're going to be encoding using multiple servers, you'll need to make sure the --thread parameter is different across all machines:

# Server 1

*/5 * * * * /path/to/php /ADMINPATH/cms_admin/longqueue.php --thread=1
*/5 * * * * /path/to/php /ADMINPATH/cms_admin/longqueue.php --thread=2

 

# Server 2

*/5 * * * * /path/to/php /ADMINPATH/cms_admin/longqueue.php --thread=3
*/5 * * * * /path/to/php /ADMINPATH/cms_admin/longqueue.php --thread=4

 

Change Video Transcoding Settings

NOTE - For Transcoding setting changes take effect you must re-encode your videos. The system will not automatically re-encode them when settings are changed. You may re-encode a set by editing that set, checking approproate boxes and selecting Overwrite Existing FIles from the Overwrite dropdown on the set add/edit page. This may also be done for multiple sets under Utilities, Batch Operations.

*Please be careful when editing transcoder types as there is no "undo" operation. The only option we have is to reset your transcoder settings back to factory default.

Step 1) Click Plug-Ins and then click Manage for Video Transcoder.

Here you will see a list of all encoding formats currently setup on your system. Clicking edit will load a page containing fields for the encoding settings. Options include video source, destination, width and height to resize to, bitrate, buffer size, codecs and settings for specifying how to cut the video.

NOTE - Destinations are Media Types specified under Utilities, Media Types.

The Split By dropdown lets you choose whether to split the source video into parts or split it by length.

Entering number of clips and specifying a number in the Split By Number field will result in the video being cut into that many parts. For erxample if you enter 5 in that field, the video will be cut into 5 clips.

Selecting by Length and entering a number of minutes or seconds below will result in the video being cut into clips of equal length.

Default and Suggested Settings:

Video quality is subjective. What one user finds to be good quality, another may not. For this reason we suggest that you try different settings and test the encoder until you find a file size, quality level and playback speed you are happy with.

The system defaults to a video bitrate of 1500kb with no Max Rate or Max Buffer. It is suggested that the Max rates be set to no more than 1/4-1/3 higher than the Bitrate, for example if a video has a Bitrate of 1500, the Max Rate fields can be set to 2000.

Audio is typically set to 44100 for all formats.

Source Formats:

There is no suggested source format. The source chosen will depend on a few factors. If you want high quality output video and disk space/storage is no concern to you, raw AVI files may be used as video source. Many users feel that MPG or even a HD or High Bitrate/High Res WMV or Quicktime file works well and provides high quality output while reducing file sizes to cut down on storage requirements.

Some users upload source video encoded at 5000k and others upload 2000k or lower. There is no concrete answer on what works best as each user's opinion differs based on individual preference but generally source video of at least 640 or 720 in size with a Bitrate of 2500k seems to deliver an acceptable output quality for nearly 90% of our users.

You may use ANY source that the ffmpeg server module supports. We do not supply the module so our ability to provide support in relation to video is limited.

Note - At this time ffmpeg 1.2.X DOES NOT support videos encoded using WIndows Media Pro.

Destination Formats:

A variety of formats are supported, however for most users only a few are needed. These include the most commonly used such as Flash, AVI, MPG, WMV, Quicktime and MP4 for mobile devices.

 

 

Codecs for Common Encoding Formats

DivX
------------------
Media Type File Extension: .avi
Video Codec: mpeg4
Audio Codec: none
Additional Flags: -vtag divx


Flash
------------------
Media Type File Extension: .flv
Video Codec: flv
Audio Codec: libmp3lame
Audio Bitrate: 44100


H.264
------------------
Media Type File Extension: .mp4
Video Codec: libx264
Audio Codec: libfaac

Extra Requirements: qt-faststart

Under Plugins -> Video Transcoder -> Configure, make sure:

a) Enable qt-faststart is set to Yes.

b)  Your host has qt-faststart installed and that the qt-faststart path is set correctly on this page.


Ipod (MP4)
------------------
Prerequisites: Make sure your host has the libfaac codec compiled in.

Media Type File Extension: .mp4
Video Codec: mpeg4
Audio Codec: libfaac
Additional Flags: -f mp4 -qmin 3 -qmax 5 -g 300 -ab 128k -r 30000/1001 


Mobile (3GP)
------------------

Media Type File Extension: .3gp
Video Codec: h263, mpeg4 or libx264
Audio Codec: libfaac or aac


MPEG
------------------
Media Type File Extension: .mpg
Video Codec: mpeg1video
Audio Codec: mp2
Audio Bitrate: 44100


QUICKTIME
------------------
Media Type File Extension: .mov (Use .mov instead of .mp4 - or an incorrect container may be used due to the output filename)
Video Codec: mpeg4
Audio Codec: libfaac


WMV
------------------
Media Type File Extension: .wmv
Video Codec: wmv2
Audio Codec: wma2

If your crontab is stalled on the server your host will need to correct this. Please have them check to see if the crontab is installed to run every 5 mins. If it is, please have them run the cron command under the user the cron is set to use, via command line and read the output. If there is a problem, the output will tell your host how to correct it.

WARNING - If your host runs the cron via ROOT or any other user, the cron will lock until it is cleared. An error message will appear in your error log accessibel on the admin panel front page.

The cron command line should look something like this(with the correct server path to your domain):

*/5 * * * * /usr/local/bin/php /home/username/public_html/<path_to_domain>/cms_admin/longqueue.php

You can enable or disable autoplay in the template fields plugin.

Go to your CMS admin panel and navigate to Plugins >> Template Fields.

Select the location you wish to edit "Members"

Scroll down to "Flash Player Settings" and locate the "flashvarsgalleryautoplay" entry and click "edit".
1 - yes the video will auto-play
0 - no the video will NOT auto-play.

Click "save entry" to save your changes.

If you have a new source file type that is not currently in the setup that you wan to use as a source for creating new file formats, this guide will help you create a new soyrce entry so the system knows to look for your new file type as a source for the video transcoder. In this example we're going to create a source entry media type for .mpg so the system knows to look for .mpg files as a possible source for the transcoder.

1) Go to "Media Types" and create a new entry that uses the existing 'source mp4' entry as a basis by using the "import settings" drop down.

2) Edit the setting to your needs. in this case change the '#basename#.mp4' to '#basename#.mpg' and then chnage the "Source MP4" to read "Source MPG"

3) Go to "Video Transcoder" settings 'manage' tab in your plugins area. Use the check box "Select all" formats and then deselect the "combined streaming" option check box(as we do not want to change the settings of this item)

4) With the items selected from step 3, scrolling down to the "Bulk Edit Encoding Settings" and select "Update Sources". You should see a drop down that lists sources for the items that are selected. We want to select all the options that start with '/source/#.'. (You should see the new option you created listed there if you followed step 1) After you select all the source files you want to use, move them to the right hand pane by clicking the add button. When you have all the options you want to use as sources in the right hand "include" pane, then scroll down and click "Save Entry". The system will ask you if you are sure. Click "OK".

That's it. Your options will use the new sources to create all files. If you run into trouble please open a support ticket and let us know you need help.

Follow us on Twitter @elevatedx for product related news and feature updates!
-----------------------------------------------------
DO NOT REPLY TO THIS EMAIL
To reply, visit http://support.elevatedx.com. Replies via email are NOT entered into our ticket system.

Elevated X Technical Support
http://support.elevatedx.com

-----------------------------------------------------
For security please change the FTP and CMS admin passwords you provided as soon as your ticket is resolved.

How to arrange your content on the server when using the Video Suite to encode video:

The CMS system looks in your members area for a specific folder to find content for your site:

example:     /members/content/upload/

Each set of content you add into the system needs to be contained in a folder called a "set folder". The set folder holds your content and allows you to arrange it into subfolders so the system can read and process your content. (Do not to use odd symbols such as '!,@#$%^&*():;""?><[]\{}| in the file naming of set folders or files. Use _ in place of spaces and keep naming  to A-Z,a-z,0-9). Set this folders permissions to CHMOD 777 after creating/uploading it to your server using your FTP clients' "permissions" or "properties" function, usually located by clicking on the folder and then right clicking.

example:     /members/content/upload/test_content/

TIP:  We always sugest naming your set folder with unique names that help you identify the content on the server. This makes it very handy when you are trying to locate a specific scene on the FTP server. Always include some sort of identifiying date, internal set number, or the names of the talent involved. A good organized site can identify a set of content on the server just by reading the set folder name. Also, do not to use spaces when naming set folders, instead use underscores '_'.

Inside each set folder you should upload your photos(in jpg format) to a subfolder named "photos".
(Do not to use odd symbols such as '!,@#$%^&*():;""?><[]\{}| in the file naming of files or files. Use _ in place of spaces and keep naming  to A-Z,a-z,0-9). Set this folders permissions to CHMOD 777 after creating/uploading it to your server using your FTP clients' "permissions" or "properties" function, usually located by clicking on the folder and then right-click(video or photo source files))

example:     /members/content/upload/test_content/photos/

Inside each set folder you should upload your video source file movies(preferably in MP4 format) to a subfolder named either "source"

example:     /members/content/upload/test_content/source/filename.mp4

If your source format is in any other format besides .flv|.mp4|.mov|.wmv|.avi  please let us know and we can adjust the system settings so you can use these source files as a source.

Set the 'source' folder permissions to CHMOD 777 after creating/uploading it to your server using your FTP clients "permissions" or "properties" function, usually located by clicking on the folder and then right clicking.

All set folders and subfolders need to be set to CHMOD 777

Once you have uploaded your content and set the file permissions to chmod 777, you are ready to add the set of content into the CMS. Your server will process the video files on the server in the background into various sizes and formats you choose. It will take between 20 mins and 4 hours to process each line/format. Please be patient while the server works for you.

If you have any questions or trouble please open a trouble ticket via the support website.

How to arrange your content on the server when using the Video Suite to encode video for ELXComplete:

The CMS system looks in your VOD/Members area for a specific folder to find content for your site:

example: /access/content/upload/

Each set of content you add into the system needs to be contained in a folder called a "set folder". The set folder holds your content and allows you to arrange it into subfolders so the system can read and process your content. (Do not to use odd symbols such as '!,@#$%^&*():;""?><[]\{}| in the file naming of set folders or files. Use _ in place of spaces and keep naming to A-Z,a-z,0-9). Set this folders permissions to CHMOD 777 after creating/uploading it to your server using your FTP clients' "permissions" or "properties" function, usually located by clicking on the folder and then right clicking. Each set folder must be uniquely named. We suggest using names that make identification easy when looking on the server.

example: /access/content/upload/test_content/

TIP: We always sugest naming your set folder with unique names that help you identify the content on the server. This makes it very handy when you are trying to locate a specific scene on the FTP server. Always include some sort of identifiying date, internal set number, or the names of the talent involved. A good organized site can identify a set of content on the server just by reading the set folder name. Also, do not to use spaces when naming set folders, instead use underscores '_'.

For Photo Content:

Inside each set folder you should upload your photos(in jpg format) to a subfolder named "photos".
(Do not to use odd symbols such as '!,@#$%^&*():;""?><[]\{}| in the file naming of files or files. Use _ in place of spaces and keep naming to A-Z,a-z,0-9). Set this folders permissions to CHMOD 777 after creating/uploading it to your server using your FTP clients' "permissions" or "properties" function, usually located by clicking on the folder and then right-click(video or photo source files))

example: /access/content/upload/test_content/photos/image_001.jpg

For Video Content:
Inside each set folder you should upload your video source file movies(preferably in MP4 format) to a subfolder named either "source"

example: /access/content/upload/test_content/source/filename.mp4

If your source format is in any other format besides .flv|.mp4|.mov|.wmv|.avi please let us know and we can adjust the system settings so you can use these source files as a source.

If you have a video trailer that you want the system to use, please create a folder named 'sourcetrailer' and upload your trailer file in .mp4 format

example: /access/content/upload/test_content/sourcetrailer/filename.mp4

Set the 'sourcetrailer' folder permissions to CHMOD 777 after creating/uploading it to your server using your FTP clients "permissions" or "properties" function, usually located by clicking on the folder and then right clicking. See your FTP client for help with how to set file permissions.

All set folders and subfolders need to be set to CHMOD 777

Once you have uploaded your content and set the file permissions to chmod 777, you are ready to add the set of content into the CMS. Once added into the CMS, the server will process the video files on the server in the background into various sizes and formats you choose. It will take between 20 mins and 4 hours to process each line/format depending on lentgh and quality. Please be patient while the server works for you.

If you have any questions or trouble please open a trouble ticket via the support website.

Improving Video Encoding Quality

The information in this article will improve the server side video quality considerably. The trade-off for quality is speed of the encoding process and file size.

Watermarking

1)  PNG, with or without transparancy, is the best format for watermarking video. The system will place the watermark in the bottom right-hand corner of the video.  We suggest that you size the watermark for each size video that you create.

Extra Encoding Flags

2) Extra flags to enter under Plug-Ins, Transcoder for each entry that may improve this:

a) Quality flags:
 -qcomp 0.6 -subq 9

What this does:
qcomp is video quantizer scale compression (VBR) (default 0.5) -  Constant of rate control equation.

qcomp trades off the number of bits allocated to "expensive" high-motion versus "cheap" low-motion frames. At one extreme, qcomp=0 aims for true constant bitrate. Typically this would make high-motion scenes look completely awful, while low-motion scenes would probably look absolutely perfect, but would also use many times more bitrate than they would need in order to look merely excellent. At the other extreme, qcomp=1 achieves nearly constant quantization parameter (QP). Constant QP does not look bad, but most people think it is more reasonable to shave some bitrate off of the extremely expensive scenes (where the loss of quality is not as noticeable) and reallocate it to the scenes that are easier to encode at excellent quality. qcomp is set to 0.6 by default, which may be slightly low for many peoples' taste (0.7-0.8 are also commonly used).

More information is here:
http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-x264.html

qmin is minimum video quantizer scale (VBR)
qmax is maximum video quantizer scale (VBR)
qdiff is maximum difference between the quantizer scales (VBR)

What this does is set up the level of compression / quality that is performed by ffmpeg   In the case of qmin and qmax, lower settings generate higher quality movies.  The tradeoff is that higher quality videos take a lot longer to encode.

So for instance, a very high quality movie might use:

 -qcomp 0.6 -qmin 3 -qmax 7 -qdiff 4

***PLEASE BEWARE: These changes will affect file quality AND file size. (The file might be huge at 3x or 4x the source file.)

qmin, qmax, and qdiff override any sort of bitrate settings here. The system tries to determine the quality of the movie and then working backwards and determining the bitrate from there.


b) BFrames:

MPEG1, MPEG2 and MPEG4 movies have support for Bframes.  What this will do is add support for forward / backward interpolation.  This will result in a better quality picture using the same bitrate.

-bf 4 -b_strategy 2

Note: If these additional flags are enabled for non-MPEG movies, your encode will fail.

c) General flags that can be used on all videos.

-subq 7
This is the most important quality setting.  The default ffmpeg setting is subq=5.  subq=7 will have a speed cost of encoding video 50-150% slower than a regular movie, but create a higher quality movie.

More information is here:
http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-x264.html

-g 250
 This sets the group of pictures size

-i_qfactor 0.71
 qp factor between P- and I-frames.

-keyint_min 25
-sc_threshold 40
-refs 16
-directpred 3
-trellis 2
-flags2 +bpyramid+wpred+mixed_refs+dct8x8+fastpskip
-coder 1
-flags +loop
-cmp +chroma
-partitions +parti8x8+parti4x4+partp8x8+partb8x8
-me_range 32

Many settings have trade-offs. Whenever you are changing a setting for higher quality, you will be trading encoding speed for quality.

If your MP4 videos are not playing when you first load them on a page it is most likely due to to the file encoding. The file will play, however, the whole movie will need to be downloaded first. The MOOV atom of the file is at the end, so it cannot be progressively downloaded.

There are lots of different tools that will fix this:
http://www.dvbportal.de/projects/mp4muxer/
 
You can see about a coder potentially qt-faststart on all of your mp4 movies on your server. Ask us for a reference list.

Alternatively, anything made with our video transcoder plugin will have the MOOV atom at the front. More information here:
http://www.elevatedx.com/transcoder.php

You might also want to look at adding a streaming service if you do not plan on using our transocder such as Wowza|Red5|mod_h264

qt-faststart

By default, mp4 and mov movies that are created in ffmpeg aren't suitable for embedding in a browser window.  The reason for this is that ffmpeg creates the file with a crucial component placed at the very end of the file.  This means, by default, mov/mp4 files created with ffmpeg require the files to be fully downloaded before they will play in a flash / quicktime player.

qt-faststart is a command that is run by our transcoder after ffmpeg has completed.  This moves the crucial part of the movie file from the end of the file towards the beginning.  This way, the movie can be progressively downloaded while a viewer watches it.

For Elevated X users that aren't using the transcoder, or had qt-faststart turned off, it's possible to run a batch command via shell that will go through your content folder and run qt-faststart on every file, as needed.

Here is the Bash source for this script:

ext=mp4 
path=/path/to/your/members/content/upload/ 
for i in `find "$path" -iname "*.$ext"`
do
  qt-faststart "$i" ~/out.$ext 2>&1 > /dev/null
  if [ -f out.$ext ]
    then
      echo "processing: $i";
      mv -f out.$ext "$i";
    else
      echo "skipping: $i";
  fi;
done;

Make sure to change mp4 to the file extension you wish to run qt-faststart on (mov, m4v, etc).

Your host should be able to run this script as needed.

We don't recommend removing the source files after your transcoding jobs are finished, but if you do, you need to do a few steps in order to maintain the integrity of the CMS file index. 

1) After you delete the source files from the server(usually inside the 'source' subfolder of your set folders, you need to run a batch to update the system using the batch tool(Utilities >> Batch Operations) to 'Import content' to re-scan all the sets you have removed the source files for. In the Batch tool, select all the sets in which you have removed the source files, then move them to the right-hand side include list. Then select the checkbox for
"Import Content "
(when you do this all other options will be grayed out.) Then scroll down and select "Process".

2) When this operation is finished, do the same operations above to select the sets and move to the right-hand side, but instead of choosing "Import Content", select the following options:

Calculate Image Sizes / Movie Information ( vids )
Recalculate Set XML ( ? ) Help
Recalculate Content Totals

Then scroll down and click "Process" again.

What this does is remove any references to the source files so in the future when you try to make a thumbnail, edit a date, or some other function, the system doesn't error out when it can't find the file you removed.


In order to upgrade Smarty templates to no longer use the JW player, please perform the following:

1) Download the newest version of the PHP templates from here:
https://support.elevatedx.com/newest_templates.php

Under Smarty Templates, please take a look at the thumbnails for the smarty templates. Typically, the name of your template folder matches up with the name of the template (such a theme2, but you may want to look at the thumbnail to see which is the closest match to your templates)

2) Within the download, there will be a folder:

e.g: /streamline/js/mp/

e.g: /theme1/js/mp/

e.g: /theme2/js/mp/

e.g: /theme3/js/mp/


Please create the following folder for each area you're using:
 /tour/js/mp/

Where /tour/ is your tour folder, and /members/ is your members area folders.
Then upload the contents of /members/js/mp/ into these folders.

3) The following files will need to be edited or replaced within your template folder:

Standard Templates
[TEMPLATE_FOLDER]/globals/globals.tpl
[TOUR_PATH]/js/tour.js
Mobile templates:
[TEMPLATE_FOLDER]/tour/episode.tpl
[TEMPLATE_FOLDER]/tour/page_top.tpl
[TOUR_PATH]/js/tour.js

 

Template Changes:

If you have made template changes to these files, below are details about what has changed in each file:

 

Desktop Template Changes:

Changes in: [TEMPLATE_FOLDER]/globals/globals.tpl

Old Code:

{** These are JW Player 6 Library Includes **}
<script type="text/javascript" src="js/jwplayer.js"></script>
<script type="text/javascript">jwplayer.key="qLzynSodouEg2o+gukjzO+6P0dzyHYq1TqcHaUF9cJE=";</script>

New Code:

<!-- These are MediaElements.js includes -->
<script src="js/mp/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="js/mp/mediaelementplayer.min.css" />


Changes in: [TOUR_PATH]/js/tour.js

Old Code:

        afterShow: function () {        
            jwplayer("mediaspace").setup({
                file: v,
                width: 960,
                height: 540,
                autostart: true,
                events: {
                    onComplete: function(e) {
                        loadbanner();
                    }
                }

            });
        },

New Code:

        afterShow: function () {
            
            txt = '<video width="960" height="540" id="mediabox">';
            txt = txt + "\n" + '<source type="video/mp4" src="' + v + '" />';
            txt = txt + '</video>';
            
            $("#mediaspace").html(txt);
            
            $('#mediabox').mediaelementplayer({
                
                success: function(media, node, player) {
                    
                    media.play();
                    
                    media.addEventListener('ended', function(e){
                        loadbanner();
                    });
                }
            });    
        },

 

Mobile Template Changes:

 

Changes in: [TEMPLATE_FOLDER]/tour/episode.tpl

Old Code:

<script>
    mobile_trailer = "{$item.trailer_url_mobile[0]}"

    {literal}
    picarr = []
    
    $(document).ready(function() {
        
        if (mobile_trailer == "")
        {
            return;
        }        

        passobj = {}    
        passobj.file = mobile_trailer;
        passobj.image = "{/literal}content/{$item.Directory[0]}/0.jpg{literal}"            
        passobj.autostart = false;        
        
        passobj.width = parseInt($(".header").width());
        passobj.height = parseInt($(".header").width() * 9 / 16);

        passobj.primary = "flash";
        
        jwplayer("mediaplayer").setup(passobj);
    });
        
    $(window).resize(function() {
    
        if ( mobile_trailer != "" )
        {            
            jw_wdth = jwplayer('mediaplayer').getWidth();
            jw_hdth = jwplayer('mediaplayer').getHeight();
        
            wdth = parseInt($(".header").width());
            hdth = parseInt(wdth * jw_hdth / jw_wdth);
    
            try
            {    
                jwplayer('mediaplayer').resize( wdth, hdth );
            }
            catch(e)
            {
                console.log(wdth + "x" + hdth + " " + jw_wdth + "x" + jw_hdth + " - " + e);
            }
        }
    });
    
    {/literal}

</script>

New Code:

<script>
    mobile_trailer = "{$item.trailer_url_mobile[0]}"

    {literal}

    picarr = []

    $(document).ready(function() {

        if (mobile_trailer == "")
        {
            return;
        }

        imgg = "{/literal}content/{$item.Directory[0]}/0.jpg{literal}"
        w = parseInt($(window).width());
        h = parseInt($(window).width() * 9 / 16);
        
        try
        {
            txt = '<video width="' + w + '" height="' + h + '" id="mediabox" style="width: 100%; height: 100%;" '
            
            if (imgg != "")
            {
                txt = txt + ' poster="' + imgg + '" ';
            }
            
            txt = txt + '>';
            txt = txt + "\n" + '<source type="video/mp4" src="' + mobile_trailer + '" />';
            txt = txt + '</video>';
            
            // console.log(txt);
        
            $("#mediaplayer").html(txt);            
            $('#mediabox').mediaelementplayer({

                success: function(media, node, player) {
            
                }
            });        
        }
        catch(e)
        {
            alert(e)    
        }

    });

    $(window).resize(function() {

        if ( mobile_trailer != "" )
        {
            w = parseInt($(window).width());
            h = parseInt($(window).width() * 9 / 16);

            $("#mediaplayer").width(w);
            $("#mediaplayer").height(h);
        }
    });
    
    {/literal}

</script>

 

Changes in: [TEMPLATE_FOLDER]/tour/page_top.tpl

Old Code:

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type='text/javascript' src="js/jwplayer.js"></script>
<script type="text/javascript">jwplayer.key="qLzynSodouEg2o+gukjzO+6P0dzyHYq1TqcHaUF9cJE=";</script>
<script type='text/javascript' src="js/mobileinclude.js"></script>

<script>
{literal}
try
{
    // starting the script on page load
    $(document).ready(function(){

        if (typeof jwplayer !== 'function')
        {
            alert("Warning: File jwplayer.js not found.");
        }
        
        $(window).resize(function() {
            ResizeHeight(".element", ".info");
        });

        try { ResizeHeight(".element", ".info"); }
        catch(e) { alert(e); }
        
    });
}
catch(e)
{
  alert("Warning: File js/jquery.min.js not found.");
}
{/literal}
</script>

New Code:

 

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type='text/javascript' src="js/mobileinclude.js"></script>

<script src="js/mp/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="js/mp/mediaelementplayer.min.css" />

<script>
{literal}
try
{
    // starting the script on page load
    $(document).ready(function(){

        if (typeof MediaElementPlayer !== 'function')
        {
            alert("Warning: File js/mp/mediaelement-and-player.min.js not found.");
        }
        
        $(window).resize(function() {
            ResizeHeight(".element", ".info");
        });

        try { ResizeHeight(".element", ".info"); }
        catch(e) { alert(e); }
        
    });
}
catch(e)
{
  alert("Warning: File js/jquery.min.js not found.");
}
{/literal}
</script>

Changes in: [TOUR_PATH]/js/tour.js

See changes for js/tour.js under Desktop Template Changes.

 

 

 

 

 

Setting up Wowza/RED5/Mod_h264:

Wowza/RED5/Mod_h264 support is already coded into 3.2 and 4.0 templates.  Here's how to configure it.

Step 1) Have your host set up a Wowza/RED5 URL such as rtmp://members.yoursite.com/foldername/ where members.yoursite.com is the domain you wish to host your Wowza/RED5 server and foldername is the folder you want set up to server the content.

Your host should set this up so that /foldername/ goes maps to the document root of your website.  Do NOT have them link directly to your /content/upload/ or /content/ directory or else your streaming will not work.  Also, if your members area is set up within a subfolder (e.g: yoursite.com/members/), have them link to the folder above your members folder.

Step 2) On the Admin Panel, click Plug-Ins.  Under Template Fields, click Manage.

Step 3a) Follow these steps if you're using Wowza or RED5

Under the Flash Player Settings, the following variables that need changing here:
 a) flashmoviestreamer: Change this value to your wowza/RED5 URL (e.g: rtmp://mysite.com/folder/).
 b) flashmovietype: Change this value to rtmp.
 c) flashmp4streamer: Change this value to your wowza/RED5 URL (e.g: rtmp://mysite.com/folder/).
 d) flashmp4type: Change this value to rtmp.

Step 3b) Follow these steps if you're using mod_h264


Under the Flash Player Settings, the following variables that need changing here:
 a) flashmp4streamer: Change this value so that it is blank.
 b) flashmp4type: Change this value to lighttpd.

Customizing Flash Player Appearance:

Within Plugins -> Template Fields -> Manage -> Flash Player Settings, the following settings affect the look and feel of the flash player.

flashvarsfrontcolor: Color of all icons and texts in the controlbar and playlist.
flashvarsbackcolor: Background color of the controlbar and playlist. This is white with the default skin.
flashvarslightcolor: Color of an icon or text when you rollover it with the mouse.
flashvarsscreencolor: Background color of the display

Content Protection:

Since Wowza/RED5 is a RTMP media delivery server, it is no longer necessary to make flv / mp4 files available through your web server.  You can specifically block out file types by adding the following to your .htaccess file:

<filesMatch "\.(mp4|flv)$">
deny from all
</filesMatch>

This will prevent these type of files from being downloadable within your members area.

Protect Wowza Stream

Elevated X supports protection of the Wowza Stream like so:

rtmp://mysites.com/members/?key=<?php . md5($_SERVER['REMOTE_ADDR'] . "MY_SECRET_KEY") ?>

Here's how you can set this up:

1) Your flashmp4streamer will look like this:

rtmp://mysites.com/members/?key=##WOWZASECRETKEY##

2) Within cmsinclude.ini.php, you'll need to add this line:

WOWZASECRETKEY="MY_SECRET_KEY"

In this case, MY_SECRET_KEY should be replaced with the secret key your host has set up.

 

 

Transcoder minimum size and bitrate levels.
We have minimum requirements on video source files in order for the transcoder to be able to make each size format in HLS and MP4:

(The following applies to both MP4 and HLS)
In order to create a 1080p file, you will need a source file at 1080p tall and at least 8000kbps bitrate.
In order to create a 720p file, you will need a source file at 720p tall and at least 5000kbps bitrate.
In order to create a 480p file, you will need a source file at 480p tall and at least 3000kbps bitrate.
In order to create a 360p file, you will need a source file at 360p tall and at least 1500kbps bitrate.
In order to create a 240p file, you will need a source file at 240p tall and at least 1000kbps bitrate.

If your source file is not at least 8000K, the 1080p version will not be created and the operation will be skipped (you'll see an error in the operations telling you why the error occurred and why it was skipped). We can lower these minimums at your request, but they are there to prevent low-quality files being used to make higher-quality files, which just uses up disk space.

Transcoder Not Running, Queue Not Progressing, etc.

These are the steps used to diagnose cron problems:

Step 1) Confirm with your host that the crontab is running:
*/5 * * * * /path/to/php /path/to/cms_admin/longqueue.php

Note - You will need to replace path/to/php and path/to/cms_admin with the actual paths to these locations.

Step 2) If the cron is running, have your hosting company change the crontab to save its results to a log file
*/5 * * * * /path/to/php /path/to/cms_admin/longqueue.php >> /path/to/cms_admin/cronlog.log

Note - You will need to replace path/to/php and path/to/cms_admin with the actual paths to these locations.

Step 3) Look at cronlog.log.  Search for the phrases "Fatal Error" or "Warning".
If cronlog isn't there, the cron isn't running.

If there are no Fatal Errors or Warnings in the cronlog, have the host:
a) Make the setting in PHP "display_errors", set to "on"
b) Make the setting in PHP "error_reporting" to "E_ALL ~E_NOTICE ~E_STRICT"

4) If the Fatal Error has an "out of memory" error, login to your CMS admin panel and click Setup and change the Memory Limit from 64M or 128M to -1.

 

Unsupported Transcoder Codecs

The following video codecs are currently unsupported by FFmpeg, and therefore can't be used as source videos.

RealVideo 8 and Up: Please make sure you have FFmpeg 0.5 or greater installed.

Windows Media Audio 9 Voice: This requires FFmpeg 0.6 or greater installed.  See notes below.
Windows Media Audio 9 Professional: This requires FFmpeg 0.6 or greater installed.  See notes below.
On2 VP8: This requires FFmpeg 0.6 or greater installed.

Windows Media Audio 9 Lossless: Unsupported.
On2 VP5: Unsupported.
On2 VP6: Unsupported.
On2 VP7: Unsupported.

This list will be updated as new versions of FFmpeg are released.


Which build of FFmpeg should I use?
Currently, we recommend you use FFmpeg 0.5 if you plan on using the system to watermark your videos.  FFmpeg 0.6's implementation of video watermarking is currently broken.

If you don't plan on using the system to watermark videos, we recommend FFmpeg 0.6.

Using a Separate Server for Encoding

The system does not support management of remote sites or content on other servers without the use of NFS. We do not consider multi-server setups part of our standard CMS install/setup process. We don't require a separate install of the CMS for each server. Make sure both servers are running the same versions of PHP, IONcube, ffmpeg, etc.( http://www.elevatedx.com/requirements.php )

Assisting with server setup is outside of the scope of our support services and will need to be handled by your hosting company.

The separate machine will need:

1) The same absolute path to the admin folder.
2) The same absolute path to the members area content folder (as this is specified in the config file under Setup in admin)

Both of these can be mounted via NFS.

When it comes to encoding, ffmpeg works faster when encoding from a local file than one over NFS, so we have a flag within the cron that allows this:

*/5 * * * * /path/to/php /ADMINPATH/longqueue.php --tmpfolder=/tmp/

Note - Be sure to change /ADMINPATH/ to the actual system path to your admin panel and /path/to/php to your PHP path.

NOTE - If you're going to be encoding using multiple servers, you'll need to make sure the --thread parameter is different across all machines:

# Server 1

*/5 * * * * /path/to/php /ADMINPATH/longqueue.php --thread=1
*/5 * * * * /path/to/php /ADMINPATH/longqueue.php --thread=2

# Server 2

*/5 * * * * /path/to/php /ADMINPATH/longqueue.php --thread=3
*/5 * * * * /path/to/php /ADMINPATH/longqueue.php --thread=4


Database Support

If your current database setup involves connecting to either 127.0.0.1 or localhost on your existing CMS setup, your host will need to make some changes in order to facilitate connecting to the same database from separate server.

- On your primary server (admin panel) have your host create an alias in /etc/hosts called dbserver that points to 127.0.0.1
- On this new server where you're running any encodes, have your host create an alias in /etc/hosts called dbserver that points to the IP address of your admin server.
- Make sure the new encoding server can connect to MySQL on your admin panel using the same username and database that was used to connect via localhost. This may take some additional permissions set up by your host.

Once this is ready, you should be able to go into /cms_admin/setup.php and change the Database host to dbserver, or whatever alias your host set up for this database server.




We are removing the existing JW Player from all current versions fo Elevted X. If not updated, your video player will stop working in 30 days on October 15th!

The JW Player (which Elevated X has licensed since 2008) has decided to no longer honor the old license in an attempt to force payment of tens of thousands of dollars in license fees or it will shut off all client players. If you do not pay them, they will shut off your video player.

In response, we are moving ALL Elevated X users to an open source video player IMMEDIATELY.

Here is some information on the new video player we will be using going forward:

Key Features:

- HTML5 With Flash Fallback
- Supports HLS adaptive streaming
- Supports WMV / Silverlight fallback
- Works with desktop and mobile devices

 
Please open a ticket in the "upgrade" department to schedule an update of your media player.

Please contact the vendor / person who wrote your authentication script to address this.

The problem in iOS 10 here is that the video component does not recognize cookies that have "no expiration time" set (such as a cookie that is set with a time expiration of 0). We had to make changes to our "Protect" software to no longer use cookies with no set expiration date. Your authentication script vendor will need to update their script to do the same thing.

Once they do this, the movies should play like they did before.


Watermark Videos

Note: FFmpeg 0.8 or greater is required to have the system be able to create watermarks. We suggest using a .PNG file for best results.

Step 1) On the Plug-ins Page, go to the Video Transcoder listing and click "Manage". There, for each encoding entry you will be setting up the watermark that you want to use for each video format.

Step 2) Locate the "Watermark Path" field inside each entry: This is a path to the watermark file you want added to the video.  IMPORTANT NOTE - This is an absolute path e.g. /web/mysite.com/content/watermark.png

Step 3) Click "Edit Entry". Your watermark setting will be saved.

If you are using an old version of FFmpeg, this watermark path field will be grayed out. Please have your host upgrade your version of FFmpeg.