Video transcoding in docker

aboout this script https://unacms.com/wiki/Video-Transcoder it is not clear in which file it should be added, i uncoment the line in the BxDolTranscoderVideo.php but not working, does anyone know where?:

bx_import('BxTemplFunctions');
bx_import('BxDolTranscoder');

// transcoder objects which generate .mp4, .webm videos and image poster
$oTranscoderMp4 = BxDolTranscoder::getObjectInstance('bx_video_mp4'); 
$oTranscoderWebm = BxDolTranscoder::getObjectInstance('bx_video_webm');
$oTranscoderPoster = BxDolTranscoder::getObjectInstance('bx_video_poster');

// make sure to call it only once (for example: during module installation), before the first usage, no need to call it every time
$oTranscoderMp4->registerHandlers(); 
$oTranscoderWebm->registerHandlers(); 
$oTranscoderPoster->registerHandlers(); 

// get URLs of transcoded videos and video thumbnail, 33 is ID of original video file stored in specified storage object
$sUrlMp4 = $oTranscoderMp4->getFileUrl(33);
$sUrlWebM = $oTranscoderWebm->getFileUrl(33);
$sUrlPoster = $oTranscoderPoster->getFileUrl(33);

echo 'My cat:' . BxTemplFunctions::getInstance()->videoPlayer($sUrlPoster, $sUrlMP4, $sUrlWebM);



  • 180
  • More
Replies (5)
    • Different lines in this code could be used in different places.

      We have sample file for video transcoder, I hope it should help:

      https://github.com/unacms/una/blob/master/samples/transcoder_video.php

      • Yes, but I want to know once the video or albums module is installed, there are no details on how to make these modules/app work, there are no specific instructions. I saw this file and what do I do with it? When I upload a video file to the album, it should be processed in the same way as an image is processed. These files should exist in the video or album application.

        • if you don't know how to explain the steps to install, where are the installation instructions for the album and video module/app? I didn't find anything specific.

          • Hello @ORV !

            As we were discussions before, the Albums or Videos apps installation doesn't have any specific actions described here https://unacms.com/wiki/Add-Apps . In your case for now, just need to find the reason of the convertation error.

            • The conversion file for photos module has the execution permission 775 this is how I solved it for image processing.. There must also be a file for video conversion. What is that file? I think it needs permissions like chmod +x ./image_transcoder.php to be the same for the video transcoder. nor what is the name of that file.

              The problem is that I don't know where this file is. I couldn't find it, and there is no clear description of how these applications should be installed and set up in different scenarios. If you from the UNA team don't know, then who does? Any script I bought on the internet has installation instructions. Also, every product in the world has installation or user instructions. Don't you think UNA products should have them too? Dolphin has always had clear installation instructions, but the new una-cms version seems to be lacking in this chapter.

              Thank you for answer. Regarding file permissions, I found this article, but it is not enough https://unacms.com/wiki/installation-ubuntu-debian. I have managed to decipher these steps so far from this forum for docker development scenario: https://github.com/olariuromeo/una/blob/master/INSTALL.md But to make the website functional, more details are needed. So this is my permision now.

              #!/bin/bash
              # set_permissions.sh
              sudo chown -R www-data:www-data .
              sudo find ./ -type d -exec chmod 775 {} \;
              sudo find ./ -type f -exec chmod 644 {} \;
              
              
              # Set execute permissions for ffmpeg.exe
              chmod +x ./plugins/ffmpeg/ffmpeg.exe
              chmod +x ./periodic/cron.php
              chmod +x ./image_transcoder.php
              # Set permissions for the specified directories
              chmod 777 ./inc
              chmod 777 ./cache
              chmod 777 ./cache_public
              chmod 777 ./logs
              chmod 777 ./tmp
              chmod 777 ./storage
              chmod 777 ./periodic
              
              Login or Join to comment.