Forums » SEPHP Help and Tips

SE video encoding settings

    • 6 posts
    January 13, 2020 2:26 PM EST

    Hello. I am new to the forum. If this is not the correct place to post my question, please let me know.

    We want to change the ffmpeg video encoding setting for our community's videos. Is that accomplished via a SE config file? We found the view.tpl for the player but have not found anything for the encoder.  Also, would there be a similar setting for creating the video thumbnail?

    • Moderator
    • 4454 posts
    January 14, 2020 5:33 AM EST

    Hi! This is the perfect place to post if you are not talking about a third party video plugin.

    Usually, video encoding settings are set by the server configuration and automatically pulled in to the SocialEngine back end once the path to ffmpeg is entered. You can view them in the video settings. I'll see if someone else can help with this question in case there is something in the SE script that could be configured. Did you already ask the host?

    • Moderator
    • 15 posts
    January 14, 2020 6:56 AM EST

    Hi, there is a Encode.php file at the below mentioned path where all these settings related to video encoder, ffmpeg and thumbnail are present. You can make the changes to this file according to your requirement.

    /application/modules/Video/Plugin/Task/Encode.php

     

     

    • Moderator
    • 4454 posts
    January 14, 2020 8:30 AM EST

    Thank you for answering @Neha

    As that is a source file, we (SocialEngine) do not recommend modifications to source files and do not provide support for modified sites. You are encouraged to backup any files you choose to modify. Also, since modifications can cause issues to site stability or performance, you would do so at your own risk. If you aren't familiar with any possible ramifications of modifications, it's best to see expert help or to make your own plugin for the modifications rather than editing source files. Modifications to source files can cause upgrade issues and will be overwritten on upgrades.

    Above is a standard warning/notification any time someone wants to modify source files. 

    • 6 posts
    January 14, 2020 3:34 PM EST
    Neha Arora said:

    Hi, there is a Encode.php file at the below mentioned path where all these settings related to video encoder, ffmpeg and thumbnail are present. You can make the changes to this file according to your requirement.

    /application/modules/Video/Plugin/Task/Encode.php

     

     @neha Arora - thank you very helpful.

     

    • 6 posts
    January 14, 2020 3:35 PM EST

    @donna - indeed thank you for the heads up.

    • 6 posts
    January 14, 2020 7:17 PM EST

    @neha - the encode.php is the bomb. Thanks.  When I try to upload a file that is 700MB but a little larger than 1280x720 I get the errors on the upload page:

    • Video Source: Please complete this field - it is required.
    • Video Title: Please complete this field - it is required.

    Eventhough both were entered. Is there a PHP config file I need to edit? There used to be a discussion in SE documentation.  Did they remove it?

    Thanks in advance.

     

    (BTW - I uploaded the same file manually and used CLI commands to process.  It works fine.)

     


    This post was edited by Adventuresport at January 14, 2020 7:18 PM EST
    • Moderator
    • 15 posts
    January 15, 2020 1:35 AM EST

    @Adventuresport, you're welcome!

    For the issue you have further mentioned, I need to check what all changes have you made to the encode.php file. Please Inbox (direct message) me the details so that I can check.

    • 6 posts
    January 29, 2020 1:59 PM EST

    Hi all. The issue was on the PHP.INI file.  It allows us to upload a 2Gb file but does not encode the video. Also we are getting a PHP Fatal error:

    [23-Jan-2020 20:58:36 UTC] PHP Fatal error:  Call to a member function setFromArray() on null in /home/scoa/public_html/application/modules/Video/controllers/IndexController.php on line 207

     

     


    This post was edited by Adventuresport at January 29, 2020 2:07 PM EST
    • Moderator
    • 15 posts
    January 30, 2020 1:32 AM EST

    @Adventuresport

    Hi, please try making the following changes in the file and tell me what response you get:

    1) Please replace below code :

    // Create video $table = Engine_Api::_()->getDbtable('videos', 'video'); if ($values['type'] == 'upload') { $video = Engine_Api::_()->getItem('video', $this->_getParam('id')); unset($values['duration']); } else { $information = $this->handleIframelyInformation($values['url']); if (empty($information)) { $form->addError('We could not find a video there - please check the URL and try again.'); } $values['code'] = $information['code']; $values['thumbnail'] = $information['thumbnail']; $values['duration'] = $information['duration']; $video = $table->createRow(); }

     with the below mentioned code: 

    // Create video $table = Engine_Api::_()->getDbtable('videos', 'video'); print_r($values); var_dump($this->_getParam('id')); if ($values['type'] == 'upload') { $video = Engine_Api::_()->getItem('video', $this->_getParam('id')); var_dump(empty($video)); die('123'); unset($values['duration']); } else { $information = $this->handleIframelyInformation($values['url']); if (empty($information)) { $form->addError('We could not find a video there - please check the URL and try again.'); } $values['code'] = $information['code']; $values['thumbnail'] = $information['thumbnail']; $values['duration'] = $information['duration']; $video = $table->createRow(); } die('abc');



    After making these changes, please share the response with me so that I can further let you know about the issue being faced by you.

    **We do not recommend making such changes on production website, so you can try making the changes first on staging website.


    This post was edited by Neha Arora at January 30, 2020 5:46 AM EST
    • Moderator
    • 21 posts
    January 30, 2020 1:57 AM EST

    @Neha, the code suggested by you has the below code, which is not advisable. Kindly check your code and edit if required.

     

    print_r ($values)

     

     

    Also, as mentioned by Donna, SocialEngine do not recommend modifications to source files. So if still these modifications are being done, first try on the staging site.

    • Moderator
    • 15 posts
    January 30, 2020 2:34 AM EST
    SNS-Shubhra said:

    @Neha, the code suggested by you has the below code, which is not advisable. Kindly check your code and edit if required.

     

    print_r ($values)

     

     

    Also, as mentioned by Donna, SocialEngine do not recommend modifications to source files. So if still these modifications are being done, first try on the staging site.

    @Shubhra, the code is just for checking the response so that issue can be further looked upon. 

    I've edited the post for more clarity. 


    This post was edited by Neha Arora at January 30, 2020 2:35 AM EST
    • Moderator
    • 4454 posts
    January 30, 2020 5:15 AM EST

    As the above, if done wrong and not understood can ruin your site, it is best to seek expert help.

    • 6 posts
    January 30, 2020 12:05 PM EST

    @SocialEngine Moderators - is this something your support team can help with?

    • Moderator
    • 4454 posts
    January 30, 2020 2:13 PM EST

    No we don't assist with customizations but there are quite a few third party experts who can assist. We give general guidance here but not in depth details as some changes could disrupt a site and have undesired results.