1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice
What Do You Need In The Xf2 Xengallery Version? Vote for your choices here: http://www.sonnb.com/threads/what-do-you-need-in-the-xf2-xengallery-version.1539/

Help Encoding Failed And An Error Was Returned From Ffmpeg

Discussion in 'XenGallery - Video Upload' started by RobinHood, Sep 22, 2016.

  1. RobinHood

    RobinHood Authorized Member Authorized

    I got this error when trying to upload a video from my phone
    Code:
    Error Info
    PHPVideoToolkit\FfmpegProcessOutputException: Encoding failed and an error was returned from ffmpeg. Error code 1 was returned the message (if any) was: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height - library/PHPVideoToolkit/FfmpegProcessProgressable.php:284
    Generated By: Unknown Account, 18 minutes ago
    Stack Trace
    #0 /home/evolve/public_html/library/PHPVideoToolkit/Media.php(662): PHPVideoToolkit\FfmpegProcessProgressable->completeProcess()
    #1 [internal function]: PHPVideoToolkit\Media->_postProcessOutput(Object(PHPVideoToolkit\FfmpegProcessProgressable))
    #2 /home/evolve/public_html/library/PHPVideoToolkit/Media.php(766): call_user_func(Array, Object(PHPVideoToolkit\FfmpegProcessProgressable))
    #3 [internal function]: PHPVideoToolkit\Media->PHPVideoToolkit\{closure}(Object(PHPVideoToolkit\ExecBuffer))
    #4 /home/evolve/public_html/library/PHPVideoToolkit/ExecBuffer.php(403): call_user_func(Object(Closure), Object(PHPVideoToolkit\ExecBuffer))
    #5 /home/evolve/public_html/library/PHPVideoToolkit/ExecBuffer.php(384): PHPVideoToolkit\ExecBuffer->_callCompletionCallbacks()
    #6 /home/evolve/public_html/library/PHPVideoToolkit/Media.php(779): PHPVideoToolkit\ExecBuffer->execute(Object(Closure))
    #7 /home/evolve/public_html/library/sonnb/XenGalleryVideoUpload/Model/FFMPEG.php(103): PHPVideoToolkit\Media->save('/home/evolve/pu...', Object(PHPVideoToolkit\VideoFormat_H264), -2, Object(PHPVideoToolkit\ProgressHandlerOutput))
    #8 /home/evolve/public_html/library/sonnb/XenGalleryVideoUpload/Deferred/ConvertVideo.php(56): sonnb_XenGalleryVideoUpload_Model_FFMPEG->convert('mp4', Object(PHPVideoToolkit\ProgressHandlerOutput))
    #9 /home/evolve/public_html/library/XenForo/Model/Deferred.php(295): sonnb_XenGalleryVideoUpload_Deferred_ConvertVideo->execute(Array, Array, 7.9999940395355, '')
    #10 /home/evolve/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.9999940395355, '', false)
    #11 /home/evolve/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, 8, '', false)
    #12 /home/evolve/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
    #13 {main}
    Request State
    array(3) {
      ["url"] => string(37) "https://.com/deferred.php"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(4) {
        ["_xfRequestUri"] => string(33) "/gallery/albums/mobile-uploads.7/"
        ["_xfNoRedirect"] => string(1) "1"
        ["_xfToken"] => string(8) "********"
        ["_xfResponseType"] => string(4) "json"
      }
    }
    I've just had ffmpeg installed
     
  2. RobinHood

    RobinHood Authorized Member Authorized

    Getting this error quite a lot, even though my recent upload seem successful
     
  3. sonnb

    sonnb Administrator Staff Member

    What is your ffmpeg version? By looking at the error message, it seems your version is quite old:
    The conversion process runs after the video was uploaded so you will see no message while uploading it.
     
  4. RobinHood

    RobinHood Authorized Member Authorized

    Hmm...I asked my host to install it, so I'm not 100% sure.

    This is what is says when I run the ffmpeg -version command in my console

    Code:
    ffmpeg version N-81714-g257fbc3 Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
    configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx265
    libavutil      55. 30.100 / 55. 30.100
    libavcodec     57. 57.101 / 57. 57.101
    libavformat    57. 50.100 / 57. 50.100
    libavdevice    57.  0.102 / 57.  0.102
    libavfilter     6. 62.100 /  6. 62.100
    libswscale      4.  1.100 /  4.  1.100
    libswresample   2.  1.100 /  2.  1.100
    libpostproc    54.  0.100 / 54.  0.100
     
     
  5. sonnb

    sonnb Administrator Staff Member

    RobinHood likes this.
  6. RobinHood

    RobinHood Authorized Member Authorized

    No problem, I'll ask them to sort that.
     
  7. RobinHood

    RobinHood Authorized Member Authorized

    @sonnb I'm still waiting for my host to look at this as they don't respond to tickets on weekends, but are you sure that's correct?

    I think the 20120313 you're looking at refers to the GCC build date

    Above it has a 2016 copyright, which indicates it's newer?

    ffmpeg version N-81714-g257fbc3 Copyright (c) 2000-2016 the FFmpeg developers

    The only google search results for that build no. are the last few days
     
    Last edited: Sep 25, 2016
  8. RobinHood

    RobinHood Authorized Member Authorized

    Hey Son,

    So my host rebuilt from the latest source, and he said it looks to be the same version

    Will try and get some users to do some more upload testing to see if we get any more errors.
     
  9. RobinHood

    RobinHood Authorized Member Authorized

    Yep, still getting an error uploading vids from my phone. Although the video does appear to upload and play just fine, I'm guessing because it doesn't actually need transcoding?

    Code:
    PHPVideoToolkit\FfmpegProcessOutputException: Encoding failed and an error was returned from ffmpeg. Error code 1 was returned the message (if any) was: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height - library/PHPVideoToolkit/FfmpegProcessProgressable.php:284
    Generated By: Unknown Account, 3 minutes ago
    Stack Trace
    #0 /home/evolve/public_html/library/PHPVideoToolkit/Media.php(662): PHPVideoToolkit\FfmpegProcessProgressable->completeProcess()
    #1 [internal function]: PHPVideoToolkit\Media->_postProcessOutput(Object(PHPVideoToolkit\FfmpegProcessProgressable))
    #2 /home/evolve/public_html/library/PHPVideoToolkit/Media.php(766): call_user_func(Array, Object(PHPVideoToolkit\FfmpegProcessProgressable))
    #3 [internal function]: PHPVideoToolkit\Media->PHPVideoToolkit\{closure}(Object(PHPVideoToolkit\ExecBuffer))
    #4 /home/evolve/public_html/library/PHPVideoToolkit/ExecBuffer.php(403): call_user_func(Object(Closure), Object(PHPVideoToolkit\ExecBuffer))
    #5 /home/evolve/public_html/library/PHPVideoToolkit/ExecBuffer.php(384): PHPVideoToolkit\ExecBuffer->_callCompletionCallbacks()
    #6 /home/evolve/public_html/library/PHPVideoToolkit/Media.php(779): PHPVideoToolkit\ExecBuffer->execute(Object(Closure))
    #7 /home/evolve/public_html/library/sonnb/XenGalleryVideoUpload/Model/FFMPEG.php(103): PHPVideoToolkit\Media->save('/home/evolve/pu...', Object(PHPVideoToolkit\VideoFormat_H264), -2, Object(PHPVideoToolkit\ProgressHandlerOutput))
    #8 /home/evolve/public_html/library/sonnb/XenGalleryVideoUpload/Deferred/ConvertVideo.php(56): sonnb_XenGalleryVideoUpload_Model_FFMPEG->convert('mp4', Object(PHPVideoToolkit\ProgressHandlerOutput))
    #9 /home/evolve/public_html/library/XenForo/Model/Deferred.php(295): sonnb_XenGalleryVideoUpload_Deferred_ConvertVideo->execute(Array, Array, 7.9999971389771, '')
    #10 /home/evolve/public_html/library/XenForo/Model/Deferred.php(429): XenForo_Model_Deferred->runDeferred(Array, 7.9999971389771, '', false)
    #11 /home/evolve/public_html/library/XenForo/Model/Deferred.php(374): XenForo_Model_Deferred->_runInternal(Array, 8, '', false)
    #12 /home/evolve/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
    #13 {main}
    Request State
    array(3) {
      ["url"] => string(37) "https://.com/deferred.php"
      ["_GET"] => array(0) {
      }
      ["_POST"] => array(4) {
        ["_xfRequestUri"] => string(38) "/gallery/albums/test-video-uploads.23/"
        ["_xfNoRedirect"] => string(1) "1"
        ["_xfToken"] => string(8) "********"
        ["_xfResponseType"] => string(4) "json"
      }
    }
    
     
  10. RobinHood

    RobinHood Authorized Member Authorized

    I'm wondering if I've got the binary path's wrong.

    They're both currently entered and being accepted in the ACP options when saving as

    /bin/ffmpeg
    /bin/ffprobe

    But when I ssh in that doesn't look right. But it's the only version that will save in the options. I'm not that familiar with the command line, so I might be reading it wrong. I can give you details if you want to check.

    edit: nvm, that looks right, so I don't know what the issue is
     
    Last edited: Sep 26, 2016
  11. sonnb

    sonnb Administrator Staff Member

    Encoding them to MP4 is to make sure it works on all the browsers with HTML5 video format.
     
    RobinHood likes this.
  12. sonnb

    sonnb Administrator Staff Member

    The issue could be related the configuration (the build option when compiling the library), here is mine:
    Code:
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
    libavutil      52. 19.100 / 52. 19.100
    libavcodec     55.  0.100 / 55.  0.100
    libavformat    55.  0.100 / 55.  0.100
    libavdevice    54.  4.100 / 54.  4.100
    libavfilter     3. 45.103 /  3. 45.103
    libswscale      2.  2.100 /  2.  2.100
    libswresample   0. 17.102 /  0. 17.102
    libpostproc    52.  2.100 / 52.  2.100
    
    Can you kindly give these to your host to see if they can re-compile ffmpeg with the same options.
    Could you also try to play around with these options which related to conversion. Change them to see if any option work for you.

    upload_2016-9-27_7-58-16.png
     
  13. RobinHood

    RobinHood Authorized Member Authorized

    I had my host upload a static build instead from here, as that's what lots of people seem to be doing for the XenForoMedia gallery

    https://www.johnvansickle.com/ffmpeg/

    Now it seems to accept it and gives me the transcoding notice after upload.

    But once it's done it shows this in the error long

    I could ask them to compile with the config you specify above if you think that will work instead?
     
  14. sonnb

    sonnb Administrator Staff Member

    Well, at least it works (the conversion), for the new issue, actually it was reported once here: http://www.sonnb.com/threads/recent-server-errors.1004/ I am still unable to find a way to fix it yet. But it indicates the conversion is finished, just some more steps to complete the work.

    You can kindly ask them to try if it works.
     

Share This Page