Jump to content

Search the Community

Showing results for tags 'videos'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General Discussion
    • Announcements
    • Business Discussion
    • Business Services
    • Sell and Buy
  • Themes & templates
    • KVS default theme
    • KVS paysite theme
  • Educational / support
    • Technical Support
    • FAQ
    • Educational Series

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



About Me

Found 21 results

  1. The following can be done with just few steps in KVS: Step 1. Go to Website UI -> Pages -> Index page editor and insert list_categories block into the desired place in page template: {{insert name="getBlock" block_id="list_categories" block_name="Categories And Videos"}} Save. Step 2. Now you should see Categories And Videos block in the list of blocks on Index page. Open it for editing and configure the following settings: Cache lifetime (s): 3600 items_per_page (Integer): set 0 if you want to display all categories; otherwise set the max number of categories sort_by (Sorting): configure sorting as needed pull_videos (On/Off): enable pull_videos_count (Integer): set the number of videos for each category (in our example it is 3) pull_videos_sort_by (Sorting): set sorting for videos under each category NOTE: if you want that only certain subset of categories are displayed, you may need to enable some filters under Static filters parameters. In Template code specify this code (the code is given for KVS default theme and 5.2.0 version, it may not work in earlier versions): {{foreach item="item_category" from=$data}} <div class="headline"> <h2>{{$item_category.title}}</h2> </div> <div class="box"> <div class="list-videos"> <div class="margin-fix" id="{{$block_uid}}_items"> {{if count($item_category.videos)>0}} {{foreach item="item" from=$item_category.videos}} <div class="item {{if $item.is_private==1}}private{{elseif $item.is_private==2}}premium{{/if}} {{if $item.status_id==0}}disabled{{elseif $item.status_id==2}}error{{elseif $item.status_id!=1}}processing{{/if}}"> <a {{if $item.view_page_url!=''}}href="{{$item.view_page_url}}"{{/if}} title="{{$item.title}}" {{if $item.rotator_params!=''}}data-rt="{{$item.rotator_params|replace:"pqr=":""}}"{{/if}}> <div class="img"> {{if $item.status_id==0 || $item.status_id==1}} <img class="thumb {{if $lang.enable_thumb_lazyload=='true'}}lazy-load{{/if}}" {{if $lang.enable_thumb_lazyload=='true'}}src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-original{{else}}src{{/if}}="{{$item.screen_url}}/{{$lang.videos.thumb_size}}/{{$item.screen_main}}.jpg" {{if $lang.videos.thumb_size_webp}}data-webp="{{$item.screen_url}}/{{$lang.videos.thumb_size_webp}}/{{$item.screen_main}}.jpg"{{/if}} alt="{{$item.title}}" {{if $lang.enable_thumb_scrolling=='true'}}data-cnt="{{$item.screen_amount}}"{{/if}} {{if $item.is_private==0 && $item.formats[$lang.videos.preview_video_format_standard].file_path!=''}}data-preview="{{$config.project_url}}/get_file/{{$item.server_group_id}}/{{$item.formats[$lang.videos.preview_video_format_standard].file_path}}/"{{/if}} {{if $item.is_private==2 && $item.formats[$lang.videos.preview_video_format_premium].file_path!=''}}data-preview="{{$config.project_url}}/get_file/{{$item.server_group_id}}/{{$item.formats[$lang.videos.preview_video_format_premium].file_path}}/"{{/if}} width="{{$lang.videos.thumb_size|geomsize:'width'}}" height="{{$lang.videos.thumb_size|geomsize:'height'}}"/> {{/if}} {{if $item.is_private==1}} <span class="line-private"><span class="ico-private">{{$lang.videos.list_label_private}}</span></span> {{elseif $item.is_private==2}} <span class="line-premium"><span class="ico-premium">{{$lang.videos.list_label_premium}}</span></span> {{/if}} {{if $item.status_id==1}} {{if $lang.enable_memberzone=='true'}} {{foreach item="fav_index" from=$lang.videos.predefined_favourites}} <span class="ico-fav-{{$fav_index}}" title="{{$lang.videos.list_action_add_to_favourites[$fav_index]}}" data-fav-video-id="{{$item.video_id}}" data-fav-type="{{$fav_index}}"></span> {{/foreach}} {{/if}} {{/if}} {{if $item.is_hd==1}}<span class="is-hd">HD</span>{{/if}} </div> <strong class="title"> {{if $lang.videos.truncate_title_to>0}} {{$item.title|truncate:$lang.videos.truncate_title_to:"...":true}} {{else}} {{$item.title}} {{/if}} </strong> <div class="wrap"> <div class="duration">{{$item.duration_array.text}}</div> {{assign var="object_rating" value="`$item.rating/5*100`"}} {{if $object_rating>100}}{{assign var="object_rating" value="100"}}{{/if}} <div class="rating {{if $object_rating>=50 || $object_rating==0}}positive{{else}}negative{{/if}}"> {{$object_rating|string_format:"%d"}}% </div> </div> <div class="wrap"> {{assign var="added_date" value=$item.post_date}} {{if $mode_favourites==1}} {{assign var="added_date" value=$item.added2fav_date}} {{elseif $mode_purchased==1}} {{assign var="added_date" value=$item.purchase_date}} {{/if}} <div class="added"><em>{{$added_date|date_format:$lang.global.date_format}}</em></div> <div class="views">{{$item.video_viewed|traffic_format}}</div> </div> </a> </div> {{/foreach}} {{else}} <div class="empty-content">{{$list_videos_empty_message|default:$lang.common_list.no_data}}</div> {{/if}} </div> </div> {{if count($item_category.videos)>0}} <div class="load-more"> <a href="{{$lang.urls.videos_by_category|replace:"%DIR%":$item_category.dir|replace:"%ID%":$item_category.category_id}}">{{$lang.common_list.load_more}}</a> </div> {{/if}} </div> {{/foreach}}
  2. KVS supports ability to sell subscriptions to individual profiles and channels. These subscriptions work using the internal token system and have the following features: A subscription can be for unlimited period, or for the given period of days. It is possible to specify only 1 period, which will affect all subscriptions of the same type (e.g. you can configure 1 period for subscription on profiles, and another period for subscription on channels). A subscription should be paid in tokens, so that users first need to purchase tokens using one of the supported and configured payment processor. Subscription means premium access to all videos uploaded by the given profiles or into the given channel. Subscription price can be set in admin panel for each profile / channel separately, or in site frontend in profile / channel editor (this field should be added into theme layout, not exist by default). So ultimately each member can have multiple paid channels with different prices, as well as separate price for the whole member's profile. If subscription is durable, at the end of subscription period KVS will try to deduct the needed amount of tokens from the user's account (e.g. rebill the subscription). If there will be no tokens on user's balance within 24 hours, the subscription will not be renewed. Unfortunately at the time of writing (5.5.1 KVS version) there is no support for sending emails, alerts to users at the moment with regard to this issue. Will be added in future. It is possible to configure that users who sell subscriptions to their profiles or channels will get some % of revenue in tokens paid by buyers. For simplicity this guide will consider the case when you activate only 1 type of subscription at a time: either channels or profiles. If you want to consider having both profile and channel subscriptions at a time, you will need more robust template coding to render video purchase forms correctly, because the same video can be accessed via channel subscription, or via profile subscription and thus 2 purchase options should be displayed. However the provided examples give the full code needed to create both cases and only minor IF / ELSE adjustments are needed. If you want to start using this feature you should first consider configuring a payment processor in Memberzone -> Billings. You need to choose a processor that supports tokens: SegPay, Paypal and Verotel at the moment + CoinPayments added in the new version already. For configuring them please create support ticket after you have your account approved at billing's side. Activating paid subscriptions in admin panel The very few and easy settings are located in Settings -> Memberzone Settings under Paid subscriptions section. You need to activate paid subscriptions for profiles and/or channels, set their default price as 0 and subscription duration as needed (leave empty for unlimited duration). In the next section you can also activate earning tokens from selling profiles and/or channels and specify your commission. Here is how the settings will look like for 30-day channel subscriptions with users earning 90% of all paid tokens (10% is your service fee): Adding fields for users to specify subscription price There could be 2 places where you may need to add this field based on whether you plan profile and/or channel subscriptions. For channels: Go to Website UI -> Language files -> default and add the following lines: edit_channel.field_tokens_required = Price in tokens edit_channel.field_tokens_required_hint = specify price for paid channels Then go to Website UI -> Global blocks -> Edit Channel Form and add the following code into the desired place to render token price field: <div class="row"> <label for="edit_channel_tokens_required" class="field-label">{{$lang.edit_channel.field_tokens_required}}</label> <input type="number" name="tokens_required" id="edit_channel_tokens_required" class="textfield" value="{{if $smarty.post.tokens_required>0}}{{$smarty.post.tokens_required}}{{/if}}" min="0" placeholder="{{$lang.edit_channel.field_tokens_required_hint}}" {{if $is_locked=='true'}}readonly{{/if}}/> <div class="field-error down"></div> </div> For profiles: Go to Website UI -> Language files -> default and add the following lines: edit_profile.field_tokens_required = Price in tokens edit_profile.field_tokens_required_hint = specify price for paid profiles Then go to Website UI -> Theme settings and under Profile options field find the active link (in some themes there could be several profile editing forms and only one of them is active). Then in the profile edit block settings add the following code into template where you want it to be displayed: <div class="row"> <label for="edit_profile_tokens_required" class="field-label">{{$lang.edit_profile.field_tokens_required}}</label> <input type="number" name="tokens_required" id="edit_profile_tokens_required" class="textfield" value="{{if $smarty.post.tokens_required>0}}{{$smarty.post.tokens_required}}{{/if}}" min="0" placeholder="{{$lang.edit_profile.field_tokens_required_hint}}" {{if $is_locked=='true'}}readonly{{/if}}/> <div class="field-error down"></div> </div> Closing access to videos in paid channels / from paid profiles Go to Website UI -> Language files -> default and add the following lines: videos.video_player_guest.channel = This video belongs to a premium channel %CHANNEL%. Only active members can watch videos from premium channels. <br/><br/> Please <a href="%LOGIN%" data-fancybox="ajax">log in</a> or <a href="%SIGNUP%" data-fancybox="ajax">sign up</a> for free. videos.video_player_tokens_not_enough.channel = This video belongs to a premium channel %CHANNEL%. To have access to videos in this channel you must spend <em>%TOKENS_COST%</em> tokens. <br/><br/> Your current tokens balance is <em>%TOKENS_AVAILABLE%</em> tokens. <br/> You need <em>%TOKENS_LEFT%</em> more tokens. videos.video_player_tokens_purchase.channel = This video belongs to a premium channel %CHANNEL%. To have access to videos in this channel you must spend <em>%TOKENS_COST%</em> tokens. <br/><br/> Your current tokens balance is <em>%TOKENS_AVAILABLE%</em> tokens. <br/> Please confirm spending <em>%TOKENS_COST%</em> tokens on this video. Now you need to modify video view block template in Website UI -> Pages -> View Video page -> Video View block. Locate the following line: {{elseif $data.can_watch==0}} and you need to add the following block RIGHT before this line. ATTENTION! This is the most complicated part, as you need to insert the fully copied code fragment into the specific part of Smarty template, failing to do correctly make break your video page. Please make sure you do a backup copy of original template code before you do any changes, just in case you need to restore it. For channels: {{elseif $data.dvd.tokens_required>0 && $data.dvd.is_purchased==0 && $data.user_id!=$smarty.session.user_id && $data.dvd.user_id!=$smarty.session.user_id}} <div class="no-player" style="width: 100%; height: 0; padding-bottom: {{$player_size[1]/$player_size[0]*100|replace:",":"."}}%"> <img src="{{$flashvars.preview_url}}" width="{{$player_size[0]}}" height="{{$player_size[1]}}" alt="{{$data.title}}"/> <span class="message"> {{if $smarty.session.user_id<1}} {{$lang.videos.video_player_guest.channel|replace:"%CHANNEL%":$data.dvd.title|smarty:nodefaults|replace:"%LOGIN%":$lang.urls.login|replace:"%SIGNUP%":$lang.urls.signup}} {{else}} {{if $smarty.session.tokens_available<$data.dvd.tokens_required}} {{assign var="tokens_left" value=$data.dvd.tokens_required-$smarty.session.tokens_available}} {{$lang.videos.video_player_tokens_not_enough.channel|replace:"%CHANNEL%":$data.dvd.title|replace:"%TOKENS_COST%":$data.dvd.tokens_required|replace:"%TOKENS_AVAILABLE%":$smarty.session.tokens_available|replace:"%TOKENS_LEFT%":$tokens_left|replace:"%UPGRADE%":$lang.urls.upgrade|smarty:nodefaults}} <form> <input type="button" class="submit" data-fancybox="ajax" data-href="{{$lang.urls.upgrade}}" value="{{$lang.videos.video_player_tokens_btn_buy|replace:"%TOKENS_COST%":$data.dvd.tokens_required|replace:"%TOKENS_AVAILABLE%":$smarty.session.tokens_available|replace:"%TOKENS_LEFT%":$tokens_left}}"> </form> {{else}} {{assign var="tokens_left" value=$smarty.session.tokens_available-$data.dvd.tokens_required}} {{$lang.videos.video_player_tokens_purchase.channel|replace:"%CHANNEL%":$data.dvd.title|replace:"%TOKENS_COST%":$data.dvd.tokens_required|replace:"%TOKENS_AVAILABLE%":$smarty.session.tokens_available|replace:"%TOKENS_LEFT%":$tokens_left|replace:"%UPGRADE%":$lang.urls.upgrade|smarty:nodefaults}} <form action="{{$data.canonical_url}}" method="post" data-form="ajax"> <div class="generic-error hidden"></div> <input type="hidden" name="action" value="subscribe"/> <input type="hidden" name="subscribe_dvd_id" value="{{$data.dvd.dvd_id}}"> <input type="submit" class="submit" value="{{$lang.videos.video_player_tokens_btn_spend|replace:"%TOKENS_COST%":$data.dvd.tokens_required|replace:"%TOKENS_AVAILABLE%":$smarty.session.tokens_available|replace:"%TOKENS_LEFT%":$tokens_left}}"> </form> {{/if}} {{/if}} </span> </div> For profiles: {{elseif $data.user.tokens_required>0 && $data.user.is_purchased==0 && $data.user_id!=$smarty.session.user_id}} <div class="no-player" style="width: 100%; height: 0; padding-bottom: {{$player_size[1]/$player_size[0]*100|replace:",":"."}}%"> <img src="{{$flashvars.preview_url}}" width="{{$player_size[0]}}" height="{{$player_size[1]}}" alt="{{$data.title}}"/> <span class="message"> {{if $smarty.session.user_id<1}} {{$lang.videos.video_player_guest.channel|replace:"%CHANNEL%":$data.username|smarty:nodefaults|replace:"%LOGIN%":$lang.urls.login|replace:"%SIGNUP%":$lang.urls.signup}} {{else}} {{if $smarty.session.tokens_available<$data.user.tokens_required}} {{assign var="tokens_left" value=$data.user.tokens_required-$smarty.session.tokens_available}} {{$lang.videos.video_player_tokens_not_enough.channel|replace:"%CHANNEL%":$data.username|replace:"%TOKENS_COST%":$data.user.tokens_required|replace:"%TOKENS_AVAILABLE%":$smarty.session.tokens_available|replace:"%TOKENS_LEFT%":$tokens_left|replace:"%UPGRADE%":$lang.urls.upgrade|smarty:nodefaults}} <form> <input type="button" class="submit" data-fancybox="ajax" data-href="{{$lang.urls.upgrade}}" value="{{$lang.videos.video_player_tokens_btn_buy|replace:"%TOKENS_COST%":$data.user.tokens_required|replace:"%TOKENS_AVAILABLE%":$smarty.session.tokens_available|replace:"%TOKENS_LEFT%":$tokens_left}}"> </form> {{else}} {{assign var="tokens_left" value=$smarty.session.tokens_available-$data.user.tokens_required}} {{$lang.videos.video_player_tokens_purchase.channel|replace:"%CHANNEL%":$data.username|replace:"%TOKENS_COST%":$data.user.tokens_required|replace:"%TOKENS_AVAILABLE%":$smarty.session.tokens_available|replace:"%TOKENS_LEFT%":$tokens_left|replace:"%UPGRADE%":$lang.urls.upgrade|smarty:nodefaults}} <form action="{{$data.canonical_url}}" method="post" data-form="ajax"> <div class="generic-error hidden"></div> <input type="hidden" name="action" value="subscribe"/> <input type="hidden" name="subscribe_user_id" value="{{$data.user.user_id}}"> <input type="submit" class="submit" value="{{$lang.videos.video_player_tokens_btn_spend|replace:"%TOKENS_COST%":$data.user.tokens_required|replace:"%TOKENS_AVAILABLE%":$smarty.session.tokens_available|replace:"%TOKENS_LEFT%":$tokens_left}}"> </form> {{/if}} {{/if}} </span> </div> After adding such block, video page should turn into a locked player for paid channels / profiles, unless user purchases them: Displaying subscription status for paid subscription Note: this functionality will become possible in KVS 6.0 update. Default theme renders list of user's subscriptions, but subscriptions can be free and paid. The default rendering doesn't separate them, and here is how to modify that. Go to Website UI -> Language files -> default and add the following lines: subscriptions.list_label_paid_unlimited = (Paid, never expires) subscriptions.list_label_paid_expired = (Paid, expired) subscriptions.list_label_paid_active = (Paid, expires in [count]%1% days || 1: 1 day[/count]) Then go to Website UI -> Pages -> [Memberzone] My Profile page -> My Subscriptions block settings. Locate the following code in its template: <a href="{{$subscribed_url}}" class="title">{{$item.title}}</a> And change it like this: <a href="{{$subscribed_url}}" class="title"> {{$item.title}} {{if $item.purchase.purchase_id>0}} {{if $item.purchase.expiry_date_is_unlimited==1}} {{$lang.subscriptions.list_label_paid_unlimited}} {{elseif $item.purchase.expiry_date_hours_left<0}} {{$lang.subscriptions.list_label_paid_expired}} {{else}} {{assign var="days_left" value=$item.purchase.expiry_date_hours_left/24|floor}} {{$lang.subscriptions.list_label_paid_active|count_format:"%1%":$days_left}} {{/if}} {{/if}} </a> And the result will look like this:
  3. Multiple conversion servers can be used only in KVS ultimate package. They will let you reduce CPU load on main server and make video conversion faster, but only to some point. It is a common misunderstanding to assume that the more conversion servers you add, the more videos can be converted for the same time. This is not always true. The overall conversion speed depends not only on the actual conversion (e.g. video encoding), but on many other factors as well that will be explained in this post. KVS conversion engine works in 3 phases, in some cases only 1 or 2 phases are executed and the rest are skipped. But if we speak of processing newly uploaded videos, this is always a 3-phase process: Main server: prepares conversion task for conversion server and uploads this task to conversion server Conversion server: executes task Main server: verifies and finalizes task execution Main server cron and conversion server cron are both triggered each 1 minute. It means that any new video will require at least 2 minutes before its conversion is finalized. Even if conversion itself takes couple of seconds, you will have to wait for 2 minutes due to cron limits. Conversion phase 1 When phase 1 is executed, in most cases this phase is very fast and all it needs to do is to copy task info and the uploaded video file to conversion server. This may take a while if your source files are huge and your conversion server is remote. The most important thing to understand here is that this phase is always processed in 1 thread. If you have 10 new videos scheduled and 10 free conversion servers, the main cron will have to copy each video to each conversion server 1 by 1 (not in parallel). If copying each video takes 1 minute, your conversion engine will be busy with spending 10 minutes to copy 10 tasks to conversion servers. In this case there is no big difference how many conversion servers you have, because each task takes the whole minute to simply copy it. Your video queue will not be processed faster than 1 * 60 * 24 = 1440 videos per day. Remote conversion server settings have an option to cope with this issue, which allows conversion server to download video source files from the main server instead of require main server to copy them to conversion server: This changes the whole picture. Main server will not need to spend 1 minute to copy video source files anymore, instead it will spend only 1 second to copy a small task file. Thus it can copy 10 tasks to 10 conversion servers in less than 10 seconds, so that for the whole minute it can copy up to 60 tasks. Then each conversion server will download source files from main server, but now this will happen in parallel. If you have only 2 remote conversion servers, then they both will download 2 video source files at the same time. But if you have 10 - they will download 10 in parallel. This is a huge speed increase. The only issue here is to make sure that your main server is able to serve so many files at the same time, you should also remember that main server serves your website for the end users and these parallel downloads can affect the overall speed of your main server. Conversion phase 2 During phase 2 conversion servers will download video source from main server (if this option enabled in their settings, see the previous section) and will do all the necessary conversion logic programmed. Here each conversion server works independently of everything else. If you have 10 conversion servers, they will do phase 2 for 10 tasks in parallel, so phase 2 can be easily scaled to any speed you want by just adding more conversion servers. It is a common practice to create multiple conversion servers (at least 2) for the same physical server. You can easily do that by simply using separate conversion folders, so you can create 2 or more conversion servers in KVS using the same physical server box, e.g.: Convertor - 1: /home/ftpuser/conversion1 Convertor - 2: /home/ftpuser/conversion2 Convertor - 3: /home/ftpuser/conversion3 Why does this make sense? The whole phase 2 conversion consists of multiple conversion steps, here are some examples of them: Downloading source file from the main server Using ffmpeg to convert video to another format or quality Using ffmpeg to take screenshots from video Using imagemagick to create thumbs for the screenshots Copying result video files to storage server(s) If you look at these steps, some of them are using much CPU and some of them are using much network to download or upload. Also when taking screenshots from video files ffmpeg is using less CPU in comparison to when converting, taking screenshots can result in some delays depending on source file and how easily it can be navigated based on keyframes. If you use only 1 conversion server for 1 physical server, there will be intervals when your CPU load is 0% or when your network load is 0%. This is a waste of resources. By creating at least 2 conversion servers for the same physical server you will increase its conversion speed and overall resources utilization will be close to 100%. But this doesn't mean that adding more conversion servers here will increase the speed to x2, or x3 - this is just a matter of +20% or +30%. Therefore we think that having 2 or max 3 conversion servers per 1 physical server is more than enough. Conversion phase 3 This final phase is executed back again on the main server. When conversion server finishes processing a task, main conversion engine will pull this task result from conversion server. All high-CPU operations have already been done on conversion server and this phase is just to pull result screenshots and result video files if needed. Copying files may take time, especially on low quality network connections. This phase is like phase 1 in term of time - it can take much time to copy big or many files and the number of conversion servers you have cannot speed this up. Similar to what we said in phase 1, phase 3 can also have optimized copying. Each conversion server has an option to enable it to copy video files to storage servers and thus main server will not have to do that: This will result in parallel video files copying and you can benefit here from having multiple conversion servers. There is one case however, when this option cannot be used - if you have a local storage server. The reason is that local storage server is defined as a directory path (e.g. /var/www/domain.com/contents/videos), and this directory makes sense for the main server only. Remote conversion servers cannot use this path, so they won't be able to copy result video files. In such cases KVS will automatically disable this option and will force all result video files to be copied via main server. Then you have no much sense to add many remote conversion servers, since they will probably have a lot of spare resources. Summary: what can affect conversion speed Here is a summary of factors that can affect conversion speed in different scenarios: Connection latency / network speed between main server and conversion servers - bad network conditions will reduce conversion speed, that's why remote conversion servers should be located ideally with the same datacenter to avoid network roundtrips. CPU and disk speed on conversion servers - converting big video files can utilize much CPU (when scaling, watermarking) and also disk subsystem. Very slow disks may result in CPU resources not fully utilized. RAM is not very significant, however we've seen some cases when ffmpeg or imagemagick was using more than 1GB of RAM. For a conversion server you should have at least 2GB of free RAM. If you use multiple conversion servers on the same physical server, then your physical server should have 2GB * number of conversion servers you plan there. In multiple remote conversion servers scenario if servers are allowed to download source files from main server, it is critically important that main server is able to serve all these files in parallel as well as it is able to serve your end users at the same time. Otherwise the benefit from using multiple conversion servers will be only in reducing CPU usage on the main server and not speeding up conversion process much. If you have any local storage server, which is used to host newly uploaded videos, then you will not get 100% benefit from using multiple remote conversion servers, as main server will have to pull all result video files from them in 1 thread, which will mean that your overall system conversion speed will be limited to the speed of pulling an average video file from a remote conversion server. You can still use 1 or 2 remote conversion servers for reducing main server's CPU usage. When uploading video files without conversion (e.g. you upload them not as source files, but as ready video formats, which is very popular when using tube scrapper plugin), CPU resources are mostly not being used. Thus in such scenarios the key component to speeding up new content processing is reducing network utilization. No much sense to use remote conversion servers, since no much CPU resources are being utilized. Instead remote conversion servers will increase network utilization and thus may reduce overall speed. If you are using local storage - you are fine with 1 local conversion server. But if you are using remote storage, you may need to add 1 more local conversion server (with another directory on filesystem), to parallel the process of copying video files to storage server(s) and thus to increase processing speed. How to analyze performance You can find conversion logs in Administration -> Background tasks log section: By looking into these stats you can have some understanding of what is the problem, if you have one. If most of the time is spent on creating video files, it may indicate that your CPU is quite slow. If much time is spent on copying or downloading files, it may indicate that your network connection is poor, or network is overloaded at some port (main, conversion or storage server), or disks are overloaded. Please pay attention to "Waiting for xxx to start phase Y" messages. They do not mean that conversion engine is stuck and "actively waiting", absolutely no - conversion engine may switch to another task during this period, which is the most likely scenario when you have many tasks. These waiting timings may be big enough, up to hours, but they are not considered when calculating "effective" time spent on task processing. Transcoding performance In most cases when you upload videos into KVS (not using embed codes or hotlinking 3rd-party video files) and your external storage / conversion servers do not have network bottlenecks, the major time is being spent on video transcoding. This is what background task log details names as "Creating format file". The transcoding is the process of decoding video file, resizing it to another size and compressing it back. This process uses a lot of CPU resources, and in some cases when your videos are in Full HD / 4K quality it may also utilize HDD due to big size of source and target files. Transcoding in KVS is typically used to create different resolutions of the same video, so that users can watch video in different qualities. Another reason of using video transcoding is to add watermark(s) on top of it. If transcoding takes much time in your setup and you are not happy with the number of videos that are being processed during each day, then there are few options to increase transcoding speed: 1) Add more external conversion servers so that more videos can be processed at once in parallel (possible with KVS Ultimate only). This is the most obvious, and the most expensive option. You need to buy some more server(s) for the time that you need to transcode your videos. 2) Use GPU-powered server and configure GPU conversion. GPUs are working faster on video transcoding due to various technical reasons, however the main issue with them is that you need vendor-specific ffmpeg codecs that will support transcoding on GPU. These codecs are never part of standard ffmpeg distributions (ffmpeg is the server library that does video transcoding), and they need to be built manually by your server support. Another problem is that you should change ffmpeg options in video format settings in KVS admin panel to get these video codecs working. 3) Avoid using transcoding and upload already prepared (transcoded) video files. This approach is typically used with grabbers and importing feeds, when the videos that you need to import are already transcoded into multiple qualities. All that KVS needs to do is to download them and put into storage system. No transcoding will happen in this case, so no CPU / GPU power is needed. However, your video files must be already present in all qualities you want to support, and also you will not be able to put any watermarks on them. You can find out more about uploading already transcoded video files in this article: If you are using grabbers, then check this article about speeding up grabbing: 4) Finally, if none of the above options works for you (you don't want to pay for conversion servers, or you are not using grabbers and don't have video transcoded in different video qualities), then the only way to avoid transcoding or reduce its time is to reduce the number of video qualities that your site offers. You can find them in Settings -> Video formats section of admin panel. By default KVS typically installs the following qualities: MP4 480p (the lowest and required) MP4 720p (for videos 720p+) MP4 1080p (for videos 1080p+) MP4 4K (for videos 4K+) For each of these video formats you can see the number of videos that have it. This can let you identify, if you win much time if you decide to stop using MP4 4K or MP4 1080p qualities for example. Are there many videos that have them in % to your videos that have MP4 480p? If yes, then you can increase transcoding speed in several times by simply disabling these formats. If most of your videos are 480p and 720p, then you won't win much from disabling them and have to do another choice: Delete 720p quality and keep all your videos in 480p. This would result in low visual quality and could become problem for your site in general. Actually 480p quality is too small for modern devices. Delete 720p quality and change 480p resize option to Do not resize (keep source size). This would result in each video will have the same quality as originally uploaded source file. No quality change will be possible, and all users will see video in the same quality. This could be good option, but you should keep in mind that if some of your source files are 1080p or 4k, they will be transcoded with the same size, and could take much disk space on your storage and utilize much network when somebody is watching them. So this option is good when you know for sure most of your source video files are of 720p / 480p quality; or you are OK with the fact that many videos will be served in 1080p+ quality from your servers. Also this option allows you completely avoid transcoding by uploading your source video not in Source file field, but in 480p format field (or better rename it to some other name to avoid confusion). Make 720p quality required (WARNING! this will create a set of tasks to create 720p for all videos that don't have it), and after it is created for all videos, delete 480p quality. So all your videos will be transcoded into 720p format only. If the source file is bigger than 720p (e.g. 1080p or 4K), its quality will be reduced to 720p; and if the source file is initially smaller - the quality will remain the same as source. This option is a good choice, when you want to serve decent video quality to your users, and you know that your source files have many of 1080p+, and you don't want to serve 1080p quality to all users.
  4. There are many sites which can be used to download videos from 3rd-party tube sites. For example this one: tubeninja.net KVS tube script comes with a fully-featured protection mechanism, which can do 3 things for your tube site: Prevent other users from downloading your videos via web tube downloaders. Prevent any other scripts from parsing and downloading your videos. Prevent other tube sites from hotlinking your videos and stealing your traffic. The settings are in Settings -> Content Settings under Video download script protection settings section: What you should do is to make sure that Enable protection for video download script is ON, Hotlink protection type is set to IP and Enable links obfuscation option is also switched ON. Link obfuscation will only work in KVS player. If you are using 3rd-party video player, then you cannot use this option. However, if your hotlink protection type is set to IP this will also prevent using web tube downloaders for your site. But your site will be vulnerable for other scripts to parse and download your content. If it is important for you to prevent that, you should use KVS video player and enable this option.
  5. In KVS there is no built-in support for country restrictions. The main reason is that KVS caching engine doesn't allow having these restrictions along with site caching, so for now we don't have any way to add this feature. However, if you discount caching aspect, it is possible to activate this feature with few theme adjustments. Disabling caching could have negative impact on your database load. But in this case you will only disable cache for video_view block, which is not the hardest block to be rendered. Step 1. First of all you need to switch off caching for the View Video page and video_view block on it. In order to do that go to Website UI -> Pages and search for video_view there. This will show you all pages that have this block (by default your theme will only have one page and block with caching time set to 3600 on both). Set caching time to 0 in both page and block fields (by default it will have 3600) and use Save caching option: Step 2. Go to Settings -> Customization and activate some custom text field in Videos. This will be the field where you need to list country codes of the countries where a specific video should be blocked. The format of the data is comma-separated list of 2-symbol country codes, for example like this: NOTE: the actual formatting doesn't matter, possible to specify in lower case, or without space between commas. Step 3. In Website UI -> Pages -> View Video page -> video_view block template find this fragment: {{if $data.status_id==5 || $data.status_id==2 || $data.status_id==3}} <div class="no-player" style="width: 100%; height: 0; padding-bottom: {{$player_size[1]/$player_size[0]*100|replace:",":"."}}%; background: black"> <span class="message">{{$data.delete_reason|default:$lang.videos.video_player_deleted}}</span> </div> {{elseif $is_limit_over==1}} .... Add the following block right before it: {{assign var="blocked_countries" value=","|explode:$data.custom1}} {{assign var="is_blocked_by_country" value="false"}} {{foreach from=$blocked_countries item="country_code"}} {{if $country_code|trim|strtolower==$smarty.server.GEOIP_COUNTRY_CODE|strtolower}} {{assign var="is_blocked_by_country" value="true"}} {{/if}} {{/foreach}} {{if $is_blocked_by_country=='true'}} <div class="no-player" style="width: 100%; height: 0; padding-bottom: {{$player_size[1]/$player_size[0]*100|replace:",":"."}}%; background: black"> <span class="message">This video is not available in your country</span> </div> and it order to make the smarty syntax complete you should changed {{if}} with {{elseif}} in the mentioned before block in the first line: {{elseif $data.status_id==5 || $data.status_id==2 || $data.status_id==3}} <div class="no-player" style="width: 100%; height: 0; padding-bottom: {{$player_size[1]/$player_size[0]*100|replace:",":"."}}%; background: black"> <span class="message">{{$data.delete_reason|default:$lang.videos.video_player_deleted}}</span> </div> {{elseif $is_limit_over==1}} .... IMPORTANT! If you fail to insert this block into the correct place, or to correct the IF -> ELSEIF logic, your template code may become broken and in this case it will stop rendering player. Then go to Website UI -> Change history to find the previous template version and restore it.
  6. By default KVS simply shows 404 error message on black screen when somebody is using embed code for a video that was deleted. The contents what is displayed for wrong / deleted embed codes can be customized in Settings -> Embed player settings under Error template field. Here is the example of how you can configure it to display list of videos in addition to error message. Just use the code below as Error template: <html> <head> <title>{{$lang.error_404.title}}</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <style type="text/css"> @import "https://fonts.googleapis.com/css?family=Roboto:400,500,700&amp;subset=cyrillic"; /* related videos in player */ .player-related-videos { position: absolute; left: 0; top: 0; right: 0; bottom: 0; padding: 30px 10px 30px 10px; overflow: hidden; } .player-related-videos .player-related-videos-container { position: relative; width: 100%; height: 100%; overflow: hidden; text-align: center; } .player-related-videos .player-related-videos-item { position: relative; display: inline-block; vertical-align: middle; margin-top: 5px; } .player-related-videos .player-related-videos-item .title { display: none; position: absolute; left: 0; top: 0; right: 0; height: 52px; overflow: hidden; text-align: left; padding: 5px; color: #ffffff; background: -moz-linear-gradient(top, rgba(12, 12, 12, 0.8) 0px, transparent 50px); background: -webkit-gradient(linear, left top, left bottom, color-stop(0px, rgba(12, 12, 12, 0.8)), color-stop(50px, transparent)); background: -webkit-linear-gradient(top, rgba(12, 12, 12, 0.8) 0px, transparent 50px); background: -o-linear-gradient(top, rgba(12, 12, 12, 0.8) 0px, transparent 50px); background: -ms-linear-gradient(top, rgba(12, 12, 12, 0.8) 0px, transparent 50px); background: linear-gradient(to bottom, rgba(12, 12, 12, 0.8) 0px, transparent 50px); } .player-related-videos .player-related-videos-item .duration { display: none; position: absolute; bottom: 5px; right: 5px; color: #ffffff; background: rgba(12, 12, 12, 0.8); padding: 2px 5px; } .player-related-videos .player-related-videos-item:hover .title, .touch .player-related-videos .player-related-videos-item .title, .touch .player-related-videos .player-related-videos-item .duration, .player-related-videos .player-related-videos-item:hover .duration { display: block; } body { font: 400 14px/1.2 "Roboto", Helvetica, sans-serif; } body > div:first-child { top: 0 !important; padding-top: 5px; } </style> </head> <body style="margin: 0; padding: 0; background: #000; color: #fff"> <div style="width: 100%; text-align: center; position: absolute; top: 49%">{{$lang.error_404.title}}</div> <script src="{{$config.statics_url}}/static/js/main.min.js"></script> <script> if ('ontouchstart' in document) { $('body').addClass('touch'); } $.ajax({ url: '{{$config.project_url}}/related_videos_html/0/', type: 'GET', cache: false, success: function (html) { $('body').append($(html)); } }); </script> </body> </html> NOTE: this code is for KVS default theme. For other themes you may need to check which theme scripts you have in http://domain.com/static/js directory. If you have main.min.js file, this code will work. In other themes you may have vendors.min.js - then you need to replace this line: <script src="{{$config.statics_url}}/static/js/main.min.js"></script> with this one: <script src="{{$config.statics_url}}/static/js/vendors.min.js"></script> Finally if you neither have main.min.js nor vendors.min.js, you need to include JQuery library there.
  7. If you have multiple tube sites on KVS, you can make related videos from one site to be part of another site. For example to render them as the first 3 related videos, or the last 3, or even as a separate list. Configuring page to render related videos HTML code on source site First you need to create a new page on source site (which videos you will take off). Go to Website UI -> Add page and create a new page with the following data: Display name: Related videos for <target site> (e.g. Related videos for kvs-demo.com) External ID: related_videos_for_<target_site> (e.g. related_videos_for_kvs_demo) Cache lifetime: 86400 Template code: {{insert name="getBlock" block_id="list_videos" block_name="Related Videos"}} Save this page and open it for editing. You will notice Related Videos block added to its block list. Open this block editor. In Related Videos block editor scroll down to Search videos by text parameter group and enable var_search = q parameter. Also under List pagination group make sure that items_per_page parameter has the exact number of videos you want to pull. In Template code you should render video items with template code that is needed for target site (e.g. kvs-demo.com in this example). The easiest way is to go to target site admin panel, go to its Website UI -> Page components -> include_list_videos_block_common.tpl and copy-paste everything within its primary {{foreach}} iteration. Here is what we copied from default theme: {{foreach item="item" from=$data}} <div class="item {{if $item.is_private==1}}private{{elseif $item.is_private==2}}premium{{/if}}"> <a {{if $item.view_page_url!=''}}href="{{$item.view_page_url}}"{{/if}} title="{{$item.title}}"> <div class="img"> {{if $item.status_id==0 || $item.status_id==1}} <img class="thumb {{if $lang.enable_thumb_lazyload=='true'}}lazy-load{{/if}}" {{if $lang.enable_thumb_lazyload=='true'}}src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-original{{else}}src{{/if}}="{{$item.screen_url}}/{{$lang.videos.thumb_size}}/{{$item.screen_main}}.jpg" {{if $lang.videos.thumb_size_webp}}data-webp="{{$item.screen_url}}/{{$lang.videos.thumb_size_webp}}/{{$item.screen_main}}.jpg"{{/if}} alt="{{$item.title}}" {{if $lang.enable_thumb_scrolling=='true'}}data-cnt="{{$item.screen_amount}}"{{/if}} {{if $item.is_private==0 && $item.formats[$lang.videos.preview_video_format_standard].file_path!=''}}data-preview="{{$config.project_url}}/get_file/{{$item.server_group_id}}/{{$item.formats[$lang.videos.preview_video_format_standard].file_path}}/"{{/if}} {{if $item.is_private==2 && $item.formats[$lang.videos.preview_video_format_premium].file_path!=''}}data-preview="{{$config.project_url}}/get_file/{{$item.server_group_id}}/{{$item.formats[$lang.videos.preview_video_format_premium].file_path}}/"{{/if}} width="{{$lang.videos.thumb_size|geomsize:'width'}}" height="{{$lang.videos.thumb_size|geomsize:'height'}}"/> {{/if}} {{if $item.is_private==1}} <span class="line-private"><span class="ico-private">{{$lang.videos.list_label_private}}</span></span> {{elseif $item.is_private==2}} <span class="line-premium"><span class="ico-premium">{{$lang.videos.list_label_premium}}</span></span> {{/if}} {{if $item.is_hd==1}}<span class="is-hd">HD</span>{{/if}} </div> <strong class="title"> {{if $lang.videos.truncate_title_to>0}} {{$item.title|truncate:$lang.videos.truncate_title_to:"...":true}} {{else}} {{$item.title}} {{/if}} </strong> <div class="wrap"> <div class="duration">{{$item.duration_array.text}}</div> {{assign var="object_rating" value="`$item.rating/5*100`"}} {{if $object_rating>100}}{{assign var="object_rating" value="100"}}{{/if}} <div class="rating {{if $object_rating>=50 || $object_rating==0}}positive{{else}}negative{{/if}}"> {{$object_rating|string_format:"%d"}}% </div> </div> <div class="wrap"> {{assign var="added_date" value=$item.post_date}} {{if $mode_favourites==1}} {{assign var="added_date" value=$item.added2fav_date}} {{elseif $mode_purchased==1}} {{assign var="added_date" value=$item.purchase_date}} {{/if}} <div class="added"><em>{{$added_date|date_format:$lang.global.date_format}}</em></div> <div class="views">{{$item.video_viewed|number_format:0:",":$lang.global.number_format_delimiter}}</div> </div> </a> </div> {{/foreach}} Finally make sure you also put 86400 cache lifetime in this block settings. After saving block editor you can now check how it works (make sure to replace https://domain.com/related_videos_for_kvs_demo with your domain and page ID): https://domain.com/related_videos_for_kvs_demo.php?q=Test video If your database has something similar to "Test video", it should render several videos. Pulling videos from target site Now when the page is ready, go to target site admin panel. Locate page or block where you want to render this list (typically in Website UI -> Pages -> View Video -> Related Videos block or View Video page itself) and open it for editing. In template code add this (make sure to replace https://domain.com/related_videos_for_kvs_demo with your domain and page ID): {{php}} $storage = $this->get_template_vars('storage'); if (function_exists('get_page') && $storage['video_view_video_view']['title']) { echo get_page("", "https://domain.com/related_videos_for_kvs_demo.php?q=" . urlencode($storage['video_view_video_view']['title']), "", "", 1, 0, 3, ""); } {{/php}} Now refresh any of the video pages on target site and make sure that related videos from source site are displayed correctly. If they are displayed with wrong styling, make sure that template code from the previous section suits target site CSS styles and taken from target site, not from source site. Video previews Video previews will not work by default. The reason is anti-hotlink protection that is configured in Settings -> Content settings -> Video download script protection settings (because this is actually a hotlink, when you try to put links to video files from one site to another). If you want to allow this, you have to change hotlink protection mode from IP to Referrer (less secure) and put your 2nd domain into whitelist:
  8. KVS features extremely powerful tube grabbers plugin (Plugins -> Grabbers). With this plugin you can import tons of content, even if you don't have any. We will not speculate on whether it is ethic or not to grab content from 3rd party sites, you should decide this yourself. For basic understanding on how to use grabbers plugin please check the corresponding section in this post: There are 3 different ways of how to import content from grabbers and as usual there is no perfect solution and each of them has its advantages and issues. Grabbing as embed codes This is the fastest way to fill your site with many content with few simple clicks. Install grabbers that support embed codes and set Mode of each grabber to Embed. Choose the other needed data you want to grab and submit lists where to grab videos from. Voila! Pros: The fastest way to import tons of content, as only screenshot will be download for each video. No conversion power is required, can be used in virtually any server. No storage and traffic payment is required, since no content is hosted within your server. Cons: You have no control on what is displayed inside embed code. The source site may opt to stop displaying embed codes, or to delete videos, or to redirect all visitors from embed codes to their site. You cannot control advertising that is displayed inside video player. But you can still use your advertising outside the player. No support for video previews. The whole idea of using embed codes is to avoid video files being downloaded to your server. Therefore there is nothing to create video previews from. See also: What video types are supported in KVS tube script and how they are different. Downloading videos as a single source file The idea here is that for each video KVS will download the file of the desired (typically maximum desired) quality, and then treat this file as a video source file to create all the needed formats from it (e.g. 720p, 480p, 1080p and video previews). In order to configure this you need to set grabber Mode to Download option and then choose which Quality you want to download as a source quality: So this option tells KVS that you want grabber to download 1080p file as a source file, and if a video doesn't have this quality - skip it. This will mean that only videos that have at least 1080p quality will be added by grabber. And if a video even has 4K quality, it will be added by grabber and KVS will download its 1080p file (not 4K file). This is normal, because you don't need to download 4K file, which has bigger size if your maximum video format is 1080p. Make sure you save your resources here. The most important fact here is that the downloaded file will be treated as Source file with processing. This will mean that all video files will be fully created by KVS, and you can even configure to cut intros from them and add your own watermark. Pros: You control your videos and player, you can show any advertising that you want inside the player. You do not depend on whether videos are removed from the source site or not. You can cut intro rendered by source site, you can put your watermark on top of theirs. Only 1 file needs to be downloaded, and everything else is created by KVS (but you still depend on the downloading speed for this file). Cons: Slower import speed than for embed codes, as you depend on the speed throttling imposed by source site. Huge conversion power will be required to create all video formats. Video files may have higher size after re-conversion, as KVS by default sets better compression quality then other sites. You may need to adjust compression quality, otherwise it may be a situation that the downloaded source file of 1080p quality is 100Mb, and KVS creates 720p quality (smaller resolution) that is 150Mb on disk - this makes absolutely no sense and should be checked and avoided. Downloading videos as multiple ready-made files This concept is different from the previous one in requiring KVS to download multiple video files of different qualities and uploading them as ready-made files without them being re-converted. In order to use it you need to set grabber Mode to Download and then choose Multiple Quality options similar to this: Configured like this KVS will download 480p, 720p and 1080p files (3 files in total) and will upload them into the corresponding video format slots. 240p and 2160p qualities will be skipped, even if source videos have them. The key fact here is that video files will be uploaded "as-is" without any conversion. This brings certain benefits and certain drawbacks. Pros: You still have full control on videos and player advertising in comparison to embed option. And you don't need any processing power for this, so virtually any server will allow this. Cons: Since KVS needs to download multiple files, the importing speed will be much slower. Since video files will be uploaded "as-is", you can't adjust them in any way, e.g. remove intros or do any watermarking. How grabber download works in KVS and how to make it faster Basically the last 2 scenarios are mostly different on what will be slower in your server environment: video conversion or downloading multiple files. Where download limit comes from? It is normal that source sites don't want to lose their network channel on your project downloading their videos, so they typically impose speed throttling, either per download or per IP. In the first case when you download one file, this file's download speed is limited to 100 mbit/s, when you download another file in parallel, its download speed is limited to 100 mbit/s as well, but the summary of your download speed is now 200 mbit/s. In the latter case no matter how many downloads your start from the same IP, the summary download speed will be limited to 100 mbit/s. So technically there are 2 ways of increasing download speed: Run downloads in parallel (will work if server only restricts speed per download). Run downloads in parallel + from different IPs (will work in all cases). In KVS each grabber creates a separate import task that can itself be executed in multiple threads. You can configure the number of threads per grabber either in grabber settings (when you enable auto-pilot), or for the whole import, when you import set of lists manually. So from the start if you grab videos via multiple grabbers, each grabber downloads its videos in a separate thread and thus you have multiple parallel downloads. You can see how this happens in Administration -> Background tasks -> filter by Status = In process: Here you can see 2 import tasks running in parallel. Each task comes from a separate grabber, each grabber has some download speed limit imposed by its source site, but the whole download speed of your system in increased. If you grab from 8 different sites, then the whole download speed will be ~8 times faster. Then you can also configure multiple threads per each import task, for example 2 threads. This will mean that each import task will be executed in KVS in 2 separate threads and will simply grab different videos from the same source site. This will definitely work to increase download speed for sites that do not have speed throttling by IP. But even for sites that limit download by IP, it may help in some cases. The download limit is configured at streaming servers, and theoretically when you try to download different videos from the same site you may reach different streaming servers, and downloading from 2 different streaming servers using the same IP will not trigger any IP limit, as every streaming server has its own IP limit. In practice if you import random videos from huge sites, you will most likely reach different streaming servers. So increasing the number of threads per grabber may also work to increase the overall download speed. However this comes with an increased risk of your server IP being blocked by source site, since the increased number of import threads will send an increased number of requests to their main site (not only to streaming servers). In order to reduce this risk we recommend to increase Timeout option available in each grabber settings. Timeout means the waiting interval for grabber to send next request to the source site. If your server sends 100s of requests within several minutes, its IP will be most likely banned, as no real user behaves like that. Therefore you should use some reasonable timeout time, which is set to 5 seconds by default, but should be definitely increased if you plan to grab videos 24/7. And each time you increase the number of threads per grabber, you also need to increase timeout so that the total number of requests within 1 hour or so is not increased. Here are simple calculations. Let's say a grabber downloads 1 video in 10:00 minutes. And you have timeout set to 30 seconds. So the whole time for grabber to import a video is 10:30. If you increase the number of threads per grabber to 2, then assuming that each thread will download video the same 10 minutes, the average download speed will be reduced to 5 minutes per video. In order to keep the number of requests same, you will need to increase timeout twofold from 30 to 60. This means that each thread will import 1 video every 11 minutes, but having 2 threads in parallel results in average time per video equals to 11:00/2 = 5:30. If you increase the number of threads to 4 and increase timeout x4 to 120 seconds, then it will be 12:00 minutes (the full time for each thread to process and download video) / 4 threads = 3:00 minutes per video in average. That's much better! And finally if you grab from 3 different sites in parallel you can increase your average importing speed to 1:00 minute per video, or 1440 videos per day. Even if downloading a single video takes 10:00 minutes. Of cause these calculations do not include some unexpected delays, when your site network is overloaded, or when source streaming server is overloaded and etc. The importing speed actually means how fast videos are parsed and downloaded into your site. You can follow importing speed by looking into the number of new video tasks in Administration -> Background tasks section. If the number of new video tasks is small and doesn't grow with time, then importing speed is slower than your conversion engine can consume. You may need to think about further increasing the number of threads per grabber, or adding more grabbers for other sites. If the number of new video tasks is constantly growing, this means that your conversion engine is overloaded and makes no sense to increase importing speed anymore. In the latter case you will need to understand how KVS conversion system works.
  9. For a video site most of the bandwidth is being used for serving videos. In many cases you will have a limited channel like 100mbit or 1000mbit, so you will not save any money by saving bandwidth, however there are several cases when saving bandwidth can make great benefit for you: When your channel is fully loaded with serving videos, your site may become unresponsive for some users and you may get SEO penalty. One solution is to buy a new server or extend bandwidth limit, but you can save this money with KVS by trying to limit video streaming speed. When you are using CDN, in most cases you pay for the maximum bandwidth peak. You can save some money by paying less if your maximum peak becomes less. Why limiting streaming speed can save your bandwidth? Many users do not watch videos in full length, they may skip up and down to different fragments. However if their internet speed is high, they can download full video at a max speed shortly even if they didn't watch most of it. With a speed limit you will reduce % of downloaded bandwidth by each user and finally you will get some cut in your global bandwidth usage. KVS provides 2 way to limit video streaming speed: Limit speed to fixed bitrate. This is not a good solution, since it can be inaccurate in many cases - since video bitrate is often dynamic and you won't know the exact bitrate to limit. Limit speed to dynamic bitrate with a multiplier. This option is much better as it will make sure different speed limits for videos of different bitrates and you don't need to investigate the average bitrate of your videos. However, there is one important issue which you should know about streaming MP4 files. Each MP4 file has a metadata atom in the beginning (MOOV atom). This atom contains keyframes from video file and can take up to 4MB depending on video duration and geometry. Player needs to download this atom before it can start playing videos. Therefore if you limit download speed, your videos will start playing with a big delay. However Nginx provides a way to fix that, we will describe this later. NOTE: limiting streaming speed is only possible with serving videos with Nginx or CDN. In case of CDN the implementation of speed limit is fully dependent on your CDN provider (BTW some CDNs are not interested in doing this for an obvious reason). KVS will pass speed limit info to the CDN integration script, which may or may not use it - but this is not KVS issue. How to configure download speed limit In KVS you can configure download speed limit per each video format separately. Go to Settings -> Video formats and for each video format you can set speed limit: Global speed limit: Dynamic bitrate x 1.2 (we recommend multipliers from 1.1 to 1.5) You can set other options under Speed limitation section as needed. For example you can give your premium or active members unlimited download speed. You can also limit speed for visitors from certain countries only, so that you main audience is not affected. In order to define list of countries you want to limit please take a look at Stats -> Countries for reference.
  10. Due to the complexity of AJAX filtering in the default theme, we won't explain this in details. Using this advanced filtering requires deep understanding of default theme JS internals. This is just a working example that can be configured in default theme. Step 1. In Website UI -> Pages run a search by list_videos to filter out only list_videos blocks. Open every list_videos block and activate the following parameters: var_duration_from = duration_from var_duration_to = duration_to var_is_hd = is_hd It is recommended to ignore list_videos block named Related Videos and Player Related Videos, as these anyway won't render filtering and changing their parameters may result to performance overload for some period of time. Step 2. In Website UI -> Page components -> include_list_videos_block_common.tpl add the following code under <div class="headline"> after header display: {{if $duration_from>0}} {{assign var="list_videos_custom_sort_parameters" value="`$list_videos_custom_sort_parameters`;duration_from:$duration_from"}} {{/if}} {{if $duration_to>0}} {{assign var="list_videos_custom_sort_parameters" value="`$list_videos_custom_sort_parameters`;duration_to:$duration_to"}} {{/if}} {{if $is_hd==1}} {{assign var="list_videos_custom_sort_parameters" value="`$list_videos_custom_sort_parameters`;is_hd:$is_hd"}} {{/if}} <div class="sort"> <span class="icon type-hd"></span> <strong>{{if $is_hd==1}}HD{{else}}All{{/if}}</strong> <ul id="{{$block_uid}}_hd_list"> {{if $is_hd==1}} <li> <a data-action="ajax" data-container-id="{{$block_uid}}_hd_list" data-block-id="{{$block_uid}}" data-parameters="{{if $list_videos_custom_sort_parameters!=''}}{{$list_videos_custom_sort_parameters}};{{/if}}sort_by:{{$sort_by}};is_hd:">All</a> </li> {{/if}} {{if $is_hd==0}} <li> <a data-action="ajax" data-container-id="{{$block_uid}}_hd_list" data-block-id="{{$block_uid}}" data-parameters="{{if $list_videos_custom_sort_parameters!=''}}{{$list_videos_custom_sort_parameters}};{{/if}}sort_by:{{$sort_by}};is_hd:1">HD</a> </li> {{/if}} </ul> </div> <div class="sort"> <span class="icon type-duration"></span> <strong>{{if $duration_to==600}}0-10{{elseif $duration_to==1800}}10-30{{elseif $duration_from==1800}}30+{{else}}Duration{{/if}}</strong> <ul id="{{$block_uid}}_duration_list"> {{if $duration_to>0 || $duration_from>0}} <li> <a data-action="ajax" data-container-id="{{$block_uid}}_duration_list" data-block-id="{{$block_uid}}" data-parameters="{{if $list_videos_custom_sort_parameters!=''}}{{$list_videos_custom_sort_parameters}};{{/if}}sort_by:{{$sort_by}};duration_from:0;duration_to:0">All</a> </li> {{/if}} {{if $duration_to!=600}} <li> <a data-action="ajax" data-container-id="{{$block_uid}}_duration_list" data-block-id="{{$block_uid}}" data-parameters="{{if $list_videos_custom_sort_parameters!=''}}{{$list_videos_custom_sort_parameters}};{{/if}}sort_by:{{$sort_by}};duration_from:0;duration_to:600">0-10</a> </li> {{/if}} {{if $duration_to!=1800}} <li> <a data-action="ajax" data-container-id="{{$block_uid}}_duration_list" data-block-id="{{$block_uid}}" data-parameters="{{if $list_videos_custom_sort_parameters!=''}}{{$list_videos_custom_sort_parameters}};{{/if}}sort_by:{{$sort_by}};duration_from:600;duration_to:1800">10-30</a> </li> {{/if}} {{if $duration_from!=1800}} <li> <a data-action="ajax" data-container-id="{{$block_uid}}_duration_list" data-block-id="{{$block_uid}}" data-parameters="{{if $list_videos_custom_sort_parameters!=''}}{{$list_videos_custom_sort_parameters}};{{/if}}sort_by:{{$sort_by}};duration_from:1800;duration_to:0">30+</a> </li> {{/if}} </ul> </div> Step 3. In Website UI -> Page components -> include_pagination_block_common.tpl add the following code in the template beginning: {{if $duration_from>0}} {{assign var="pagination_custom_parameters" value="`$pagination_custom_parameters`;duration_from:$duration_from"}} {{/if}} {{if $duration_to>0}} {{assign var="pagination_custom_parameters" value="`$pagination_custom_parameters`;duration_to:$duration_to"}} {{/if}} {{if $is_hd==1}} {{assign var="pagination_custom_parameters" value="`$pagination_custom_parameters`;is_hd:$is_hd"}} {{/if}}
  11. KVS doesn't support video popularity stats per country yet, but it is possible to emulate this for the end users, providing some personal attitude to every visitor: Step 1. In /admin/include/pre_initialize_page_code.php add the following line: $_GET['GEOIP_COUNTRY_CODE'] = $_REQUEST['GEOIP_COUNTRY_CODE'] = strtolower($_SERVER['GEOIP_COUNTRY_CODE']); This is needed to pass environmental variable with country code to request variables, that can be used by KVS site engine. Step 2. In Website UI -> Texts add the following text that will be rendered as a header: External ID: videos.list_title_by_country Default: Popular in %1% <img class="flag" title="%1%" alt="%2%" src="/static/images/flags/%2%.gif"> This text also contains IMG with reference to flag image. Step 3. Open Website UI -> Pages -> Index -> Videos Watched Right Now for editing. Change its Template code to the following: {{query_kvs select="single" table="list_countries" where_country_code=$smarty.get.GEOIP_COUNTRY_CODE where_language_code="en" assign="country"}} {{assign var="country_title" value=$country.title}} {{if !$country_title || $country.is_system==1}} {{assign var="list_videos_title" value=$lang.videos.list_title_watched_right_now}} {{else}} {{assign var="list_videos_title" value=$lang.videos.list_title_by_country|replace:"%1%":$country.title|replace:"%2%":$smarty.get.GEOIP_COUNTRY_CODE|smarty:nodefaults}} {{/if}} {{assign var="list_videos_use_h1" value="true"}} {{include file="include_list_videos_block_common.tpl"}} NOTE: KVS only supports country names in English and Russian languages, if your site is in Russian please change where_language_code="en" with "ru" to have country name in Russian. In block settings down the page specify GEOIP_COUNTRY_CODE under Dynamic HTTP parameters. This is needed for correct caching logic for this block. If you don't do that, KVS admin panel will show error that using $smarty.get.GEOIP_COUNTRY_CODE variable will not work correctly. The code does the following. First it queries KVS database and selects country record that matches the current visitor's country code using query_kvs template function. Then it checks whether any non-system country record is found (system countries are some satellite ISPs and anonymous proxies). If nothing is found, this code will show old "Videos Watched Right Now" text. Otherwise it will show the new text with country code and flag icon. Step 4. For better icon styling add this block into theme CSS file: h1 img.flag, h2 img.flag { vertical-align: middle; }
  12. In KVS you can define watermark image for each video format in Settings -> Video formats. Typically this is PNG image with some transparency and your site logo / name. How to make sure that watermark is stable for all video formats Since in most cases videos are provided in multiple formats, there is a common problem of watermark scaling. For example, consider a video file that is only 800px in width and the one that is 1920px in width. If your screen size is 1920px also, the first video file will be upscaled 2.5 times when displaying on full screen, while the last file won't be scaled at all. How do you decide which size watermark image should be rendered for each of this format, so that it remain stable size whether user is watching 800px format or 1920px one? The solution is very simple - you should upload watermark image with a big size in all formats, but configure it to take only specific % of video size. There are special options in video format settings: Having this set to 20% in all your video formats you will make sure despite of user chosen display format and user screen size the watermark will always be scaled to 20% of screen width. NOTE: we are not recommending using 20% and 40% values, this is something that you should decide yourself. And this is correct that max width for vertical videos is bigger than for landscape - their width in pixels is smaller. NOTE: KVS supports 2 different watermarks at the same time. Please note that for watermark #2 you specify max height, not width. This is on purpose for cases when you want to display running text; in some cases text length can be bigger than video file width, so in order to resize it correctly you will need to adjust max height for it. Running texts KVS allows showing running texts together with normal watermark images. We recommend using Watermark #2 for running text and Watermark for normal images. Running text should be still uploaded as image, e.g. you should first use image editor and create a text of your wish on transparent background; then save it into PNG and upload PNG into KVS. Then as a Watermark position you should select Top scrolling, or Bottom scrolling. These choices will show several more options where you configure scrolling speed and video positions when scrolling starts. This screenshot defines a scrolling watermark at bottom that will appear 3 times per video: on 10% duration, on 50% and on 90%. Watermark will be visible for 20 seconds, and this defines how fast it will scroll by dividing video width per watermark width: NOTE: it was configured that watermark takes max 5% of video height for landscape videos and max 3% of video height for portrait videos in order to make its size consistent across all formats and devices. Rendering customized watermarks If you want to apply different watermarks for different videos, one of the possible ways is to use custom fields of content sources to provide different watermark images for videos from different content sources. In order to use this approach, you should have well defined way of adding / importing videos with content source for each video that needs custom watermarks. The idea is each content source can define its custom watermark image and all videos that are tagged with this content source will be converted with this custom watermark image. In order to configure this approach, you should first go to Settings -> Customization and enable any available custom file field for content sources. Once enabled, go to each video format settings and select the activated custom field in Customize watermark for content sources field: After that you should go to each content source for which videos you want to customize watermark image and upload a custom image into Custom watermark field. Now, all videos that are created or imported with this content source, will have this custom watermark image. If you want to programmatically generate watermarks (e.g. type username who uploaded this video, or any other custom text which can be different), you can create custom PHP script providing hook method for KVS to use custom watermark image. The script should be put into /admin/include/kvs_watermark_video.php Here is sample script implementation, which creates watermark image with the following text: Uploaded by <username> <?php function kvs_watermark_video($format_postfix, $video_data) { global $config; // here you should create and return image path with your custom watermark text // this file will be deleted, so you need to create it each time // check $format_postfix if you need watermark to be limited to specific formats only, e.g. // if ($format_postfix == '.mp4' || $format_postfix == 'trailer.mp4') // for example you can query user data and render "uploaded by <username>" watermark $user_data = mr2array_single(sql_pr("select * from $config[tables_prefix]users where user_id=?", $video_data['user_id'])); if ($user_data['user_id'] > 0) { $watermark_file = "$config[temporary_path]/custom_watermark.png"; // settings: text, font, size and offset $watermark_text = "Uploaded by $user_data[display_name]"; $font = "$config[project_path]/admin/data/system/verdanaz.ttf"; $font_size = 10; $offset = 20; // rendering logic $box = imagettfbbox($font_size, 0, $font, $watermark_text); $im = imagecreatetruecolor(abs($box[2] - $box[0]) + 2 * $offset, abs($box[7] - $box[1]) + 2 * $offset); imagealphablending($im, false); imagefilledrectangle($im, 0, 0, abs($box[2] - $box[0]) + 2 * $offset, abs($box[7] - $box[1]) + 2 * $offset, imagecolorallocatealpha($im, 0, 0, 0, 127)); imagealphablending($im, true); imagettftext($im, $font_size, 0, abs($box[0]) + $offset, abs($box[5]) + $offset, imagecolorallocate($im, 255, 255, 255), $font, $watermark_text); // save image to temp file imagesavealpha($im, true); imagepng($im, $watermark_file); imagedestroy($im); // return temp file back to KVS engine return $watermark_file; } return null; } If you need similar functionality (just plain text with custom wording), you can copy-paste this code and modify only these lines: $watermark_text = "Uploaded by $user_data[display_name]"; // text will render "Uploaded by <username>" $font = "$config[project_path]/admin/data/system/verdanaz.ttf"; // this font comes with KVS for captcha rendering, but you can use any other TTF font $font_size = 10; // text size $offset = 20; // offset from video edges, means 20 pixels from corner Here is a sample watermark created by this code. You can see that the font is a bit specific, so you should better use other font: Some notes: Please do not replace KVS font file with your custom font, or captcha functionality may not work correctly. If you want to use custom font, you can put it near by and correct font filename in the code. This watermark will be applied to all video formats that are created by KVS. If you want to limit it to specific video format, you need to add "if" check on the $format_postfix value passed to this function and return null for formats where watermark is not needed. The position of watermark will still be controlled by the Watermark position option of video format settings. By default it is set to Random, so if you don't change it then watermark will be positioned at random corner of the video. Testing watermark function You can test your watermark function by executing test_watermark.php script from your browser: http://yourdomain.com/test_watermark.php Here is code for test script: <?php require_once('admin/include/setup.php'); require_once('admin/include/setup_db.php'); require_once('admin/include/functions_base.php'); require_once('admin/include/functions.php'); error_reporting(E_ALL ^ E_NOTICE); ini_set('display_errors', 1); require_once('admin/include/kvs_watermark_video.php'); $video = mr2array_single(sql("select * from ktvs_videos order by rand() limit 1")); $path = kvs_watermark_video(".mp4", $video); if ($path) { header("Content-Type: image/png"); readfile($path); } Running this file will show you a watermark image created for random video and video format with ".mp4" postfix. If you want to test your code for another postfix, then change ".mp4" with another postfix you need.
  13. Migrating categorization In most cases you don't need to consider categorization, as it will be automatically migrated along with content. However if you want to migrate categorization details as well (such as model details, screenshots, or custom fields) the only way to do that is to use Migrator plugin in KVS. Migrator plugin will connect to another KVS database and will pull categorization that you choose to pull. There are certain important aspects that you should consider when using Migrator plugin: Migrator plugin only supports categorization for KVS migrator. Content migration should be done using export and import functionality, which has much more options. Migrator plugin needs direct connection to other project's database. This works fine if your other project is on the same server, but won't work if your projects are on different servers. One option is to ask admins to expose KVS database on the other project's server to be available for public connections, which is not good from security point. Another option is to create a temporary local database and import backup from the other project's database into it, then configure Migrator plugin to migrate from this local temporary database. Migrator plugin needs your new database to be fully empty (e.g. no new categorization objects in it), as it will migrate objects by using the same IDs and will replace any existing objects that have the same IDs that are migrated from the other project's database. WARNING! If you try using Migrator plugin on project where you already have some categorization, it can be lost. It is recommended that both projects have the same KVS version before you try migration. Otherwise it is not guaranteed to fully succeed. Having these in mind, if your other project is on the same server and your new project is just installed, you can easily pull up all categories, tags, models, content sources with all their data within 5 minutes. All you need is to specify database connection to the other project's database. If you don't know MySQL connection details, please open /admin/include/setup_db.php file to find them. Here is an example: NOTE: for the Old path please specify any existing empty directory path, you can specify path to /tmp directory in your www root. Manually migrating video or album content Use manual content export / import when you want to do a one time migration of all (or part) of your content from older project and then allow these projects run separately. If you want to constantly sync one project based on another project, you need to use feeds, which are explained in the next section. The idea is that you first export content data into a text file and then use this text file to import the exported content into another project. Export / import of albums and videos works in exactly same way, so we will describe on videos. You can access export function in Videos -> Export videos (Import videos for import). The important thing is to create a named pattern of export (and later import), so that you can return to it later if you do any mistakes with fields or options. The recommended way is to first export a dozen of test videos and then try importing them to test the whole scheme and that you get the result you need; and only after you are fine with the imported content you can do the full migration. Another important thing to consider is which video content types you have (file uploads, embeds, hotlinks, or mixed) and how you want them to be imported. The most common scenario is that you have file uploads (videos that store files in KVS storage) and you want to migrate them in the same way. Another possible scenario is that you have videos embedded from other sites and you want to migrate them in the same way. In these cases when you have ALL videos of the same content type, you just do one time export of them ALL and one time import of them ALL. However, there are rare cases when you have some videos uploaded to your servers, some more videos embedded and another set of videos just hotlinked. In this specific case you should do separate export and import for each content type that you have. This is needed because videos of different content types have different data structure. Video export GUI offers Loaded as filter that allows you separating videos by their content type. With regard to Field and Line separators it is recommended to leave them as default. This may not work only if you have videos with multiline descriptions, but in this case manual export and import won't work for you at all and you have to fallback to using KVS feeds. In general it is recommended to leave all export and import options to their default values, unless you need anything specific. The main area where you should put your effort is Fields for export (Fields for import). First of all you should be using the same Field and Line separators in both export and import, we recommend use them as set by default. Next you should make sure that you select the same sets of fields in both export and import. Many fields like title and description are obvious, how about the rest of them? Here is a short summary: Use Video ID only if you want to keep the same IDs across 2 projects. In most cases this is not needed. Use Directory only if you had some specific rules on directory generation or transliteration. In most case this is not needed as directory is usually generated from title. If you want to migrate rating, make sure you select both Rating and Rating (votes). If you want to migrate usernames of video creators, you can do that by selecting User field, but please note that this will only migrate the username, not the whole user data. KVS will create new fake users with the given usernames in new projects. Finally there is a set of fields under Content group, which are related to content structure. As we noted before, depending on video content type these fields structure will be different: For file upload content type, you should first get understanding which video formats you want to migrate. In many cases video formats on your new site will be configured in the same way as on your old site, so you will need to migrate all video formats. But in some cases your new site may have less formats, for example it could have no video preview format, or you occasionally want video preview to be generated differently on this new site. Based on this understanding you should export Video file "XXX" (for hotlink) field for each of the video formats you want to migrate. At the same time you should select the corresponding Video file "XXX" (without processing) field in import fields configuration. For embed content type, you should export and import these fields: Embed code (embedded video), Duration, Main screenshot number and Overview screenshots (sources comma-separated). For hotlink content type, you should export and import these fields: Hosted file URL (hotlinking), Duration, Main screenshot number and Overview screenshots (sources comma-separated). For pseudo video content type, you should export and import these fields: Outgoing URL (pseudo video), Duration, Main screenshot number and Overview screenshots (sources comma-separated). NOTE: if you have mixed content types, remember to do separate export and import for each content type with different set of content fields. NOTE: change Sorting to Video ID Asc so that videos are exported and imported in the same order as on the original site. IMPORTANT! When importing uploaded videos you should make sure that source site has video download protection disabled for the whole period of import. You can disable this in Settings -> Content settings -> Enable protection for video download script option. After import is fully completed, please enable it back. With regard to screenshots, for file uploads they are optional and it is up to you if you want to migrate them or not. In any way KVS will create new screenshots if needed. When migrating screenshots, please make sure that you export their source files, not files of any specific format. And also make sure you migrate main screenshot number. Here is example of how we selected fields in export and import to migrate some uploaded videos from one site to another: Automating content sync with feed You only need to use feeds if you plan to repeatedly sync other sites from the content of you primary site, or in case descriptions of your videos may contain line breaks, so that it is not possible to normally transfer them via manual CSV import. For a one time content transfer it is better to use manual import, as it provides more options and features. It also worth mentioning that only KVS Ultimate supports exporting feeds, so your primary project should have ultimate license. Importing feeds are supported in all KVS licenses. Also at the moment KVS doesn't support feeds for albums. Part 1: Exporting feed. You should start with creating exporting feed in your primary project, you can do that in Videos -> Exporting feeds. The most important section is Feed data and its Content type option. This option indicates which content details you want to expose in feed, and this depends on how you plan to sync your content into another KVS project (please find several examples of how to create site network from a single KVS site in How to build your tube empire with KVS article): Use Website link option if you want to migrate these videos as pseudo videos. Use Hotlink option if you plan to hotlink video files from this project on another projects. Use Embed option if you want to embed these videos on your another projects. Finally use Download link option if you are going to fully sync video files of videos of this project to your another projects. IMPORTANT! When using this option you should make sure that source site has video download protection disabled for the whole period of import. You can disable this in Settings -> Content settings -> Enable protection for video download script option. After import is fully completed, please enable it back. For other options make sure to enable all categorization data, screenshot and poster sources, custom and translated fields. Increase Max limit option to 10000, or bigger value that you want to use (see explanation below). If you plan to use embed codes or pseudo videos and you need some tracking of all traffic that comes to your primary site, you may also need to set some Traffic tracking parameters that you can later specify in feed builder. After your new exporting feed is saved, open its Feed access point to see feed builder form that provides ability to query the needed data from the feed. You should have Feed format set to KVS. Use Filters section if you want to sync only subset of content. If you are going to embed videos on another projects, check URLs and embeds section options. You will also need to specify details for any Traffic tracking parameters there if you enabled them. If you plan to hotlink video files on another projects, check Video files section that provides ability to select either quality factor for hotlinked URLs, or choose a specific video format to hotlink. In most cases you won't need anything specific for download mode, as it works fine by default. Another important thing to consider at this point is how many videos your feed would contain. If your database has less than 10k videos, you won't face any issue in most cases. More videos mean more memory and database load to generate all feed data, which will reach red line at one point and feed will stop working or hang for a long time. In order to solve this, you should use feed limit and pagination control to paginate over the whole list. E.g. import the first 10k videos with the first iteration, then import another 10k videos, and etc. In order to do that you should generate all feed URLs once, don't leave it for the latter time, as later you may forget which options you selected. Change Sorting to Biggest ID last so that videos are exported in the order as they were added. First specify Limit = 10000 and press Get videos button. It should open another tab with feed URL that queries the first 10k videos. Copy URL and save it to a text document. Then in feed constructor set Skip to 10000 and press Get videos button again. You will get another URL that queries the second 10k videos. Repeat the same by incrementing Skip by 10000 again and again until you finally get empty list that will indicate end of paginated data. You can try increasing limit to 20000 and see if feed works with more videos, so that you do less iterations. This will give you some set of URLs to query all your existing videos. Finally you need the last URL that will query some set of new videos for repeated sync. Change Sorting to Most recent first to make sure that now only new videos are in the feed. Set Limit to 1000 now and get URL for querying most recent 1000 videos that you will later use to sync new videos. Part 2: Importing feeds. Now you should go to admin panels of sites that you want to pull videos from your exporting feeds. Go to Videos -> Importing feeds and create a new importing feed. In Feed URL set the first URL of your URLs list that you created when using feed builder. Choose KVS (XML) parser. In Duplicates prefix specify domain name of your primary project you export videos from. If you create multiple importing feeds for the same project, please make sure that all share that same duplicates prefix, so that's why the best idea is to use source project domain name here. Under Interval field choose Run this feed only once and deactivate. Since you have paginated data (if source site contains more than 10k videos you will most likely end up with feed data split into 10k-volume pages), you will need to import each page separately. The proposed way is to first configure feed to import all videos from the first page, then wait for it to be deactivated and re-configure to import from the second page URL, and etc. until you import all pages with all existing videos. After that you should change Feed URL to the last URL you created that will pull latest 1000 videos and configure its Interval to how often you want feed to pull new videos. Then feed will automatically pull new videos for the rest of time. Under Feed data check all data fields you want to import. In Video data section set Video status to Active, Video screenshots to Use screenshots from feed, Video publishing dates to Use publishing date from feed. Finally in Video adding mode option you should choose whether you want to embed, or hotlink, or download videos. If you want to download, then in most cases you will need to set All formats that have match by postfixes (without processing) in Format option. However in order this option to work correctly, you should go to Settings -> Video formats in this project and make sure the formats are configured in the same way they are configured on source site. At least the formats that you want to be downloaded via feeds. When we say "in the same way", we mean that their postfixes and statuses should be set accordingly. For example if on source project you have 480p, 720p formats and MP4 preview format, then you should make sure your importing site also have these formats with the same postfixes. If you don't want, for example, to download MP4 preview format and you want it to be created on the importing project with some other options - create it with another postfix syntax and required status. Then importing feed should download 480p and 720p files only and KVS will auto-create your custom MP4 preview from them. NOTE: for testing purposes it is recommended to set Max videos per execution to some small number (e.g. 10-100) for the first iteration to make sure you configured importing feed correctly. Then you can remove this limit and run feed again allowing it importing the whole set of data.
  14. Hello. How to show Custom Field on video view page? From "Customization" for example: Identifier = Custom 2 and Field name = Link. I have this field on adding new video page, but there is no such field on video view page... can someone help me whit this please! Thankyou
  15. KVS uses the same template for all video lists by default, you can find it in Website UI -> Page components -> include_list_videos_block_common.tpl. There are 2 possible ways you can customize this template for different pages / specific blocks. Create customized version of the original template Duplicate template using options menu in Website UI -> Page components section and specify its new name (e.g. include_list_videos_block_customized.tpl). Then modify its code to the needed styling, and finally switch the needed block(s) to use the new template instead of the original one. For example if you want to modify the display of Videos Watched Right Now block on Index page, here is how its template looks like: Replace this line: {{include file="include_list_videos_block_common.tpl"}} With this: {{include file="include_list_videos_block_customized.tpl"}} So you will force Videos Watched Right Now block on Index page to use your customized version of video list template, while all other places will use the original version. Introduce new variables Duplicating template works well, but if your changes are relatively small, you will end up having 2 similar templates that are different with only few things (e.g. thumb size, for example). This could be a problem for future, when you need to modify something else and you will have to modify it in both places. You can use variables and set them only when needed to avoid duplication. If you look into the image above, you will see that Videos Watched Right Now block already sets 2 variables before calling include_list_videos_block_common.tpl template: {{assign var="list_videos_title" value=$lang.videos.list_title_watched_right_now}} {{assign var="list_videos_use_h1" value="true"}} You can introduce your own variables, their names could be any, no need to prefix in specific way, but make sure they are not used in include_list_videos_block_common.tpl template. For example you can introduce variable to specify custom thumb size: {{assign var="list_videos_custom_thumb_size" value="240x150"}} Then you should also update include_list_videos_block_common.tpl template to use this variable in the needed way. You should always assume that this variable may not be set in 100% cases, so you should always have some default behavior: {{$item.screen_url}}/{{if $list_videos_custom_thumb_size}}{{$list_videos_custom_thumb_size}}{{else}}{{$lang.videos.thumb_size}}{{/if}}/{{$item.screen_main}}.jpg If you have logic like {{if some variable set}} use this variable {{else}} use default value {{/if}} - you can shortcode it to: {{$item.screen_url}}/{{$list_videos_custom_thumb_size|default:$lang.videos.thumb_size}}/{{$item.screen_main}}.jpg
  16. There are 2 possible ways to show ads in video lists: Replacing 1 video with advertising of the same size and visual properties (e.g. width, height and structure to save the list layout). This is also called as native advertising. Use this if you know how to design your ad's layout to look similar to the video item. Breaking list into 2 parts and showing advertising between them. In both cases you should edit the following template: Website UI -> Page components -> include_list_videos_block_common.tpl. This template has the following iteration to display all list items: {{foreach item="item" from=$data}} <div class="item ...."> ... some list item rendering appears here </div> {{/foreach}} IMPORTANT! You should give a name to this iteration: {{foreach item="item" name="videos" from=$data}} Replacing specific item(s) with native advertising If you want to replace one item (#3) with advertising change this code to look like this: {{foreach item="item" name="videos" from=$data}} {{if $can_manage!=1 && $smarty.foreach.videos.iteration==3}} {{insert name="getAdv" place_id="spot_advertising_video_list_item"}} {{else}} <div class="item ...."> ... some list item rendering appears here </div> {{/if}} {{/foreach}} This will insert advertising spot with external ID spot_advertising_video_list_item into the template. Right now there is no such advertising spot, so you should go and create it in Website UI -> Advertising -> Add spot. You should also add advertising into this new spot so that it appeared instead of 3rd video item. If you don't add advertising to this spot or don't create it, every video list will just skip rendering item #3 and will render less items than expected. IMPORTANT! Please make sure you also add a closing {{/if}} tag before closing {{/foreach}} tag to not break template syntax. This code fix replaces third video item on every public video list, including related videos, videos by category, index and etc. If you want to replace only on index, change {{if}} to this: {{if $can_manage!=1 && $smarty.foreach.videos.iteration==3 && $page_id=='index'}} If you want to replace everywhere EXCEPT related videos change {{if}} to this: {{if $can_manage!=1 && $smarty.foreach.videos.iteration==3 && $page_id!='view_video'}} If you want to replace ONLY on related videos change {{if}} to this: {{if $can_manage!=1 && $smarty.foreach.videos.iteration==3 && $page_id=='view_video'}} Finally, if you want to replace 2 videos with native ads, here the code: {{foreach item="item" name="videos" from=$data}} {{if $can_manage!=1 && $smarty.foreach.videos.iteration==3}} {{insert name="getAdv" place_id="spot_advertising_video_list_item1"}} {{elseif $can_manage!=1 && $smarty.foreach.videos.iteration==4}} {{insert name="getAdv" place_id="spot_advertising_video_list_item2"}} {{else}} <div class="item ...."> ... some list item rendering appears here </div> {{/if}} {{/foreach}} NOTE: each video item should be replaced individually with an individual ad. It is not possible to replace 2 video items with a single 'wide' ad, because it won't be rendered correctly on all types of devices. Therefore in the last example we used 2 different advertising spots with different IDs. Inserting advertising in between video lines The key thing here is to understand that it is not possible to insert advertising each 3 or 4 videos, for example. This is because list layout is adaptive and for some devices in can be 4 in a row, for other devices 3 in a row and for smaller devices it can be 2 or 1 in a row. Therefore with such layout it makes sense to show advertising after each 12 items. Here is how: {{foreach item="item" name="videos" from=$data}} <div class="item ...."> ... some list item rendering appears here </div> {{if $can_manage!=1 && $smarty.foreach.videos.iteration==12}} {{insert name="getAdv" place_id="spot_advertising_video_list_item"}} {{/if}} {{/foreach}} This will insert advertising spot with external ID spot_advertising_video_list_item into the template. There is no such advertising spot by default, so you should go and create it in Website UI -> Advertising -> Add spot. If you want to show after 12 and 24 items, then the code should be changed to this: {{foreach item="item" name="videos" from=$data}} <div class="item ...."> ... some list item rendering appears here </div> {{if $can_manage!=1 && $smarty.foreach.videos.iteration==12}} {{insert name="getAdv" place_id="spot_advertising_video_list_item1"}} {{elseif $can_manage!=1 && $smarty.foreach.videos.iteration==24}} {{insert name="getAdv" place_id="spot_advertising_video_list_item2"}} {{/if}} {{/foreach}}
  17. KVS admin panel supports all possible ways to add videos. All you need is to stick to the way which best suits your situation, whether you have existing content or not. There are different content types supported for videos (upload, embedding, hotlinking and other), you may also need to understand how they are different from each other in What video types are supported in KVS tube script and how they are different post. When using upload content type, it is also possible to upload files differently depending on whether you want them to be re-converted or not, please check Different ways to upload video files into KVS for more details. Adding videos manually This is the most obvious way to add videos. The form can be found in Videos -> Add video section of admin panel. You can specify all possible options there and send new video to conversion engine. You don't need to log in to website area as a specific user to add videos from this user - you can do that in admin panel by selecting the needed user in add video form. In Settings -> Content Settings section under Video adding / editing settings you can select some options that affect this form: the most valuable are default user and default status. Based on which video content type you want to add, KVS will show only fields that are related to the selected content type: Adding videos manually is very simple and straightforward process, but this won't work well if you need to add many videos. Therefore please check different mass importing options available in KVS. Mass importing videos from a text file or Excel spreadsheet This feature should be used in the following cases: You have a text file created by some other website or program with the needed list of videos to import (KVS export feature can also generate such text file to export videos from one KVS to another). You have a list of video files uploaded to your server and you want to import them into KVS with specifying all additional info. For accessing this functionality you should go to Videos -> Import videos. There you can copy-paste your text field into a data textarea, make sure to configure Field separator correctly (\t for copy-paste from Excel, semicolon (;) for CSV, or other separator if you are using plain text file). In most cases Line separator should not be changed. Then you need to select list of Fields in the exact order you have in your import data. IMPORTANT! Some CSV files may have separator at the end of every line, which actually means that there is one more empty field at the end of every line. In this case you should add one more additional field and select * Skip this field * option there. If you still have error indicating wrong number of fields in every single line, you should carefully check whether you've selected the correct separator and whether the number of fields matches the number of separators in the line + 1. The number of fields should be +1 all the time! Here are some examples. Single text file import with pipe (|) separator: Specifying data in Excel and then copy-paste: When using import functionality it is very important to understand which data you need to provide based on which video content type you are trying to import. Video upload: you should either provide video file URL in Source video file (with processing) field, or one / several Video file "XXX" (without processing) fields. Video hotlink: you should provide video file URL in Hosted file URL (hotlinking) field. Additionally you may specify Duration and Overview screenshots (sources comma-separated). If you don't provide duration or screenshots in import data, KVS will have to download the file you are hotlinking for detecting its duration and screenshots. This may significantly increase video processing time. Video embed: you should specify Embed code (embedded video) field. In addition if you also specify Hosted file URL (hotlinking) field, KVS will temporarily download file from this URL and will detect duration and screenshots automatically from it. Otherwise if you don't know video file URL or you don't want KVS to spend time on its download, you should specify Duration and Overview screenshots (sources comma-separated) fields. Pseudo video: you should specify Outgoing URL (pseudo video) field. In addition if you also specify Hosted file URL (hotlinking) field, KVS will temporarily download file from this URL and will detect duration and screenshots automatically from it. Otherwise if you don't know video file URL or you don't want KVS to spend time on its download, you should specify Duration and Overview screenshots (sources comma-separated) fields. Import feature supports the huge list of other options, but for novice users in most cases you don't need to touch them and better use everything by default. If you import many videos, you may need to look at post date randomization options, so that you can import videos to be published in some future or past period. For example you can import 1000 videos as they have been added one by one since 2010. Anyway, you can always do the same via massedit feature, so not something should be really important during import phase. After you submit the import, KVS will validate each single line and will show you summary so that you can confirm it. The validation may take much time depending on your input data. By default KVS validates all URLs to be valid, which may take some time. You can disable URL validation in import options. It is recommended to start with several lines first to make sure you understand the concept. When looking into import validation summary you will be able to see all errors and warnings. Warnings are not critical, they just indicate potential issues in your input data, which are not necessary real issues. Errors are critical and indicate the lines that can't be imported. If there are any lines without errors, you can still confirm import and lines which have errors will be simply skipped from being imported. If all lines have errors, you will not be able to confirm the import. After you confirm import summary, KVS will create a background task for import. You can see import tasks in Administration -> Imports log. There you can see data submitted with each import as well as import status and log. All imports are processed on background. You don't have to wait for anything here. Import tasks may have errors, even if validation didn't find any issues. There may be issues with downloading files, network issues and some other. IMPORTANT! If you submitted an import but you don't see any videos added, you may need to go to Administration -> Imports log and look at what is going on there. It may be that all import lines failed. Looking into import log will help you understand the issue. It may also be a case that your import is stuck due to lack of free space on your main server (since import in most cases download new files to your server there is a protection to check disk space, so that your HDD is not 100% filled). In this case import will automatically continue as soon as more free space is available. When you use this functionality really often, it may help to create an import pattern, so that you do not select the same options every time. You may define as much different import patterns as needed, then you just need to select the needed pattern and copy-paste import data. The rest of options will be defaulted from import pattern. Uploading video files via FTP and use FTP content uploader plugin If you already have a list of video files and want to quickly upload them into KVS, the easiest way is to use FTP content uploader plugin. You just need to create a folder somewhere under your www root and upload all your video files there. Then in FTP content uploader plugin you should specify full server path to that folder, or relative path under your www root (not starting with /, e.g. upload for http://domain.com/upload folder). Each video file in this folder will be treated as a standalone video and will be uploaded into KVS with just a few clicks: In advanced scenario here if you want to upload multiple formats for the same video as well as screenshots and / or description, you may need to create subfolders for each video. All files in a subfolder will be considered to belong to each video. The following rules will be applied: Subfolder name means title of a video. ZIP file means list of screenshots uploaded for a video. JPG file means main screenshot uploaded for a video. TXT file means description specified for a video. Video files in subfolder may be treated differently based on your selection in Video formats option: -- If you want to upload as a source file with processing, then the biggest video file will be chosen as a source file, other video files will be ignored. -- If you want to upload as format files without processing, the plugin will compare file names with video formats to find postfix matching. As a result, plugin will show you a summary of all detected files and after you confirm that, they will be uploaded as videos into KVS. It is recommended to enable delete option (if not a problem that files will be deleted), because this will use rename operation on filesystem, which works instantly in comparison to copy operation. Using this plugin will not allow you to specify other data, such as categories, tags and etc. It is expected that you want to create videos first and then you may manually edit them in admin panel, after they are imported. If you want to specify all this data at import time, you need to consider using import feature (2). Since your video files are already uploaded on your server, you just need to specify their URLs for the import to take them. At the same time you can also specify other data needed. Automating mass importing videos with a feed This feature should be used in the following cases: Import data is regularly updated and you want to automate importing the updates. You want to automatically sync content between 2 or more KVS projects. You have a software that uploads video files to your FTP and you want then to auto-import them (for example CCTV or webcams). To access this functionality go to Videos -> Add importing feed section. Feeds are very similar to mass import described in previous section, but the main purpose of a feed is to automate importing without your intervention. Every feed can be configured to query a text file from the given URL every given interval and add all new content that appears in this text file. Many options here are very similar to mass importing options: for plain text file format you need to specify field and line separators and select list of data columns. When a feed gets executed for the first time, it will add all available content from the given file if you don't specify any limit. Starting from the next execution feed will only add new content that appears in the text file. Here it is very important to understand how duplicates are being calculated. First of all you should specify Duplicates prefix - any unique string for this feed. Then if using CSV / plain text format you should also indicate the key field from this file - a field which is unique for every line. It can be video ID, or video URL or title - any unique field. Duplicates prefix is needed for cases when you need to separate content between different feeds. Imagine that you used video ID as a key field. If you import data from multiple providers by using multiple feeds, IDs may overlap there, e.g. video #1234 may exist at both provider 1 and provider 2. If KVS only used ID to identify duplicates, it would end up by considering video #1234 from provider 1 and video #1234 from provider 2 as duplicates, so one of these videos wouldn't get added. But if you specify Duplicates prefix unique for each feed - this will not be a problem anymore. Video #1234 from feed 1 will not be a duplicate of video #1234 from feed 2. At the same time, you may have several different feeds adding content from the same source (for example 1 feed is pulling all videos from Category 1 and another feed is pulling all videos from Category 2). Since these feeds pull content from the same source and the content may overlap, you should specify the same value for Duplicates prefix for both feeds. Because a single video #1234 may have both Category 1 and Category 2 and thus it will appear in both feeds. If you've specified different prefixes, this video will be added twice. But if prefixes are the same - videos #1234 in both feeds will be considered as duplicates. Grabbing videos from 3rd party sites KVS features extremely powerful tube grabbers plugin. With this plugin you can import tons of content, even if you don't have any. We will not speculate on whether it is ethic or not to grab content from 3rd party sites, you should decide this yourself. In order to use grabbers you first need to install and configure some. KVS provides a list of most popular tube grabbers and from time to time we expand it with new grabbers. There is also a default video grabber which can download videos from abstract tube sites. However specific grabbers are more powerful: They may support embed codes if source site provides them. They may support additional video data, such as categories, tags, models, rating, views, date, etc. They may support downloading video files in multiple qualities, so that you don't need to convert them on your server. Most of video grabbers require youtube-dl library to be installed on your server. If you don't have it, please ask host support to install it for you, otherwise it won't be possible to use many grabbers. After you install some grabbers, you should configure them. You should select Mode option to indicate whether you want this grabber to download, embed or add videos as pseudo videos. Then you also need to choose which data fields you want to grab; the set of fields is different for each grabber and is based on which data can be parsed from the grabbed site. Finally there are filtering options, that help you to maintain grabbed content quality. IMPORTANT! when you want to use grabbers to download videos to your server, like with any other methods you can decide whether you want the downloaded video files to be processed, or you want them to be saved without processing. Here you can use 2 different tactics based on whether your project has enough computing power or not: If your project doesn't have much computing power, it makes sense to download all files without processing. In order to configure this you should set Multiple value for Quality option and then based on the number of video files provided by grabber match your video formats: If your project has enough computing power, it may be faster for you to download only 1 single file from grabber and have other files created by KVS. This may work faster, because download from grabbers is typically slow due to speed throttling by the source site. In this case you should select the needed file under Quality option and assign it to the correct format; so that all other formats will be created by KVS: NOTE: in some cases if you want to process all files, even the downloaded one, you will need to set upload as Source file. One important issue you'll find when using grabbers is how to manage your categorization efficiently. Different sites may have many similar categories named differently, so that grabbers may create too many categories in your database. There are several workarounds to deal with this described in Categorization best practices article. There are 2 ways you can import videos from grabbers plugin: you can import videos manually or you can configure grabbers to ping video lists from time to time and add videos from these lists. When using grabbers for the first time we recommend running manual imports first to understand how grabbers work and whether the grabbed videos are in the way you want them to be added. In order to import videos manually you should go to Upload content using grabbers manually section in grabbers plugin. There you need to specify list of URLs you want to grab. In this list you can specify both individual videos (if you want to pick each video yourself) and also you can specify video list URLs or video RSS URLs to grab the whole lists. Here is where you can feel the real power of using site-specific grabbers - you can use your browser to navigate source site and find a page which lists the needed videos - this can be a page listing all top rated videos, or most viewed videos for the last week, or videos from a specific category, or videos from a specific user and etc. You can then copy-paste URL you see in browser address field and grabber will open that page and will add all videos from it. Many tube grabbers also support pagination mode, which means that grabber will be able not only to add all videos you see on that URL, but also to navigate to page #2, to page #3 and etc. of a paginated list and find all videos there as well. In order to enable that, you need to specify a number of videos you want to grab right after the URL separated by pipe symbol, e.g.: https://www.kvs-demo.com/top-rated/|1000 This command tells KVS grabber to import 1000 videos from this page. If this page is a paginated list and shows only 50 videos per page, and the grabber supports pagination, KVS will query 20 more pages from this list to add 1000 videos in total. Using this approach you can mass import 100 top rated videos from every category on the site by simply specifying URLs to category pages and number of videos you want to grab from them. If you do not specify a number after list URL, KVS will add only those videos that are displayed initially on this page, e.g. only 50 videos for this sample top videos list: https://www.kvs-demo.com/top-rated/ Finally, when you have imported sample list of videos and you are happy with them, you can move forward and configure auto-pilot. Auto-pilot is exactly the same as importing manually via specifying list URLs and counts. The only difference is that auto-pilot will do that automatically for you, e.g. it will query the specified pages every N hours as you configure and will check if there are any new videos there. Therefore if you want it to import new videos every time, you should make sure to provide list URLs, which are sorted by new videos first. If you recall our previous example the top.html will not work here, since top lists are rarely updated. Instead in auto-pilot settings you should specify URLs which are updated every N hours you plan to query for new videos, for example latest videos page: https://www.kvs-demo.com/latest-updates/|100 By setting the above URL to auto-pilot you will require KVS to grab new videos from this website every N hours. Then you simply do not need to upload any videos manually, because they will be added and added every N hours you configure (if the source site is updated of cause with the new videos). If you want to grab only from specific categories, or tags, or models or whatever, you will need to specify multiple URLs, each for the list you want to grab, e.g. like this for grabbing from 3 categories: https://www.kvs-demo.com/categories/rock-music/|100 https://www.kvs-demo.com/categories/house-music/|100 https://www.kvs-demo.com/categories/pop-music/|100 While you can also use RSS with grabbers, using the URLs gives you much more power than RSS. In most cases you can adjust sorting or even do some filtering in the URL, so that grabbers only import content you'd like to appear on your site. Here are some important highlights with using tube grabbers in KVS: Use specific grabbers designed for specific sites, they support more options. If no specific grabber is available for the site you want to parse, you can try using default video grabber if it suits you (this grabber only supports download mode). But this grabber won't support 100% sites, it can only grab from sites that do have video URLs clearly printed in HTML code. When downloading from other sites, your IP may be blacklisted for frequent downloads. KVS has no control on that other than letting you specify timeout to avoid frequent requests. Some grabbers support proxies that can be listed in their settings. Try importing manually first before you configure auto-pilot. If you want to grab initial set of content, grab it manually and use auto-pilot for pulling new videos. Use web URLs instead of RSS to download from video lists. Make sure videos in the list are filtered and sorted in the way you want to grab them. You can still use RSS if you want to. Default grabber only supports RSS lists. Grabbers may become broken from time to time if source sites gets updated. If you find this issue, please report to KVS support and we will update the broken grabber to be working again. With KVS you can create your own grabbers and use them on your projects. You can find more details in How to create custom tube video grabber for KVS article. Combining grabbers and mass import Grabbers plugin can import many videos from other sites, but sometimes you may need more flexible way to grab video files and at the same time specify your own title, description, categorization and so on. In this case you can combine grabbers functionality to download files and mass import flexibility to specify data. However in this case you need to manually select videos and specify their direct page URLs, grabbing multiple videos from lists will not be possible. In order to use grabbers in mass import you should specify video page URL in Video page URL (grabbers) field. Then you can also specify any additional data you need. The key point here is that your custom fields specified in import data will override fields from grabbers. For example you can specify title and categories, so these fields will be taken from import. All other data will be taken from grabber. Using this approach will take much of your time to prepare data, but you will also benefit from more accurate and unique SEO, which is best for your project.
  18. KVS supports different content types for videos (uploading, embedding, hotlinking and other), here is full information about them: What video types are supported in KVS tube script and how they are different. When using upload content type, you upload a source video file into KVS and then let KVS process it and store it using KVS storage system. During video processing phase KVS will create all required video formats defined in your settings. KVS will also try to create all conditionally-optional video formats, if the uploaded source file meets their size and duration limits. The most common example here is when you have multiple video formats defined for multiple qualities, e.g. 360p, 480p and 720p. In such scenario 360p should be configured as required format, 480p and 720p should be configured as conditionally-optional formats. So that 480p and 720p are only created for source video files that allow resizing them to 480p or 720p respectfully. For example if you upload source file in 720p - all 3 formats will be created. If you upload source file in 480p - only 360p and 480p will be created, 720p format will be skipped. For source files with 360p or less quality KVS will only create 360p format, because this is the only required format in this configuration. When using the described approach you don't need to think about source file original quality, all you need is to upload it as a source file with processing and KVS will then create all necessary formats. This processing will however take much time, because operation to create one video file from another uses your server resources very intensively. There can be scenarios when you will want to skip this processing: You don't need to have multiple video formats, you need to show video in only one quality. You already have video files in the needed format(s), for example you already prepared them using desktop software or you import existing video files from external sources. You don't need any resize or watermarking on video files. KVS provides ability to skip video processing for all or some files. In order to do that you should upload your video files not as source files, but directly into the needed video format(s). When a file is uploaded as a video format, KVS will not do any re-conversion with this file, the file will be saved in the same form as you've uploaded it. By doing this you can significantly decrease video processing time, but there are certain limitations you should be aware of: No watermarking will be applied to the uploaded file as well as no resize and duration trim. You should make sure that the uploaded file has valid format (e.g. if you upload it into MP4 format, the file should be a valid MP4 file, not any other video file). If you try to upload an invalid file, most probably there will be an error thrown during processing phase, however this depends on your ffmpeg version and it is also possible that there will be no error and you will end up with a video that is not playable via web player even if you can play it with your desktop. If you have multiple video formats, you can choose to upload them all and fully skip conversion, or upload only one of them and let KVS create the rest. Depending on which functionality you typically use to upload videos into KVS, they all provide ability to upload in both ways. Naming convention for this option is as following: Source file (with processing): means that the uploaded video file will be considered as a source for all video formats that will be created by KVS. Format "XXX" (without processing): means that the uploaded video file will be uploaded directly as the given format, so it won't be processed by KVS (other formats may be created from it if required). Manual video adding When adding videos manually you can see a field to upload as a source file (Source file) and separate fields to upload into each specific video format (e.g. Format "XXX"): Videos mass import In mass import for each field you can either select if it should be considered as a source file (Source video file (with processing)), or as a specific video format (Video file "XXX" (without processing)): Videos importing feeds In importing feed settings you can choose whether all video files from this feed should be considered as source files (Source file (with processing)), or as files of a specific format (Format "XXX" (without processing)). Importing feeds do not support uploading multiple files in multiple video formats: FTP content uploader plugin Using FTP content uploader plugin is quite tricky if you have multiple video formats and want to upload them as formats without processing. In order to do that you should name your video files based on postfixes you have in video formats. For example if you want to upload only 1 format per each video, you can still put all video files into 1 upload folder, but make sure that their file extension match the postfix of the video format you want it to be uploaded to, e.g. test.mp4 will match video format with .mp4 postfix. Also you should set Video formats option to detect postfixes: If you want to upload multiple video formats for each video, then you should put files for the same video into a subfolder under your upload folder. Each file should have filename based on video format postfix you want it to be uploaded to, e.g. test.mp4, test_480p.mp4 and test_720p.mp4 for formats with .mp4, _480p.mp4 and _720p.mp4 postfixes. Then on summary page you can check if all the formats have been detected as expected: Grabbers plugin In grabbers plugin if you want to download only 1 video file, you can simply select whether it should be considered as a source file or specific format file under upload as option: If the source site provides multiple video formats, you can download as many of them as needed and upload as specific video formats. In order to get these fields displayed you should switch Quality field to Multiple value: NOTE: downloading multiple files from grabber could be slowly due to bandwidth throttling on the source site. If your project's conversion power is high, it may be faster to download only 1 file and then create other formats via KVS. Summary Uploading as a source file with processing: Should be used by inexperienced users. You can upload any source file with any quality (480p, 720p and etc), KVS will automatically decide which formats to create. KVS will create all the needed formats with all their settings, e.g. watermarks, quality, duration trim. Works slow due to video conversion utilized. Uploading as a format file without processing: Should be used by experienced users if all restrictions are not a problem (you don't need watermark and etc. see below). Video file format and quality (480p, 720p and etc.) should exact match video format settings. No watermarking, quality change and duration trim will be done. Works incredibly faster.
  19. There are multiple ways you can do that in KVS. The proposed best way for most users is to use admin flags to set up featured videos section. This approach can be used not only for featured videos / albums, but also for creating other similar sections when you need to manually select content that should appear in them: preview gallery on index page, contests, featured content and similar. First you need to go to Categorization -> Flags and create a new flag under videos group. You can set any title / external ID, title is only used in admin panel for you, while external ID will be used to refer to this flag when configuring list_videos block to filter only videos with such flag. Here is what we've entered: Title: Featured video External ID: flag_featured_video Admin panel: enable Use this flag as administrator's flag for content Now you can go to individual videos and set this flag in Administrator's flag field. All videos you apply to this flag will be subjects to display in featured block on your site: Finally you need to show them on index page (or other page if you need so). In order to do that go to Website UI -> Pages -> Index page and add list_videos block into desired place of template where you want to display featured videos: {{insert name="getBlock" block_id="list_videos" block_name="Featured Videos"}} After you save page changes, KVS will create a new block on this page named "Featured Videos". You can now edit settings of this block by clicking on block name in pages list: You should set up block template and configuration parameters. You can use the following block template, which will render list of videos in most KVS themes without any issue: <div id="{{$block_uid}}"> {{assign var="list_videos_title" value="Featured Videos"}} {{include file="include_list_videos_block_common.tpl"}} {{assign var="pagination_no_links" value="videos"}} {{include file="include_pagination_block_common.tpl"}} </div> For parameters you should use: items_per_page: set the number of featured videos you want to display, e.g. 12 show_with_admin_flag: here is where you configure this block to filter only videos marked with Featured flag, set flag_featured_video here to refer the flag ID you've created for this sort_by: select sorting you need Make sure you also set cache lifetime in this block settings. If content of this block is not changed often, set it to 86400 seconds, which means 24 hours. After you save this block settings you should be able to see featured videos block on your page with the videos you selected by using admin flag.
  20. KVS supports 4 types of videos which are different by storage model and how users see them. Here is summary with explanation of pros and cons for each video content type. NOTE: there is no way to migrate videos from one content type to another. You have to chose what you are going to use from the very start. However you can mix videos with different content types on your project, there is no issue with that, but functionality of each video will be different depending on its content type. Video upload This is the most common content type used. You upload source files or ready-made format files directly into KVS and KVS stores them on your server(s) / CDN and serves them from your server(s) / CDN. This content type allows you full control on everything about these videos: Can be easily uploaded from local disk or link, no need to specify additional info; Supports multiple formats (if you have KVS Advanced or above); Supports timeline screenshots; Supports download speed limitation; Supports hotlink and download protection; Supports creating new video formats if needed (if you have KVS Advanced or above); Supports moving files between servers; You can use your own player and advertising strategy. There are 2 main drawbacks with using this approach: Since the files are stored on your servers or your CDN, you pay for storage and traffic; Additional time and server resources are needed to convert such videos and push them to your server(s). Video hotlink This content type means that your videos hotlink (directly use) video files located on other servers, which are allowed to be hotlinked publicly. In this case KVS is not responsible for any aspect of these video files: if they are valid for HTML5 playing or not, if they are available or not, if they are deleted or not and etc. So for example if you hotlink 3rd-party files and their owner decided to move them another server and in most cases they will not bother about putting valid redirects - all your videos will become invalid and you can't do anything with them except deleting. Another aspect here is that KVS needs to detect duration and take screenshots, so having a plain link won't work for this. There can be 2 options here: You manually specify duration and upload screenshot(s) for each such video; You don't do that and KVS will download video files from the given link for conversion, then this temporary file will be deleted. This can take much time depending on file owner's server download speed. Sometimes if you import these videos from sponsor sites, the import data will contain duration and screenshot(s), so this won't be a problem. Pros of using this content type: Superfast processing if you specify duration and upload screenshot(s) manually; No CPU resources needed for conversion; No storage resources needed; No traffic usage; You can use your own player and advertising strategy. Cons: You have absolutely no control on these files, they can be deleted or moved and this will affect your project immediately; Multiple formats and timeline screenshots for hotlinked videos are not supported; Video files available for public hotlinking are usually streamed with a very slow speed and your users won't be happy. Video embed This content type is very similar to hotlink, but instead of specifying video file URL you specify embed code (the whole player code). Also here you don't have choice either to specify duration and screenshot(s) manually or not - you must specify them. But this is not a problem since in most cases embed codes are massively imported either via manual import, or automatically parsed from other sites together with duration and screenshots using KVS tube grabber plugin. Pros of using this content type: Superfast processing, you can import 1000s of embed codes within a day; If using embed codes from HQ tube sites their usability will also be high and your users will be satisfied; No CPU resources needed for conversion; No storage resources needed; No traffic usage; Good approach to promote one of your tube sites with using its embed codes on other sites. Cons: You have absolutely no control on player and advertising strategy in player, monetization may suffer; Some embed codes will automatically redirect users to their sites when users initiate player, which is not good for your SEO; If source site is hacked with malicious code, your site's users will also be affected via iframe embed codes. Pseudo video This is a very specific content type to promote one tube site via set of another tube sites or to be used in link trade schemes. Such videos have no content to play on your site. They only have screenshot, duration and link to a target video page, which are in most cases imported automatically by tube grabbers or feeds. KVS supports 2 behaviors for such videos (can be switched via Settings -> Website Settings -> Pseudo-video behavior option): Clicking a video on your tube's list page will directly redirect user to the target site, either via direct URL, or via pseudo-URL on your site; Clicking a video on your tube's list page will show video page on your site, but instead of player there will be poster image + play button linked to the target site. There are no pros and cons for this video content type like for others. It is designed to be used for specific cases and other content types won't suit here.
  21. Starting with KVS Advanced you can show video previews for every video in the list instead of single or scrolling thumbs. Here are some important notes and prerequisites before you start If you have many videos, creating previews can take much time, up to many months! You should make sure that each storage server has enough space to store up to 1mb for each video. Each preview will take 600-800kb, so showing this for every video will increase your traffic usage. Steps on how to enable video previews Step 1. In admin panel go to Settings -> Add video format and create new video format with the following data: Title: MP4 preview Postfix: _preview.mp4 Video type: Standard videos Status: Active optional (you can set Active required here if you don't have videos or have only few videos) Video size: Resize video according to: NxM Enfore this size (replace NxM with exact size you need video to be displayed in lists) FFmpeg options (-crf 28 is a compression quality, use lower number for higher quality): -vcodec libx264 -movflags +faststart -threads 0 -r 25 -g 50 -crf 28 -me_method hex -trellis 0 -bf 8 -an -f mp4 Limit duration to: 20 seconds (or any number you want it to be) Number of parts: 4 (or any number of parts you want it to be) Other fields under Duration limitation section - as per your needs. Save it. NOTE: if you selected Active required status and you have any videos, KVS will automatically create tasks for creating these files for all your videos. You should use Active optional status if you have many vids. You can see this video format in action here in KVS tube script demo admin panel: http://kvs-demo.com/admin/formats_videos.php Step 2. Now it is time to create video previews for some test videos. Please skip this step if you already selected Active required status for preview video format. Go to Videos list. Select some test videos (the ones you can see on your latest updates page) and under Batch actions select Mass edit selected. You will see the mass edit GUI. Scroll down to Content section and select MP4 preview format under Create / Re-create format files: NOTE: Make sure you didn't select anything else in the big set of options. Apply changes. In Administration -> Background Tasks section you can now see list of tasks to create preview files for the selected videos. You should wait until they are processed, this may take a while. If there are errors on these tasks, please contact support. Step 3. Go to Website UI -> Theme Settings and select MP4 Preview format in Video preview format option. Step 4. If preview creation tasks are finished at this point, go to your latest videos and try mouse over the test videos you've chosen to create preview files. You should see the video previews playing. If you don't see them, try refreshing your browsers cache with Ctrl+F5. Step 5. If you are OK with the quality and functionality of your test previews, you can enable them to be created for all videos now. Go to Settings -> Video formats -> MP4 Preview and change status to Active required. NOTE: this will create tasks for all your videos, which can take long time. All new videos will have this format automatically. Styling waiting icon You can modify the following CSS style in your site's style file: .list-videos .img.preview-loading:after { display: block; position: absolute; content: ''; width: 25px; height: 25px; background: #000000 url('../images/loader.gif') 2px 2px no-repeat; bottom: 5px; right: 5px; z-index: 1; } Troubleshooting It is not possible to create a new video format. This is not possible if you have KVS basic license. Basic licenses do not support multiple formats and will not allow you using this feature. Tasks for creating preview files failed. Please create ticket for support, there can be many reasons and need investigation in your admin panel. Video previews are not displayed. Are you trying on the test videos you have selected for massedit? Please open them in admin panel and check if they have preview formats created: Did you try resetting browser cache with Ctrl+F5? Are you using the same browser where you logged in admin panel? If using different browsers to test this functionality you should log in to admin panel in each browser. Otherwise you can see the cached page version which has not yet been updated with this new feature.
  • Create New...