Jump to content

Search the Community

Showing results for tags 'conceptual'.

  • 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 12 results

  1. 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.
  2. 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.
  3. KVS serves and stores different types of static content, like video files, photo images, video screenshots, user avatars, theme design styles / scripts. For video files and album photos KVS supports multi-server architecture and this is completely another story described here. This topic describes how to move static to CDN or another server for the rest of static content. Theme design files These are typically files located under /static folder on your main server. In most cases you will need to move these design elements to CDN for faster load. You should do that manually following any guideline you have for CDN. Please note that you should also check with CDN guide / support about crossdomain security issues (for example fonts can be only loaded from another domain if they provide Access-Control-Allow-Origin "*" header and etc.) From KVS side you only need to adjust one option in /admin/include/setup.php file: $config['statics_url']="$config[project_url]"; By default it points to the project URL, you should change it to your CDN: $config['statics_url']="//cdn.domain.com"; It will force all design static files to be loaded from this domain. NOTE: If your project is running under HTTPS, you should use CDN which also supports HTTPS. In most cases CDN will cache files from your original server for some time (can be forever). If you do any changes in these files on your server, your site will still continue using old versions. You may need to reset your CDN cache so that it pulled new versions. Another option is to increment version of the modified file when it is linked from template (not sure if all CDNs support this). For example templates use this tag to include CSS style file: <link href="{{$config.statics_url}}/styles/all-responsive-white.css?v=5.0" rel="stylesheet" type="text/css"/> If this file is loaded from CDN and you modify it, you can increment its version so that CDN will update it from your server again. The actual numbers don't matter, it should be different from the old one: <link href="{{$config.statics_url}}/styles/all-responsive-white.css?v=5.0.1" rel="stylesheet" type="text/css"/> Video screenshots from CDN By default video screenshots are stored under this folder on your main server: /contents/videos_screenshots You can move them to CDN as well, however you should consider the problem of invalidation here. Screenshots can be changed from time to time in admin panel. For example if you create 20 screenshots per each video and then leave only 10 best screenshots, or if rotator automatically removes badly clickable screenshots, your CDN will still show the old ones incorrectly. There is no solution for this issue from KVS side, you should check with your CDN provider on which options are available. For example they can ping files from your server from time to time and check if they were changed or not. But if you don't commit any screenshots editing you will probably be fine with leaving this as it is, since in your case the files will unlikely be changed. In order to switch screenshots to CDN you should first configure CDN per their guidelines and then in /admin/include/setup.php file of your KVS installation you should modify this URL: $config['content_url_videos_screenshots']="$config[project_url]/contents/videos_screenshots"; Please make sure to modify the correct option, as there are some similarly spelling options around. Your change should be something like: $config['content_url_videos_screenshots']="//cdn.domain.com/contents/videos_screenshots"; NOTE: If your project is running under HTTPS, you should use CDN which also supports HTTPS. If you want to make screenshot loading even faster, you can define alternate URLs for screenshots via different subdomains. The reason is that browsers do have limits to the number of concurrent connections for a single server (~6 at the same time). If there are many screenshots on your page they will be loaded in portions, but you can make this happen in parallel by loading them from different subdomains. They should all be configured as aliases for the same server and should serve the same content. In order to do that there is another option in /admin/include/setup.php config file: $config['alt_urls_videos_screenshots']=array(); You can list several alternate URLs there in the following format (make sure you retain the correct syntax or you may brake the code): $config['alt_urls_videos_screenshots']=array("//cdn2.domain.com/contents/videos_screenshots", "//cdn3.domain.com/contents/videos_screenshots"); This will force KVS to randomly load screenshots from these 3 URLs: //cdn.domain.com/contents/videos_screenshots (configured as main URL) //cdn2.domain.com/contents/videos_screenshots (configured as alternate URL 1) //cdn3.domain.com/contents/videos_screenshots (configured as alternate URL 2) Video screenshots from another server but not CDN If you want to use another server for serving video screenshots, you have 2 options: Option 1. Use rsync to push updates in KVS /contents/videos_screenshots folder to another server. This should be configured by your server admins. In this case you need to modify screenshots URL (see Video screenshots from CDN section). However this approach is not recommended, because rsync works asynchronously with some delay, so the common problem is that for new videos the screenshots may not yet been synced to remote server. If you know the interval between each rsynс push, you can workaround this problem by configuring KVS to postpone new content for some time. You should then change this option in /admin/include/setup.php: $config['post_dates_offset']="0"; It indicates the number of minutes all new content will be delayed. For example if rsync works every 1 hour you can configure it to be 70 or 80 minutes, to make sure that screenshots of new videos have been pushed to remote server in the moment when video appears on your site. Option 2. The second option is to move the whole screenshots storage folder to a remote server using network filesystem (NFS mount). This can be a good solution if remote server is located with the same datacenter for stability reason. You should ask your admins to create writable NFS mount to the remote server and move all existing content from /contents/videos_screenshots there. Then you should modify these 2 options in /admin/include/setup.php file: $config['content_path_videos_screenshots']="$config[project_path]/contents/videos_screenshots"; ... there are some other options in between ... $config['content_url_videos_screenshots']="$config[project_url]/contents/videos_screenshots"; The first option is a filesystem path and the second one is URL. Your changes should look like this: $config['content_path_videos_screenshots']="/mnt/server2/contents/videos_screenshots"; // should be a real path of the mounted folder ... $config['content_url_videos_screenshots']="//server2.domain.com/contents/videos_screenshots"; NOTE: If your PHP is configured with open_basedir restriction you should also update it to include /mnt/server2 path, otherwise KVS will not be able to write new screenshots into the mounted folder. You can check if this folder is writable or not with KVS audit plugin. Using the 2nd approach is more preferred, as there won't be any delay in screenshots availability. But it needs stable connection between servers. Other static files Other static files are normally user avatars and images of categorization objects like categories, channels, models. You can use the same approach for them as for screenshots, either move them to CDN (see Video screenshots from CDN), or move to another server (see Video screenshots from another server but not CDN). The only difference is in what options you should change in /admin/include/setup.php. Here they are: $config['content_url_categories']="$config[project_url]/contents/categories"; // URL for categories $config['content_url_content_sources']="$config[project_url]/contents/content_sources"; // URL for content sources $config['content_url_models']="$config[project_url]/contents/models"; // URL for models $config['content_url_dvds']="$config[project_url]/contents/dvds"; // URL for channels / series / DVDs $config['content_url_posts']="$config[project_url]/contents/posts"; // URL for posts $config['content_url_avatars']="$config[project_url]/contents/avatars"; // URL for users $config['content_url_referers']="$config[project_url]/contents/referers"; // URL for referers, not used in most cases $config['content_url_other']="$config[project_url]/contents/other"; // URL for uncategorized static files By default these all point to your main server, you can switch them to CDN or another server in the same way.
  4. KVS tube script has very simple and at the same time very powerful storage system, which provides the following benefits: Unlimited storage space - add new servers / HDDs any time you need. Support for traffic load balancing - can serve the same content from multiple servers at the same time. Reliable protection from hotlink and unauthorized access. Easy migration - admin panel can migrate content to another storage automatically. Storage system settings are located in Settings -> Storage servers section in admin panel. Storage system is used to store video formats and album files (images and ZIPs). NOTE: video screenshots are not stored in this storage system, they are stored locally with the main site. However there are some workarounds to move them to another server if needed, which is described in this article: How to move static files to CDN or another server in KVS NOTE: since videos support 4 content types, only 1 content type is using KVS storage system: video upload. Other content types (hotlink, embed, pseudo) do not have any video files that need to be stored on your servers. When adding videos into KVS you should make sure you do not mix between video upload and hotlink, because both can be added using video file URL, but the difference is that video upload will process and store the downloaded file in KVS storage system (with all its benefits), while hotlink will be using the specified URL directly. You can read more about video content types in this article: What video types are supported in KVS tube script and how they are different Though the concept is very simple and straightforward, many KVS users do not understand it and tend to use it in wrong way. Let us try to explain it in more details here. NOTE: Storage systems for videos and albums work exactly in the same way. So we will only describe videos. Storage groups and servers When videos or albums are uploaded into KVS, they are stored not on storage servers directly, but on storage groups instead. A group can contain multiple storage servers, which is needed when you want to load balance the same content between multiple servers. We will say this in another way: if a group has multiple servers, ALL CONTENT of this group is DUPLICATED on all its servers even if some servers are deactivated. Each video of the group is stored on every server of this group. The common mistake when trying to move content to another server is to add the new server into the same group and disable the old server. NOTE: disabling server in storage system doesn't mean that KVS won't copy content there. KVS will duplicate content between ALL servers added to the same group. Disabling a server means that KVS won't use this server when streaming videos to users, but it can be enabled back at any time and immediately it will start serving all the content stored on it. So in most cases you should have 1 group = 1 server there. You should only add multiple servers into the same group in these cases: You want to load balance streaming between 2 or more servers. You want to have a backup server with all your content. You want to manually move content from 1 server to another. But in this case after content migration you will need to delete old storage server and finally leave only 1 server in the group. Sample diagram Sample diagram shows all storage system concepts in 1 screen. Storage group 1 has 2 servers and you can see that both Video 1 and Video 2 are stored on both servers. Storage group 2 has only 1 server, which stores completely another set of videos: Video 3 and Video 4. Here is KVS configuration for this storage system: Adding more space to storage system In order to expand your storage system you should create a new server group which will host new videos. Then you should add a new storage server into this new server group. That's it! In most cases new content will be copied to your new server group and thus new server under it. However in Settings -> Content settings there is an option which configures default storage for videos (and same option for albums). By default this option is configured to autodetect group with the most free space. If you added a new server group with more free space but the new content is still being added to the old server group, most probably you have changed this option, so please check if it is set to autodetect: Traffic load balancing between storage servers Why would you need this in the era of CDN? Here are some common cases: CDN can be more expensive than 2 standalone servers in US and Europe. So you can save by adding 2 servers instead and use GEOIP load balancing between them. For CDN you usually pay for 90% traffic peak. You can reduce this payment by serving low-profile countries from standard server (use GEOIP load balancing) and thus reducing traffic usage of your CDN and reducing monthly payments. In order to use load balancing you will need to add 2 (or more) servers into 1 group. If your storage group already hosts some videos, you will need to sync content on the new server by using sync option for it (this option is available on servers list). After using sync option KVS will create a background task for this operation which may take some time. If no content is hosted by your group, you don't need anything else, just add 2 servers into 1 group and configure their load balancing if needed in group settings: Moving content to another storage server Add new server into the existing group and use sync option to copy all existing content to this server. Sync option will create background task and you have to wait for it to be completed. Then after you checked everything you can delete the old server from KVS and the group will have 1 new server. NOTE: When a new server is added to a group which already hosts some content, this new server will be disabled by default, so KVS won't show it to users and you will have as much time as needed to manually copy all the content. Your site will still continue serving content from the old server until you manually activate the new server. So basically here are the steps: Add new server into the existing server group. Sync new server with all the existing content. Wait for sync background task to be finished, it may take hours or days depending on how much content you have. Activate the new server, deactivate the old server. Verify that everything is working, your content is functional. Delete old server from server group.
  5. The world is changing and being able to put ongoing changes into your running site is essential need of any successful project. KVS regularly adds new features and some of these features are not brought into themes, so you have to add them manually. However doing changes on a live site brings some risks to harm site operation. In this article we summarize the possible configuration scenarios for ongoing site development and their disadvantages. Working on production theme The most typical scenario and very good for small projects. However actively working with regular changes may bring some issues. Pros: No specific configuration or procedure needed. Changes are applied immediately. Cons: Harmful changes may result in project unavailability for some time until sorted out. Intensive template changes may result in regular cache reset, which could impose performance issue when modifying top-visited list-block templates. Difficult to work in development-testing iterations, when partial changes applied, then tested, then next set of changes applied, and etc. Security considerations (should provide access to 3rd-party developers). DEV satellite DEV satellite is very useful for the new theme development, when you need to spend a lot of time with either re-design, or a new design for your site theme. While working on DEV satellite you can't harm a working project in any way and you don't need to hurry. When your new theme version is ready, all what you need is to migrate it from satellite to production site. End of story. However using DEV satellite for ongoing minor theme changes is not that safe, as you could assume. The main reason is - when you migrate theme, you can't migrate something specific, you have to migrate everything, including templates, styles, configuration parameters, SEO, texts and even site advertising. Having that in mind, it becomes clear that it is not possible to selectively use DEV for testing 'some' changes - it is either ALL, or nothing. Here is a typical scenario that could happen from time to time: You decided to change something minor in advertising (e.g. replace some ad) and decided to change it directly on production. Then after some time your theme developer started working with a new feature on DEV satellite. After the feature is finished, you migrated theme from DEV to production. Oops, your first advertising change has been lost at this point and you may not even remember about it. Hence the conclusion is - you can use DEV satellite for ongoing theme development only if you stick to strict process of putting all changes into DEV first, then testing them on DEV and then migrating them to production. If you decide to go with this approach, it will be possible for your admins to automate theme migration process and provide command line utility that will copy all the needed files from DEV satellite to production. Unfortunately this can't be automated from KVS side and should be run via command line only due to filesystem restrictions (in most cases Apache won't have enough privileges to copy all needed files, so should be done under a more privileged user). In order to know which files should be migrated, your command line tool can parse the tar.gz archive created by KVS backup plugin. The idea is NOT to extract files from backup archive, but use it to extract filenames for the files that need to be migrated. Here is a command that will locate the latest backup archive and extract the list of filenames relative to project document root: find admin/data/backup -type f -name '*.tar.gz' -printf '%T+\t%p\n' | sort -r | awk '{print $2}' | head -n 1 | xargs tar -xvf | grep '^website/' | sed 's/website\///g' Pros: Your primary site won't be affected in any way until you manually run sync procedure. Possible to configure DEV on a separate server to secure your primary installation, if you don't want to provide your theme developers FTP access to your running project. Cons: Strict requirement to apply every single change via DEV satellite. Long time to apply any change, even very minor. Not possible to optimize performance on the fly. Hard to configure in small teams, needs command line. Creating new versions of pages on production theme This approach seems to be the most usable and best manageable for all kind of projects. Minor changes should be applied directly to production site, as they typically do not harm your project operation. When some big changes are planned, developer should follow this guideline: Duplicate page that needs to be changed into a page with new version in its ID, e.g. for view_video page it should be view_video_v2, view_video_v3 and etc. Duplication of existing page is one click from admin panel: Duplicate the affected page components if needed. E.g if working with new video list design, duplicate include_list_videos_block_common.tpl into include_list_videos_block_common_v2.tpl and switch v2 page to use this new template version instead. Work with new page version / component version without any rush and risk to harm other parts of project. You can access the new page via its direct PHP URL: https://domain.com/view_video_v2.php?id=123 When finished working with page, just change in PHP script in .htaccess rewrite to use the new _v2.php file to enable new page version into production. Deactivate the old page in KVS admin panel to make sure it will not be used and in future it will be clear that this is obsolete version. When finished working with page component, copy-paste the new code into the old page component template and remove the new page component and eliminate all usage of it. There is no sense to keep old and new page components together for history or any other purposes, as KVS keeps track of version history for all templates and will record both old and new versions of the changed component. Unlike pages, components are single files and can be easily restored to any specific version, if needed. IMPORTANT! Make sure you deactivate old page versions when switch to new page versions, or even delete them. It should be clear that specific page versions are not used anymore, otherwise you may have troubles in future, when you need to fix something and you will find yourself in the need to fix bulk of v2, v3, v4 and etc. pages, most of which are not used anymore, but you are not sure which ones. Do not keep trash in your templates! Pros: No specific configuration needed. Small changes are applied immediately. Big changes do not harm working site, and developers have enough time to work with them in their own way and pace. Cons: More manipulations needed to prepare working environment. Security considerations (should provide access to 3rd-party developers).
  6. Theme customization in KVS in most cases won't require any specific programming knowledge except HTML / CSS / JS, which are core web technologies. In addition to that some basic Smarty template language skills are required to be able to generate iterations, conditional rendering (IF / ELSE) and do some basic formatting. Changing design logo, styles and colors Each KVS theme may come with some pre-installed skins, so first of all you should check if there is any skin that closely matches you needs. Please find this in Website UI -> Theme settings page: NOTE: this page also contains a huge list of basic settings that allow you easily switch off or on some site functionality. After you choose the skin you need, the only possible way to edit its look is to modify CSS styles in one of the CSS files used by theme. This will require some basic CSS knowledge for sure. You can find the needed CSS file by looking into the source code of your site index page and searching for rel="stylesheet" (depending on your theme there may be slightly different CSS filenames): <link href="https://www.kvs-demo.com/static/styles/all-responsive-white.css?v=8.1" rel="stylesheet" type="text/css"/> <link href="https://www.kvs-demo.com/static/styles/jquery.fancybox-white.css?v=8.1" rel="stylesheet" type="text/css"/> The majority of design styles is located in all-responsive-white.css file (this filename could be different for other themes). The easiest way to edit styles is to work locally: Open source code of a page you want to modify (typically Index page from the start). You can do that by prefixing browser URL with view-source: view-source:https://www.kvs-demo.com Then copy all the page HTML code and save it into a local HTML file (e.g. index.html). Modify link's href to point to a local CSS file in the same directory: <link href="all-responsive-white.css?v=8.1" rel="stylesheet" type="text/css"/> Copy all-responsive-white.css file from the server into the same directory where you put index.html. Now if you open your local index.html file, your browser should open the same page, but it will use your local CSS file for rendering styles. You can now modify styles in all-responsive-white.css locally without any need of copying it back to server. Use CSS editor of your choice that will make your work much easier. Once your finished your local changes, replace this file on server's FTP with your local copy. Use this approach to modify styling for any page, by saving its local HTML copy and editing CSS file locally. In order to modify site logo, you will typically need to replace logo image file in /static/images directory on your server. There is one logo.png or logo.jpg image file that you need to replace. Changing texts, URLs and SEO There is separate article on this: Working with SEO, texts and URLs in KVS themes. Customizing favicon In order to specify your custom favicon you need to modify this file on your project's FTP: https://kvs-demo.com/favicon.ico You can use online Favicon Generator to create ICO file from your PNG. Adding / removing menu items Many menu items can be controlled from Website UI -> Theme settings page, where you can activate or deactivate some site sections. However if you need to add menu items that are not initially supported by theme, you have to manually modify header template in Website UI -> Page components -> include_header_general.tpl. Please find the following or similar code: <ul class="primary"> <li {{if $page_id=='index'}}class="selected"{{/if}}> <a href="{{$lang.urls.home}}" id="item1">{{$lang.header.primary_menu_home}}</a> </li> ... other menu items using LI tags ... </ul> In order to add new menu items, you should add the following code in the desired position: <li> <a href="https://menuitemurl.com" id="item_custom1">Menu Item Text</a> </li> Then if you want to add some custom styling for it, you can use its ID (item_custom1 in the example) to add some specific styling in theme CSS file (see Changing design logo, styles and colors section above): #item_custom1 { color: red; } Understanding KVS page structure Each URL you see in browser is generated by KVS site engine. A URL is first parsed by special web server module called mod_rewrite and then addressed to one of KVS page definitions. You can find these page definitions in Website UI -> Pages section of KVS admin panel. Every page definition specifies template code that typically has the following components: Setting header variables for page title, description, keywords and so on Site header Main area which may render multiple page blocks or just a piece of static HTML code Site footer Here is example of Index page code, which highlights all of the above components: Site header and footer are inserted by using simple {{include}} statements and this is nothing more than moving the same reusable code fragment into a named component. You can edit them in KVS admin panel under Website UI -> Page components section. Header component supports a number of variables that should be set prior to including it into page definition using {{assign}} statement: page_title page_description page_keywords page_rss page_canonical Their meaning is clear, except probably page_rss and page_canonical. The first one should provide URL for page RSS (if any), and the last one should provide URL for canonical tag of the page. You may also notice that these variables refer some other variables. There is special global $lang variable, which contains all texts from localization (Website UI -> Texts section). All templates refer $lang variables instead of specifying texts directly, so that multiple language support is possible. However you are not required to follow the same concept; it is absolutely legal to specify the actual texts here, honoring Smarty template syntax and using quotes to specify texts: {{assign var="page_title" value="This is the actual title for index page"}} Why these page_xxx variables are needed after all? Header code is located in reusable page component and used on all site pages. But in reality this code is not 100% same for different pages and some parts of it should be different, for example page title. These different pieces are provided via variables, and each page definition provides its own values for these variables. The main area of page structure is where the actual content is being displayed. In KVS everything which is displayed from the database is displayed using specific page blocks. There is a block to display video list, there is a block to display video player, and etc. There are almost 60 different types of blocks. You can find the full list of blocks with their documentation in Website UI -> Page blocks overview. Blocks are the primary building elements of a KVS-powered site. Unlike page components, which are designed to facilitate HTML code reuse, blocks have power to query data from the database using various filtering and sorting options, and display it. At the same time blocks can use page components inside them, because reusable code can be anything, not just header or footer. For example blocks that display different lists use include_pagination_block_common.tpl page component to render pagination controls inside them. If you look into Index page again, you will notice that it contains 2 blocks for rendering 2 separate video lists: Videos Watched Right Now and Most Recent Videos (in default theme). Each of these can be edited separately and defines a huge set of parameters that can be used to tweak block behavior. Parameters are grouped by their common usage sense, for example there are parameters to control lists, such as number of items and sorting. However these parameters never control rendering logic, e.g. which colors should be used (this is controlled by CSS styles) or which fields to render for each video in list (this is controlled by block template). Understanding KVS routing Some pages are designed to serve only 1 URL, for example Index page, which is only used when rendering site index. Another example is [Static] DMCA page, which renders static HTML text. Many of other pages are designed to render similar things for different URLs. For example different video URLs: each of them renders player for different videos, but KVS engine uses the same page definition for these URLs, and the only difference is parameters provided via the URL: https://www.kvs-demo.com/videos/368/dj-manian-ravers-fantasy/ https://www.kvs-demo.com/videos/155/eminem-not-afraid/ These both URLs have the same pattern, but only different in video ID and directory, so they are being routed using the same rule in .htaccess file (this file is processed by web server's rewrite module): RewriteRule ^videos/([0-9]+)/([^/]+)/$ view_video.php?id=$1&dir=$2 [L,QSA] This RewriteRule is basically routing the given URLs into URLs understandable to KVS, and if you try to open them you can see that they display the same content as original URLs: https://www.kvs-demo.com/view_video.php?id=368&dir=dj-manian-ravers-fantasy https://www.kvs-demo.com/view_video.php?id=155&dir=eminem-not-afraid Routing doesn't provide any additional functionality, it just hides the internal page structure and generates nice URLs. KVS provides a simple way to see which page definition serves any specific site URL. This feature is only available for admins, so you should be logged into admin panel to see that. On any site page generated by KVS you should see KVS Admin Toolbar at the bottom, which indicates page definition and its structure. By clicking on edit icon next to page definition name you will open page definition editor: Where to modify a specific section on a specific page Please note that all texts that are displayed can be modified in Website UI -> Texts section, you don't even need to edit code to modify them. You may need to edit code if you want to change the way how data is being displayed, or change HTML code around it. Here are top 6 places where you may need to change something in site layout / contents: Site header. Please go to Website UI -> Page components -> include_header_general.tpl to edit header HTML code. Site footer. Please go to Website UI -> Page components -> include_footer_general.tpl to edit footer HTML code. Video list display. All video lists have the same display, which can be found in Website UI -> Page components -> include_list_videos_block_common.tpl. This component renders list title, sorting controls and the list itself. Video player section. Please go to Website UI -> Pages -> View Video page -> Video View block. Index page contents. Please go to Website UI -> Pages -> Index page. The number of videos displayed in categories, tags, top rated and other. Please go to Website UI -> Pages -> Common Videos List page -> Common Videos List block. Since all these lists are very similar to each other, they are rendered by a single page definition and the only difference is in parameters that are passed there to enable specific filtering (by category, by tag), or specific sorting (by top rated, by most viewed). If you want to change the contents of different popups, such as login, signup and other similar dialogs, please go to Website UI -> Global blocks. All popups in KVS themes are typically rendered by global blocks, as they are not connected to any specific page. If none of the above, then you should use KVS Admin Toolbar to analyze page structure and see which page definition or specifically which block on it you need to change. Toolbar allows you highlight each block and see where it is displayed in your theme design: Understanding template variables KVS doesn't provide list of all variables and their descriptions, there are thousands of them in many contexts. However there are several other ways you can get the info you need. But before we list them, here are some highlights on what are variables in templates. In Smarty template every variable is rendered using this syntax: {{$variable_name}} If a variable is an object, its properties or fields can be accessed using dot syntax: {{$object.property}} There can be multiple levels of nesting here like this: {{$object.another_object.property}} Some variables are arrays (e.g. contain multiple values), and you should iterate over them to access their values. Iteration in Smarty is typically done using {{foreach}} block: {{foreach from=$array_variable item="item"}} {{$item}} - all templates in KVS typically use $item variable to access every item of the iteration {{$item.property}} - in many cases iteration item is an object, so you need to use dot syntax to access its properties {{/foreach}} NOTE: Smarty syntax requires the closing {{/foreach}} for each iteration, if you forget it your template will not be displayed. You can define your own local variables in templates and then use them in some other parts of this template: {{assign var="variable_name" value="variable value"}} ... {{if $variable_name=='variable value'}} ... show something {{/if}} KVS templates typically use local variables for page components, which are reusable parts of HTML code (see Understanding KVS page structure section above). Therefore you can find local variables usage in almost every page definition, that include header component. If you want to use a variable inside string of text, Smarty will require you to use very specific syntax to escape it - using `` quotes. It is a common practice to insert variables into some bigger texts, typically used for SEO. For example consider this: {{assign var="seo_text" value="This is a text with a `$variable` value"}} The other possible way to do the same is to use some placeholder for a variable and replace function to replace placeholder with the actual value: {{assign var="seo_text" value="This is a text with a %1% value"|replace:"%1%":$variable}} The second approach is widely used in KVS templates, because all texts are localized and configured in Website UI -> Texts section and templates use $lang global variable to refer texts by their IDs. In this case introducing placeholders is the only possible option to allow inserting dynamic values into static texts: {{assign var="seo_text" value=$lang.some_text_identifier|replace:"%1%":$variable}} All 3 variants will actually do the same, they will assign "This is a text with a SOMETHING value" into a variable named $seo_text, that can be further used to display its value in this template. It is very important to understand that all variables have certain scope where they are valid to be used: Global variables. These variables can be used globally in any template. This is $config object, which contains all system-specific configuration values that are set in /admin/include/setup.php file. This is $lang variable, which contains all localized texts. Session variables. These variables contain data of the user that is currently logged in (if no user is logged in, then they will be empty). An example of such variable is $smarty.session.username that contain username of the current user. Such variables can be used inside page templates and page components that are included in page templates (typically header and footer). However it is not legal to use session variables inside block templates for most of the block types due to caching specifics. KVS will show caching error if you try to use session variable where not allowed. Request variables. You can also refer URL request parameters in templates globally using $smarty.get.parameter_name. For example when rendering page for this URL: https://www.kvs-demo.com/videos/155/eminem-not-afraid/ you can refer 155 and eminem-not-afraid via certain $smarty.get.xxx variables. However this practice should be avoided and in most cases it is not needed. Not all request variables can be used and this is again connected to caching specifics. KVS will show caching error if you try to use request variable where not allowed. Page variables. These variables can only be used inside page templates and page components that are included in page templates. These are all variables that you set locally in page template via {{assign}} directive. These are also variables, pushed from blocks to their parent page via $storage object. Block variables. Block variables are variables that contain the actual data being displayed. They can only be used inside block templates and page components that are included in block templates. In KVS all blocks are fully isolated from each other and from the page that contains them. You can't use block variables from one block in any other block on the same page. Similar to that, you can't use block variables in parent page template. And vice versa, you can't use page variables in blocks on this page. So before you can use any variables in the place where you want to modify anything, you should clearly understand if this is a page context, or a block context. If this is a block context, which exactly block it is. Which variables should be used in templates As we explained in the previous section, it is important to understand where you are going to put changes. Is this a page template, or a block template, and which exactly block template it is. In most cases you will be editing block templates and page components used inside blocks (for example, include_list_videos_block_common.tpl that renders video list). The first way you can see which variables can be used is to look into default template example of this block type in Website UI -> Page blocks overview. Unfortunately we didn't yet finish updating these templates for all blocks, so you may find it missing the needed data for some block types. Here is how it looks for the block where completed: {{foreach item="item" from=$data}} <a class="item" title="{{$item.title}}" href="{{$config.project_url}}/categories/{{$item.dir}}/"> ID: {{$item.category_id}}<br/> Title: {{$item.title}}<br/> Description: {{$item.description}}<br/> Directory: {{$item.dir}}<br/> Synonyms: {{$item.synonyms}}<br/> Total videos: {{$item.total_videos}}<br/> Today videos: {{$item.today_videos}}<br/> ... </a> {{/foreach}} You can find almost all data values that are supported by block objects, so you just need to find the needed variable and copy it. A more advanced way of finding which variables can be used is provided by debugger: Debugger renders page structure and lists all blocks that are used on this page. For each block it displays a structure of available variables with their ACTUAL values for the given time and URL: On the example screenshot you can see list of variables for the Related Videos block on View Video page. You can see $data variable, which is an array of 12 items (video objects). If you further expand any item you will see all properties of that item: Here we expanded the first video object and we can see all its properties, for example title and video_viewed (the number of views), and etc. Since $data is an array, it is possible to access all array items via their index, e.g. $data.0 will refer the first item and $data.1 will refer the 2nd item. However in real world there is no need to access individual array items, it is typically needed to display them one by one, so here is where {{foreach}} iteration is used: {{foreach from=$data item="item"}} {{$item.title}} - will display Baby Alice - Piña Colada Boy for the first item {{/foreach}} Using debugger this way will help you to understand which variables you can use in any specific block that you see on a page and what their values could be. As we also said in previous section, block variables cannot be used anywhere outside block templates and page components that are used in block templates. However, most blocks will push some variables into special $storage object that can be used in parent page to refer some data from its blocks. These variables are also visible in debugger under Block data in storage: Common Videos List concept To be continued...
  7. Using KVS as a primary content manager for multiple frontends via embed codes If you have or plan a network of multiple sites that use other frontend engine, for example Wordpress, you can still benefit from KVS super powerful video management features by using KVS as you primary content manager and delivering content via KVS embed codes. You can also use this scenario with other KVS licenses (typically Basic), but the key point here is that you don't necessary need to install KVS on every site of your network, you can just use it as your primary solution. Pros: Best way to use KVS with other scripts! Content can be shared or divided between sites, no duplicate files. Single place to manage all your content storage and streaming in one, unified way. Can use ALL KVS video content management features, including multiserver, timeline screenshots, grabbers, multiformats (KVS Advanced+). Can use ALL KVS player features, player advertising and stats. Can show related videos generated by KVS inside player. Can use KVS exporting feeds (KVS Ultimate) to automate content delivery to your other sites, if they support import from feeds. Can configure individual player settings + advertising for each site using KVS embed player profiles. Can have unique titles, screenshots, comments, rating and popularity across the network. Cons: Should use iframes to deliver video player, but domains are overridden. Requires some advanced server configuration to configure aliases (see below). Requires purchasing KVS open source code option for using aliases. Price: $$$ of KVS license of your choice + open source code option ($299) + alias license for every new domain in the network ($1-$50 depending on the amount). Typically no more than $1000 for all your network if you are using Wordpress or other free software for your network sites. From the other hand you get most of killing KVS features and scale them to your network. The idea behind this scenario is that you will need to hide the domain where KVS is installed and instead use embed codes from subdomains of you other project domains. Here is an example of typical KVS embed code, where kvs-demo.com is the primary domain of your KVS installation: <iframe width="854" height="480" src="https://kvs-demo.com/embed/123" frameborder="0" allowfullscreen></iframe> If you want to embed its videos on domain2.com, you will need to create subdomain video.domain2.com that is configured as alias for kvs-demo.com. Then you can use embed codes using this subdomain: <iframe width="854" height="480" src="https://video.domain2.com/embed/123" frameborder="0" allowfullscreen></iframe> In KVS admin panel Settings -> Embed player settings you will need to create a new embed player profile for domain2.com domain. This profile will let you configuring individual player settings for all videos that are played on domain2.com. Using KVS as a primary content manager for multiple frontends via hotlinks This option is similar to the previous one, but instead of using embed iframes you can hotlink video files stored in KVS from other projects. This can also work with both KVS and other scripts, but this approach has less advantages, especially for non-KVS network. Pros: No iframe usage. Content can be shared or divided between sites, no duplicate files. Can use SOME of KVS video content management features, including multiserver, grabbers. Can use KVS exporting feeds (KVS Ultimate) to automate content delivery to your other sites. Can have unique titles, screenshots, comments, rating and popularity across the network. Cons: No multiformats is possible. No timeline screenshots. With non-KVS frontends you can't use KVS player or advertising features. Limited content migration: hotlinked content will stop working if migrated to another storage group. Video files are hotlinked from primary domain and there is no way to hide or replace it. Price: $$$ of KVS license of your choice + $$$ of other network sites either KVS or other script. Typically network KVS sites are KVS Basic licenses in this case. Using KVS satellites to build network sites KVS satellites are special license types that try to combine benefits from both having separate projects and sharing the same set or subset of content from one big database. Satellites are different from other KVS projects that they are connecting to the same database as your primary KVS does, and they are using database data directly. If you want to use KVS for all your network sites, then satellites are probably the best scheme for you. Pros: Best way to use KVS with KVS! Content can be shared or divided between sites, no duplicate files. Single place to manage all your content storage and streaming in one, unified way. Can use ALL KVS video content management, player and advertising features without any limitations. Can have unique titles and descriptions across the network (KVS Ultimate). No need to configure feeds to sync content. All content is managed from the same admin panel for all network. Cons: Requires some advanced KVS configuration to divide content between satellites if you don't want to automatically show all content from the primary database. This is typically configured by our tech support. Requires some advanced server configuration if satellites should be hosted on remote servers. Many satellites can result in database overload for big databases. Can't have unique screenshots, comments, rating and popularity across the network. Shares the same members database for all sites. Price: $$$ of KVS Ultimate license + KVS Satellite license for each network site ($99 - $249 depending on the amount).
  8. Customization is an important part of every modern tube and KVS provides almost unlimited possibilities to customize your video sites. However it is important to understand that there are different customization levels that may or may not affect the future of your project. In KVS we have regular software updates as a part of our product life cycle. Each update brings dozens of new features and bugfixes in multiple spheres; and many of them may be vital for your project's future. So the most important aspect of your customization effort is to make sure that you will be able to update your project to any future version. We would like to stress this again: being able to update your project to a new KVS version is the most important part of your project's future. Everything in the world is changed at a high pace. Here is an short list of what you would have lost if you didn't update your project since 3.9.1 (May 2017): [4.0.0, Jan 2018] Support for showing separate ads for separate device types: highly used feature to increase revenue. [4.0.0, Jan 2018] Faster preview trailers creation: saves much conversion time if you show video previews on mouse over. [4.0.0, Jan 2018] VAST support in player: the mostly used monetization method for video sites. [4.0.0, Jan 2018] Better tube grabbers with multi-threaded download support. [4.0.1, Feb 2018] Better adblock detection and monetization. [4.0.2, May 2018] Google ReCAPTCHA integration, GDPR compliance. [4.0.3, Sep 2018] Push notifications plugin: a new way of monetizing tube traffic with high earnings. [4.0.3, Sep 2018] VAST profiles: easy way to increase revenue from VAST. [4.0.4, Nov 2018] CRITICAL player bugfix for Android 9 devices. [5.0.0, Mar 2019] PHP7 support, animated GIF support in albums, huge performance optimizations. [5.1.0, Jul 2019] WebP support for video screenshots: easy way to reduce your traffic usage and get better google index. [5.1.0, Jul 2019] Player stats in KVS and Google. [5.1.0, Jul 2019] New CTR rotator concept. This list is just a 10% of what have been changed in KVS during the last 2 years! And we will keep going. Luckily, 95% of customizations will not prevent you from updating your KVS. With every new KVS version our main concern is to make update procedure as smooth as possible and keep all existing functionality to work as expected. KVS has its own integrity check, which can indicate if there are any custom changes in KVS system files. You can see this report in Plugins -> System audit as a part of installation check. Moreover you don't need to worry about them before update, as update plugin will do the same check and will report any system files that have custom changes and may be overridden by update procedure. If nothing is reported by KVS update plugin, you are good to go and continue updating your project without risk to break anything. Levels of customization in KVS There are 4 levels of KVS customization: 1) Theme / design customization. Theme in KVS is separated from KVS engine and thus any theme customization never affects your ability to update. This includes not only CSS styling change, but also changes in the following aspects of your site: Texts that are displayed. URLs and URL patterns that are used to generate URLs. Page parameters change (e.g. how many videos should be visible per page and so on). Any page can be restructured, built from scratch and fully re-designed without affecting your ability to update. This level is what KVS customization engine provides and this is what you are expected to be using. 90% of highly customized projects on KVS end up at this level and update to new KVS versions without any issues. 2) Legal customization options to add some custom functionality: At the moment KVS has the following APIs to customize some parts of its functionality: Ability to add custom video / album post-processing code via custom post-processing plugin. Ability to add custom grabbers extended from KvsGrabber base class (see How to create custom tube video grabber for KVS). Ability to add custom payment processors extended from KvsPaymentProcessor base class (see How to add custom payment processor in KVS 5.0). Ability to use {{query_kvs}} template function to run a custom query into KVS database (see Advanced theme customization: custom database queries). Ability to inject custom PHP logic into theme page generation via /admin/include/pre_xxx_page_code.php customization files. Ability to inject custom PHP logic into cron processing via /admin/include/cron_custom.php customization file. Ability to create custom Smarty functions and modifiers and use them to enhance display logic, if some complicated database selection logic is needed. Ability to add custom links to KVS admin panel menu. These options provide fair amount of possibilities to add customization logic with very low risk to affect further KVS updates. There is still some risk due to the following possible future scenarios: If your custom code executes queries into KVS database, it may be possible that database structure will change in future and your customization will start working incorrectly. It will not be fully broken however, as KVS update never changes database structure in incompatible way, making old SQL queries to become invalid. If your custom code relies on some other KVS common functions, they may be dropped with new versions without any notification. So better to customize without relying on anything specific in KVS. We may change API for custom grabbers and custom payment processors in future if we see the need to enhance it, however we will always consider the possible update implications as we usually do. KVS update plugin will require your attention if you have any custom these that may need manual changes. We will definitely change API for custom post-processing plugin at some point with prior notification during update and in what's new bulletin. 3) Semi-legal customization options to add some custom functionality: These are custom blocks that can further be used in theme development. Initially we honored using custom blocks as a legal customization option. However we noticed that this customization option was misused in 99% of cases. While designed to provide fully custom functionality that was not initially available in KVS, custom blocks were typically used to copy-paste from original blocks with minor custom enhancements, which were in most cases not necessary. This may work for some time, however in a long run it will result in your site not working correctly. How come? As a part of some huge changes we may completely revamp how some data is stored and how block operates it. The original block will be updated with KVS update, but your custom block, copied from the original long ago, will remain untouched and will use the old logic. Another common problem is that copy-pasted code in custom block uses many common KVS functions that are also changed from time to time. If we ever change function signature to a new one, or rename it to something else, your custom block and all pages that are using it will stop working after updating KVS. Some KVS customers were affected by this problem with custom blocks when we switched to PHP7 and changed all blocks to remove old PHP API. Unfortunately there is no way we can provide support for custom blocks and their coding, so many such customers were faced a dilemma: either they fully remove the custom functionality added by custom blocks, or they are not able to update to KVS 5 and above. And the more they wait, the more new features they are missing. As a result we strongly not recommend to use custom blocks in KVS, as this imposes high risk on your ability to update in some future. 4) Custom changes in KVS code Finally there is an option to put custom changes right into KVS system files and right in the needed place. This is the only customization option that needs open source code to be available. In some cases this is the only possible option to add the customization you need, however you should still consider updating your project by purchasing KVS update service from us. If the number of your customization changes is relatively small, we will not charge any additional fee, but things may differ if you have a huge amount of changes in many files. And we may also deny you in update if your customizations are conflicting with new KVS features / changes. IMPORTANT! If your developers tell that you need custom changes in KVS files, please make sure that they tried all possible options described in this post that do not need these changes before going forward. Some easy customization techniques - You need to display some data that can not be displayed via standard KVS blocks. Consider using custom database query {{query_kvs}} function (see Advanced theme customization: custom database queries). If you need complicated query syntax, consider adding custom smarty function similar to {{query_kvs}}. What you need is to simply put your function PHP file into /admin/smarty/plugins directory. You can duplicate function.query_kvs.php file and implement similar code with your custom query logic. - You need to do some display formatting that you can only do via PHP. Consider using Smarty syntax for your formatting. Smarty is very powerful and in many cases it can fully replicate any PHP logic. For example you can use PHP functions as modifiers in Smarty (in this case modifier should be put after the first parameter value of the function and all other parameters should be provided after). For example, if you want to use this PHP function: mt_rand(1, 10); You can do like this in Smarty: {{assign var="random" value=1|mt_rand:10}} {{if $random <= 2}} show this {{else}} show that {{/if}} If you want to iterate on some fixed list of items: $array = array_map('trim', explode(',', 'test1, test2, test3')); Same logic in Smarty: {{assign var="array" value=","|explode:"test1, test2, test3"}} {{foreach from=$array item="item"}} {{assign var="item" value=$item|trim}} {{if $item == 'test1'}}1{{elseif $item == 'test2'}}2{{elseif $item == 'test3'}}3{{/if}} {{/foreach}} Alternatively you can create custom Smarty function or modifier to code your logic in PHP if you don't want to cope with Smarty syntax. - You need some post-processing logic on some event. This is the most tricky one where developers typically insist that they need to add customizations to KVS code. Luckily they don't! The idea is that you could use custom cron script to monitor KVS database for some events or data items and do some post-processing offline. Here is how you can do it. For example you want to send some emails on new videos being approved, or add some internal message notification when somebody comments a video. First of all you need to add a new database column in the table, which data you will monitor. For example add custom_flag_notified tinyint(1) column to ktvs_comments table. Then your cron logic should query all comments that are approved and have custom_flag_notified=0. You may need to join with ktvs_videos table to find out user_id of the owner of each video being commented. Iterate over the selected list and create internal message for each owner about their video being comment. Also set custom_flag_notified=1 for each processed comment, so that they are not selected next time. Here you go: customization added, not a simple change in KVS system files.
  9. If you simply embed banners into different pages of your tube site, this won't bring you much. Maximizing tube revenue is a skilled art nowadays. We are not professionals in this, but we know how our best clients do and what features they use to get most from their tube sites. Just think that many of the tube sites are simply buying traffic for lower price and squeezing maximum from it, thus having huge income. Consider a big tube or a network that brings $5.000 of net income monthly. Consider implementing a strategy that increases your tube / network revenue by just 10%... how much do you think you will get more? $500? Wrong. Simple math. As an owner you will pay $10.000 monthly for servers, employees and traffic. Advertising from such a tube may bring $15.000 and your net income will be $5.000 monthly. If you increase your advertising revenue by 10% it will become $16.500 and your net income will be $6.500, which is $1.500 more (or 30% increase)! This is why every % increase of advertising revenue is very important and actually makes sense to struggle for. KVS advertising and player features and this small guide will hopefully help you in implementing such strategies on your projects. Are you an advertiser company that can provide more revenue to KVS customers and you need some integration into KVS? If so, please contact our support team. Simple inline advertising Every KVS theme comes with a predefined list of advertising spots, wherever theme designers decided to put them (Website UI -> Advertising section). These spots contain some sample ads to demonstrate which advertising format is expected there: You can use these spots with your own ads, but if you don't like their placement you can simply hide them by deleting or deactivating sample ads from any specific spot. A spot without any active advertising will not be rendered and this should not affect theme behavior in any way. If you want to add a new advertising spot into your theme design you should first create it in Website UI -> Advertising section and then copy-paste its Insert code into the needed template position: {{insert name="getAdv" place_id="new_spot"}} After inserting an empty advertising spot there will nothing happen. The spot will display something after you add any active advertising to it. By inserting single advertising inside a spot you won't get much. Typically advertisers require you to select advertising format, e.g. size and type, advertising category. An advertisement that looks good on desktop will not look the same on mobile and vise versa. If your site features videos on multiple non-connecting topics, there is no sense to show the same ads for videos from these different topics. Moreover, one provider typically can't provide good clickable ads for all countries in the world. Global advertisers are usually concentrated on English speaking top-tier countries, such as US, UK, Canada, Australia, some EU countries and that's it. While they may show localized ads for non-English top-tier countries, they will in most cases show the same English ads for visitors from other countries, reducing their click activity and your revenue. There are always providers that will pay more for locale-specific traffic, because they are concentrated on this niche market and know how to best convert it. This is where KVS advertising feature is extremely useful. It allows you to combine ads from different providers, for different devices, from different categories and for different countries in the same spot. All what you need is to put multiple advertisements into the same spot and correctly indicate which advertisement is designed for which devices, categories and countries: Devices. There may be some providers in your market specifically concentrated on mobile visitors and paying more revenue than other, use their advertising for mobile phones and / or tablets. If your advertising provider supports separate mobile ads, better use them for mobile devices and separate desktop ads for desktop devices. Categories. Advertising providers are not able to understand which categories are in context of the page where advertisement is being located. Therefore they will require you to pre-select some high-level advertising categories before they give you advertising code. But KVS knows the exact category context of almost every site page (e.g. video page for example) and KVS is capable to show different ads for content from different categories. Therefore if you want to have more relevant ads on your video pages, you can use categories limitation in advertising settings and configure multiple advertisements in different categories, where each advertising is also configured differently on advertising provider's site as well (e.g. it means that you will also need to create different ad zones with your advertiser company, so that each zone has its own category). This way your ads will be more relevant to videos and will result in more clicks. Ideally you should divide all your categories into non-connecting subsets and configure separate ads for all these subsets. Countries. Check your traffic stats by countries (Stats -> Countries). You should be able to see which countries form the most of your site's traffic. If you don't see countries, then GEOIP module is not configured or configured incorrectly and you should contact KVS support to help you identify the issue. Check your advertising provider's payment policy for different countries: are there any that are not being paid well? Search for local advertising providers for these countries, look at local competitor sites: which advertising providers are they using? Use country specific VPN to access competitor sites. Try to find local advertising provider for this traffic and insert country-specific ads for these countries. Get more revenue for their clicks. IMPORTANT! By configuring ads for multiple categories and countries please do not forget to consider the 'default' case, you should always have some default advertising with empty categories and countries. This is needed because some videos may have empty categories, or some countries may not be detected, and actually you will never select all possible countries in an advertising. So your spot configuration should always have default ad, which will be displayed for any country or category that was not selected in other 'specific' ads. Usually your primary advertising provider IS your default case, and you should be using alternate providers for locale specific cases or for advertising inside specific categories to increase your revenue in comparison to your primary advertiser. Connecting advertising to content sources Content sources are another way to show content-specific advertising in KVS. They are typically used as 'sponsors' or 'paysites' that you want to advertise along with the content. In adult industry many free sample videos are provided by studios or paysites that also support affiliate programs to advertise their paid sites. If your site renders sponsored content, you should absolutely use content sources to render a banner or two on video / photo pages to increase your revenue. KVS default theme is capable to render top banner and banner under player from content sources, also providing ability to configure default banner in advertising settings (if a video has not content source or the existing content source has no banners uploaded into it). In order to use this functionality, you should create content sources and upload their specific banners into the following 2 customization fields: In content source settings you should also specify your affiliate URL in the URL field, usually a paysite join or tour page with your affiliate ID. Then you should make sure that imported / created videos are correctly assigned to their content sources. If you already have a big set of existing videos, you can assign content sources via mass editing functionality for many videos at the same time. Even grabbers in KVS are in most cases capable to detect the correct content source from the grabbed video pages. In order to consider 'no content source' case you should either disable default banner to completely hide it, or specify your custom default advertising in these 2 ad spots: NOTE: other themes may or may not provide ability to connect video page advertising to content sources, this is solely theme-specific feature. Please contact theme developers if you need to customize this. Popunder advertising Popunder is another popular way to increase your tube site revenue. While Google announced its battle against popunders, there are new tactics that can easily imitate popunder opening without actually being a popunder and without even being noticed (at a time of this article creation). In order to insert popunder code from your advertiser please go to Website UI -> Advertising section and create a new advertising spot named Popunder. Then create an advertisement under this new spot with popunder code (typically a fragment of JavaScript code provided by your popunder advertiser). Follow your advertiser guide on which code to use. Finally copy Insert code from advertising spot settings in KVS and paste it anywhere before closing </body> tag in Website UI -> Page Components -> include_footer_general.tpl: After doing this, you should be able to see popunder working on any page of your site. NOTE: please be aware that ad blocking plugins in your browser may block popunders of some advertising providers, so you may not see anything actually. Before testing any advertising on your site make sure that adblocking plugins are disabled in your browser for your site. KVS player also provides its own popunder implementation. There are several crucial differences when using popunder from KVS player in comparison to popunders provided by other advertisers: KVS player popunder will only be triggered when user clicks on player to start playing a video. Popunders from other advertisers will be triggered when user clicks anywhere on your page and by default will affect all pages of your site. KVS player popunder will open a new tab with actually auto-starting video immediately, while the background tab will be silently redirected to advertiser site. This provides better user experience, e.g. user clicks on 'Play' button and this will result in opening the video page again in a new tab with playing the video. Popunders from other advertisers cannot do that, since they are not integrated into player. However, this is not possible on 100% of devices and will only happen on those devices that support it (mobile devices in most cases do not support autoplay at the moment). In KVS player popunder you have to manually configure the outgoing URL and to stick it to a single advertiser site. Popunders from other advertisers are better in this, since they can dynamically select different advertisers and you don't need to be concerned which advertiser to use. If you want to try KVS popunder, you can configure it in Settings -> Player Settings under Blind Advertising section: If you want to try non-KVS popunder, try Ехосlісk. In-player advertising KVS player is definitely the world's #1 player in advertising support. It gives you so many abilities to configure any advertising in so many ways, that no other player can provide. You should definitely dive into the world of player settings and discover advertising types that suit your business needs. Here is a list of all supported in-player advertising with brief explanation: Logo advertising: render a logo image or text of video sponsor from content source settings. Use this for sponsored videos. Better render sponsor logo than your logo. Controlbar text advertising: render a small text fragment on controlbar. Can be linked to a sponsor for sponsored videos, e.g. "Download video" text linked to a sponsored site. Popunder advertising: browser will reopen the same video page in a new tab with attempt to autoplay video there, while the original page will be silently redirected to a sponsored site. Pros and cons of using KVS popunder advertising in comparison to other 3rd-party popunders are summarized in the previous section. Video click advertising: another type of blind advertising, which is triggered when user clicks on player to pause the ongoing playback. This click will open advertiser site for the first time. Format change advertising: when player renders list of available video formats, e.g. "480p", "720p" and etc., it is always possible to add any number of fake formats and link them to a sponsored site. For example your videos come in 480p and 720p formats only. You can easily add 1080p option and link it to video sponsor or to any specific advertiser. Any user who wants to watch video in 1080p will be redirected to a sponsored site. Start screen advertising: shows HTML block with ads on top of player instead of native 'Play' button. Also supports custom 'Play' button rendering. Pre-roll advertising: the most popular advertising that renders HTML, image or video ad with or without 'Skip' button for a certain amount of time before playing the main video. Users are forced to watch this advertising if they want to watch content video. While in KVS player settings you can easily design your own HTML / video advertising, the most popular option is to use VAST advertising provider instead. VAST is described in the following section. Post-roll advertising: similar to pre-roll, but shows at the end of video. With the new KVS 4.0.3 it is also possible to configure post-roll in after-pause mode, so that this advertising will be initialized after user opts to pause content video for a while. If then user opts to continue watching the video, they will have to watch post-roll advertising first. Using post-roll advertising in after-pause mode in connection with good VAST provider may significantly increase your tube site revenue without any effort. Advertising on pause: shows HTML block with ads or image on top of player instead of native 'Play' button. Also supports custom 'Play' button rendering. Overlay advertising: images that will overlay player from top or bottom during content video playback without affecting it. A good place to remind users to download full video from a sponsored site. In-player VAST VAST is an abbreviation for Video Ads STandard. It is a way how many advertising providers and many player vendors can deal together with video advertising. While KVS provides a way to manually create your own custom video / image / HTML player ads, VAST is much easier to use and it is expected to produce more revenue. KVS currently supports VAST in pre-roll and post-roll ads. It is highly possible that VAST support will be added to overlay advertising as well in the future. VAST in KVS is available via subscription basis: you have to pay a fixed fee every month, or quarter, or year (the longer the period is, the more discount you get). You can purchase VAST subscription service here, but you should log in first to select your license: https://www.kernel-video-sharing.com/en/services/#vast Once your payment is processed, it will automatically push VAST subscription code into your KVS license within 1 hour or so. If you want it to be pulled immediately, please go to Settings -> Player Settings and re-save them. As an alternative to VAST subscription KVS supports several affiliated VAST providers that you can use for free without any paid subscription. You can find them listed in Player Settings of your admin panel. IMPORTANT! KVS player can not affect your VAST provider behavior. VAST provider decides on its own discretion whether to show advertising to the given visitor or not. Many VAST ads are paid for views, not for clicks. VAST provider will most probably implement a strategy to optimize their expenses, not your revenue. If they think that the current user will less likely click on the next ad, they may skip showing it, so you may end up showing less ads and having less revenue. In order to increase your revenue from VAST you should first of all consider using alternate VAST provider(s). Alternate provider(s) will be used if you main provider denies to show advertising to the given user. This can be simply configured in Settings -> Player Settings as Alternate VAST configurations field. Player will then consider using alternate VAST provider(s) in some %% of cases, and you should be able to notice that in revenue stats on your alternate VAST advertiser website. Another feature that will help you to increase your VAST revenue is creating your own VAST profiles for pre-roll and post-roll ads. In VAST profile you can mix multiple VAST providers with different weights and countries similar to what KVS ad spots allow. For example imagine scenario when the same user is watching multiple videos on your site. If you want to show pre-roll for every video, your VAST provider will either show the same advertising multiple times in a row, or will deny showing it on the 2nd and / or 3rd times. This is where alternate VAST configurations may be used, but another possible option is to configure multiple VAST providers in the same VAST profile and specify different weights for them. KVS will then show different advertising for the same user if the user watches more than 1 videos on your site. It will show VAST provider with the most weight with the first video, VAST provider with the 2nd most weight on the 2nd video and etc., then the cycle will be repeated again. The rule of thumb for VAST advertising is similar to standard inline ads: choose your primary VAST provider and then add alternate providers into VAST profile for either increasing revenue for certain specific countries or for mixing multiple providers for the same user. At the same time make sure you are using alternate VAST provider to catch cases when primary provider doesn't want to serve advertising to a user. Native advertising Native advertising is designed in such a way that it imitates the content on your site and is integrated as a part of your content list. Typically this type of advertising is used in related videos or somewhere inside video lists. The most difficult thing about this advertising is that it should look similar to the design you have on your site and organically suit your site. This is very difficult to achieve in the world of adaptive themes, from technical point of view. Most of advertising providers (Ехосlісk for example) will allow you to customize the design of this control. However you should consider that this advertising is displayed as a whole iframe and it should exactly fit the line of videos in the list. The number of videos per line is different for devices with different screen width. For example there may be 4 videos per line on desktops and 1-2 video per line on phones, and 3-4 videos per line on tablets and some HD screen phones. So the only way to create a true native in-list advertising is coding custom CSS styling for it and making sure that the same list rendering pattern (e.g. 4-3-2-1) applies inside the advertising iframe. This is quite a difficult task even for an experienced guy. The most easiest option to add native advertising to your project is to insert it on video / album pages as a vertical aside block (default theme advertising spot for this is called "Video / Album / Playlist View 3 images"). This block is designed to render a vertical list of banners of any width (player width will adopt accordingly), and may be the best place to render a vertical list of native ads named "Similar videos" or "Recommended videos". This list will be located aside video player and will obviously generate many clicks. However on small devices (screen width less than 860px in default theme) this block is hidden by CSS, because otherwise it will be displayed above player and will make video page ugly. You can show it with the following inline CSS style: <style> @media screen and (max-width: 860px) { .block-album .table, .block-post .table, .block-video .table { display: block !important; float: none !important; margin: 0 7px 10px 0 !important; } } </style> Since on small devices it will still be rendered above player, it makes no sense to render vertical list of native ads there. Combining all KVS features, here is the best solution possible. Put 2 different advertisements inside "Video / Album / Playlist View 3 images" spot: The first advertisement should be vertical list of native ads and should be allowed for desktop and tablet devices. This advertising will be displayed aside player as a vertical list of native video ads. The second advertisement is designed for mobile phones only. It should contain the above CSS fragment plus some advertising that looks like player with a play button. It will be displayed only on mobile phones above the actual player and will confuse some users that will click it thinking it is a player. Alternative monetization channels Starting with KVS 4.0.3 there is a Push Notifications plugin available which provides alternate monetization channel with high revenue. It can be a good addition to your standard monetization scheme. How does it work? When visitors open your site, their browsers will invite them to subscribe to push notifications from your site. Users who accept the invitation will receive advertising materials directly to their browsers even if they never visit your site again. In comparison to standard ads, push notifications do not affect your site content and usability, since invitation is displayed by browser, not by your site. Also Ad Maven, the advertiser integrated into KVS, is 100% compatible with Google advertising requirements so that your project will not suffer SEO restrictions. As for monetization, push notifications will bring you passive income for quite a long time thanks to the unique technology they are implemented. Users subscribed on your site will continue receiving advertising materials even if they never come back again. You will continue receiving revenue for a long time even if your site has no traffic anymore. Combining all together Every single % matters. Here are 7 simple steps to increase tube revenue, a summary from the above descriptive sections: Make sure you are using the latest KVS version. We are working hard to bring you the best advertising options in the world, since we clearly understand this is the most important and needed feature. Read 'whats new' sheets from all new versions to see if there are any advertising enhancements that you can start using. For inline advertising choose your primary provider (for example Ехосlісk). Use mobile-targeted ads for mobile devices if possible. Use country-specific advertising providers to increase your advertising revenue for specific countries. Use category specific advertising if your tube site features several exclusive category sets. Use KVS Push Notifications plugin as your alternate monetization channel. If your content is sponsored, make sure that all sponsored content is assigned to specific content sources and show different advertising from content sources instead of showing the same global advertising for all content. This applies to advertising displayed on video / photo pages and inside player. Use popunder in a combination with pre-roll and post-roll VAST. Choose your primary VAST provider (for example Ехосlісk) and configure alternate VAST providers to boost revenue. If you are able to find locale-specific VAST providers with great rates, create VAST profile and combine your primary VAST provider with country-specific providers. Use different VAST providers for post-roll adverting configured in after-pause mode. If your videos are in 480p and 720p format, add 1080p and/or 4k format slots in player settings with redirecting to advertiser, ideally to video sponsor's site. Use sponsor-specific player logos linking to sponsor sites. Use vertical native advertising aside video player to imitate related videos. Combine it with native advertising on mobile phones that imitates player with play button over it.
  10. 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.
  11. KVS has multiple categorization entities, which all together are designed for specific needs and have specific functionality. Using correct categorization concept is crucial for a successful tube site and even a paysite. Please pay attention to this guide. Categories Categories are designed to be initially created by admins and thus they are designed to be limited. Use categories for your top level categorization. Depending on how you add your content (manually, import, grabbers) it is always possible to dynamically create categories on the fly and it is also always possible to make sure that no dynamic categories are created. Users will not be able to create new categories, they will only be able to use the existing set of categories you have defined in admin panel. Importing and grabbers will create missing categories by default, so in order to prevent that you should enable options that stop this: This becomes more important with tube scrappers when grabbing content from multiple tube sites. Each tube site has its own set of categories, some of them may be spelled differently but define the same meaning, e.g. Phones and Mobiles. If your videos are grabbed automatically and categories are allowed to be created on the fly, your tube will end up with dozens different categories having the same meaning. Fixing this will be possible, but will require much time spent in admin panel, so it is better to prevent by using the proposed strategy: Step 1. Define your categories manually based on your site's planned content. Step 2. Before enabling grabber that supports grabbing categories for each video, check the whole set of categories this site provides. Make sure to list these categories as synonyms of your existing categories, where no exact match is found. For example for category named Mobile Phones you can list such synonyms as Phones, Mobiles, Smartphones. When searching for existing categories KVS will also check their synonyms and instead of creating new category named Smartphones it will choose existing category named Mobile Phones, which defines Smartphones as a synonym. Synonyms can also be used in SEO, they are typically used as HTML keywords for your category pages, but can also be displayed anywhere where category name is displayed: This approach should work great if you correctly define all synonyms before using grabbers. But if the number of categories on the grabbed site is huge or you are not able to find their list, you will not be able to find out which synonyms should be added. There is another approach: import categories as tags first using the new option in grabber settings: Step 1. Not necessary needed to define your list of categories. Step 2. In grabber settings enable Categories as tags option. This will add all categories as tags in addition to original tags that may be available on grabbed site. Step 3. After importing much enough content, check your tags and sort them by the number of videos in them. Tags with most content are your potential categories and their possible synonyms! Now you can create your set of categories and specify their synonyms by looking into these tags. Step 4. Go to Plugins -> Category auto-selection and enable this plugin to process every video. Step 5. Go to Videos list and select Mass edit all videos... option in batch actions. You will see mass edit GUI. Enable Process videos with "Category auto-selection" plugin option. Make sure you do not select anything else and submit mass edit task. Now your videos will be auto-populated with categories based on their tags. For new videos this will happen automatically. You need to use mass edit only for the first time after you are able to populate your initial set of categories. But at any time you can repeat step 3 and step 5 when you import more content to create more categories and assign videos to them. Using either of these approaches will keep your categories tuned. Categories support custom fields, some of them are enabled by default and are used for HTML title, HTML description and SEO text displayed on category pages. We encourage you to fill them to get more SEO traffic to your site. Also categories can be used to bind site advertising to specific categories, e.g. show specific ads on specific pages only for specific categories. Here are some places where you can use this: Video / album pages: you can show ads specific to categories of the displayed video or album. For example for all videos having Mobile Phones category you can show only ads related to mobile phones and do not show other ads. Using this functionality can significantly increase your revenue. Category pages: you can show ads specific to the given category only. Category groups For some tube sites with complicated categorization it may be needed to group categories by certain areas. This is typically used in advanced search functionality, when users should be allowed to search by multiple criteria matching at the same time. KVS doesn't support category tree, but in most cases the same thing can be achieved by using category groups. For example if you have a tube site with travel videos, you may have the following grouping (simplified): - Countries --- USA, Canada, Australia, etc. - Activities --- Rafting, Hiking, Snorkeling, etc. - Production --- Professional, Amateur Then for each video users can select multiple categories from each of these groups. KVS default theme allows switching category selector to grouped one, which will display categories in the needed way automatically. It is also possible to display categories grouped in main category listing or at any page of your site, e.g. in sidebar or header (this is not supported by default KVS theme and will require redesign if needed). Categories grouping can also be used in advanced search function to search for content in the exact matching set of categories, e.g. only amateur videos about hiking in USA. In this case user should simply select 3 categories together: USA, Hiking, Amateur and all videos where these 3 categories are present will be displayed. Tags Tags are true dynamic categorization objects, they can be created by your site's users at their own discretion. Tags are typically used as keywords for content pages and can also help in text search and SEO for providing landings for specific search results. Our basic recommendation is that you don't try to limit them in any way. However KVS provides functionality to merge several tags into one and keep content correctly reassigned. This specific functionality is available as Rename function in tags list in admin panel. Tags can also support custom fields, which can be used for SEO, but usually this is not feasible due to their big amount. Content sources Content sources can be used in multiple scenarios. The initial idea behind content sources was to group videos / albums based on the source they are coming from. Here are some real world scenarios. Scenario 1. For a tube site if you advertise sponsor paysites, you are allowed in some cases to take premium content from their member area and add to your tube but with some duration restriction (for example truncate to max 5 minutes). So you can configure a content source for each of these paysites and you can also configure that all content from a specific content source is truncated to some duration specified in content source settings. In order to do that you should first go to Settings -> Customization and enable any free custom text field for content sources and name it as Duration limit: Then in Settings -> Video formats for all video formats, which are planned to be created for such videos, you can enable duration limit to be taken from that content source field: The idea is that if the uploaded video has a content source and this content source has Duration limit field specified, KVS will truncate all video formats of this video to this duration. All other videos (either from different content sources, or with empty content source) will not be truncated. Therefore using this functionality you will be able to ensure that you don't violate any duration policy required by content author / owner. But in order to have this, you should configure it from the beginning. Scenario 2. For a tube site if you advertise sponsor paysites, you can bind in-video and other video page advertising to advertising specific to content source. This is the widely used concept of showing "Download full video at XXXXX" banner under video player, or inside player. In order to do that you should also use custom content source fields. In Settings -> Player settings you can bind specific in-video advertising to a custom text (for HTML ad) or to a custom file (for video or image ad) field of video content source. In this case you should also specify some default HTML or file for the ad - just because some videos may have empty content source or some content sources may have empty custom fields: Default KVS theme also supports 2 image banners (one wide on top of video page and another under video player), these banners can be uploaded into predefined custom fields in content sources: Theme settings can be changed of cause, default theme just has 2 image banners predefined, but you can customize to display other banners, or to display HTML banners instead of image banners, or anything else. The template code is pretty straightforward. For View video page template (Website UI -> Pages -> View Video) showing HTML ad from custom field #5 with fallback to default ad: {{if $storage.video_view_video_view.content_source_id>0 && $storage.video_view_video_view.content_source.custom5!=''}} {{* check if video has content source and it has custom5 field specified -> show HTML from custom5 field *}} {{$storage.video_view_video_view.content_source.custom5|smarty:nodefaults}} {{else}} {{* this video either has no content source or its custom field #5 is empty -> show some default advertising spot (needs to be created prior of usage) *}} {{insert name="getAdv" place_id="spot_video_page_default_ad"}} {{/if}} Same code if used inside video_view block (Website UI -> Pages -> View Video -> video_view block): {{if $data.content_source_id>0 && $data.content_source.custom5!=''}} {{* check if video has content source and it has custom5 field specified -> show HTML from custom5 field *}} {{$data.content_source.custom5|smarty:nodefaults}} {{else}} {{* this video either has no content source or its custom field #5 is empty -> show some default advertising spot (needs to be created prior of usage) *}} {{insert name="getAdv" place_id="spot_video_page_default_ad"}} {{/if}} Each content source also has URL field, where you should specify click URL for that content source. KVS is able to track all outgoing clicks to content sources in its stats, but in templates you should render href of a specific format. For View video page template (Website UI -> Pages -> View Video): <a href="{{$lang.urls.out_sponsor|replace:"%DIR%":$storage.video_view_video_view.content_source.dir|replace:"%ID%":$storage.video_view_video_view.content_source.content_source_id}}" target="_blank">Click here to watch the full HQ video!</a> Same code if used inside video_view block (Website UI -> Pages -> View Video -> video_view block): <a href="{{$lang.urls.out_sponsor|replace:"%DIR%":$data.content_source.dir|replace:"%ID%":$data.content_source.content_source_id}}" target="_blank">Click here to watch the full HQ video!</a> Scenario 3. If you have a tube site or a paysite which aggregates content from several other paysites, you can show sites section allowing users to navigate content from different paysites. This is fully implemented in KVS default theme: http://kvs-demo.com/sites/ Scenario 4. In some cases if you grab content from multiple tube sites you may need to use content sources for simply grouping them. For example if you grab embed codes from multiple sites and suddenly one of the sites stops serving embed codes, or starts redirecting your traffic to their website, you will need to delete these videos. Then you can easily filter them all by content source in your admin panel. Each grabber settings provide ability to set all content grabbed from specific grabber to a specific content source: Summary. So the most common scenarios of using content sources in KVS are: Truncate duration for videos from specific source sites. Embed different watermark images for videos from specific source sites (similar to truncating duration). Show different in-video and video page advertising for videos from specific source sites. Provide users ability to navigate videos divided into separate sections based on their source sites. Provide ability for admins to easily filter videos based on which sites they were scrapped from. Content source groups Similar to category groups you can group content sources by your criteria. Can be used both for your admin panel needs and for showing grouping on website. Models Models are categorization objects designed to indicate people that are connected to any particular video or album. There is nothing specific about models, they are like categories but have more data fields in terms of 'people'. Flags Flags are categorization objects designed to be applied by your end users. Flags are typically used in Report video / album / playlist functionality. Based on your theme configuration, users can assign predefined flags to different objects (like videos, albums, playlists and some other). With flags they can also specify their message if your design allows doing this. So flags can be used for multiple features that require user feedback on content: Report copyright violation by specific content. Report inappropriate content. Name a model in a video or album. Vote content for being featured. Flags can also be used by admins to group videos or albums for specific reasons. Both videos and albums support so-called admin flag field, where you can select a single flag for a video or album. This field is filterable in admin panel and in site listings, so here are some example usage scenarios: Indicate specific set of content that should be displayed in specific site listing, e.g. manually predefined featured videos on index page. When content is being processed by multiple admins, they can use admin flags to move content between different approval phases. When you need to manually review content and move it to specific logical group that you can further filter by; you can just assign a specific admin flag and then filter all content by this flag.
  12. 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.
  • Create New...