• Resolved ccheverie

    (@ccheverie)


    Hi there,

    I am having issues getting plugin working locally. I am using Mamp server on Macbook OSX 10.9.5. I have installed ffmeg using Homebrew with all options. I keep getting this error:
    FFMPEG is not found on the server. The only extensions available for uploading: mp4.
    Please verify with your administrator or hosting provider to have this installed and configured. If ffmpeg is installed but you still see this message, specify the path to ffmpeg installation below:

    I try to add the path manually to “/usr/local/bin/ffmpeg” but no dice.

    Any ideas what I am doing wrong? Any help is greatly appreciated!

    Cheers,
    Colin

    https://ww.wp.xz.cn/plugins/wp-video-posts/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author AlexRayan

    (@alexrayan)

    Hi Colin,

    How are you?

    Yes, the plugin works with WP4. Could you please email me your site’s url and credentials to alex @ alexiz.com so I could test the settings and help you with the configuration?

    Have you tested if an apache default user is able to access /usr/local/bin/ffmpeg via a command line?
    What happens when you click on “Re-Check” under the system environment specs box in the plugin’s settings?

    Best regards,
    Alex

    Thread Starter ccheverie

    (@ccheverie)

    Hi Alex, thanks for getting back to me!

    I am just working locally on this via Mamp. I was going to try the setup out on a PC later today but interested in perhaps what I am doing wrong on my Mac. I have tested via Terminal and I can successfully convert a file with ffmpeg so I believe it is working. When I click on Recheck, it just says “Not Found”.

    Thanks for any assistance you can lend!

    Cheers Colin

    Plugin Author AlexRayan

    (@alexrayan)

    Hi Colin,

    Sorry for delay with reply.
    I have never tester wordpress or the plugin on Mac’s mamp, but I assume it should be similar to wamp. When you tested ffmpeg via the terminal did you run the command as the main apache user?
    The plugin will be executing ffmpeg command as apache user via exec:
    “/path/to/ffmpeg -y -i /path/to/file/to/convert -vframes 1 -ss 2 -f image2 /path/to/file/to/save.jpg”
    where /path/to/ is a path to ffmpeg taken from the settings, /path/to/file/to/convert would be a test file within the plugin’s folder /classes/test and /path/to/file/to/save is going to be a jpg file that we’re trying to create from the mp4 test file to confirm ffmpeg functioning.

    Could you please check if you have a jpg file created in the following directory: /wp-content/plugins/wp-video-posts/classes/test/ ?

    If not, could you try to execute the conversion command via apache user via a terminal to see what the error output you’re getting?

    These are the steps I would take to try to debug the issue.

    Best regards,
    Alex

    Thread Starter ccheverie

    (@ccheverie)

    First of all, Alex thanks so much for assisting me with this, just want to know I appreciate it!

    So ran the test within the /classes/test folder on that .mp4 file that comes with the plugin. It seems to work fine. It created a jpg. Here is view from Terminal and after I do a “ls -la” to show the files in there afterwards. I will try the other suggested via apache user as well now and report back. I also posted a couple of screens of the image that was created by this process (save.jpg) and my admin screen for the plugin:
    http://www.boothead.ca/screen.png
    http://www.boothead.ca/save.jpg

    Terminal:
    Colin-Cheveries-MacBook-Pro:test cjcheverie$ ffmpeg -y -i ffmpeg_test_video.mp4 -vframes 1 -ss 2 -f image2 save.jpg
    ffmpeg version git-2014-10-19-69071e8 Copyright (c) 2000-2014 the FFmpeg developers
    built on Oct 18 2014 22:23:10 with Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
    configuration: –prefix=/usr/local/Cellar/ffmpeg/HEAD –enable-shared –enable-pthreads –enable-gpl –enable-version3 –enable-nonfree –enable-hardcoded-tables –enable-avresample –enable-vda –cc=clang –host-cflags= –host-ldflags= –enable-libx264 –enable-libfaac –enable-libmp3lame –enable-libxvid –enable-libfreetype –enable-libtheora –enable-libvorbis –enable-libvpx –enable-librtmp –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libvo-aacenc –enable-libass –enable-ffplay –enable-libspeex –enable-libschroedinger –enable-libfdk-aac –enable-libopus –enable-frei0r –enable-libopenjpeg –disable-decoder=jpeg2000 –extra-cflags=’-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 ‘
    libavutil 54. 10.100 / 54. 10.100
    libavcodec 56. 8.102 / 56. 8.102
    libavformat 56. 9.101 / 56. 9.101
    libavdevice 56. 1.100 / 56. 1.100
    libavfilter 5. 1.106 / 5. 1.106
    libavresample 2. 1. 0 / 2. 1. 0
    libswscale 3. 1.101 / 3. 1.101
    libswresample 1. 1.100 / 1. 1.100
    libpostproc 53. 3.100 / 53. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘ffmpeg_test_video.mp4’:
    Metadata:
    major_brand : mp42
    minor_version : 1
    compatible_brands: isommp41avc1
    creation_time : 2009-02-19 18:49:05
    Duration: 00:00:08.04, start: 0.000000, bitrate: 3129 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1024×576 [SAR 1:1 DAR 16:9], 3009 kb/s, 25 fps, 25 tbr, 600 tbn, 50 tbc (default)
    Metadata:
    creation_time : 2009-02-19 18:49:05
    handler_name : ?Apple Video Media Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
    creation_time : 2009-02-19 18:49:05
    handler_name : ?Apple Sound Media Handler
    Stream #0:2(eng): Data: none (mp4s / 0x7334706D), 0 kb/s (default)
    Metadata:
    creation_time : 2009-02-19 18:49:05
    handler_name : ?
    Stream #0:3(eng): Data: none (mp4s / 0x7334706D), 0 kb/s (default)
    Metadata:
    creation_time : 2009-02-19 18:49:05
    [swscaler @ 0x7fa5e1817600] deprecated pixel format used, make sure you did set range correctly
    Output #0, image2, to ‘save.jpg’:
    Metadata:
    major_brand : mp42
    minor_version : 1
    compatible_brands: isommp41avc1
    encoder : Lavf56.9.101
    Stream #0:0(eng): Video: mjpeg, yuvj420p(pc), 1024×576 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
    creation_time : 2009-02-19 18:49:05
    handler_name : ?Apple Video Media Handler
    encoder : Lavc56.8.102 mjpeg
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
    Press [q] to stop, [?] for help
    frame= 1 fps=0.0 q=6.8 Lsize=N/A time=00:00:00.04 bitrate=N/A
    video:56kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Colin-Cheveries-MacBook-Pro:test cjcheverie$ ls
    ffmpeg_test_video.mp4 save.jpg
    Colin-Cheveries-MacBook-Pro:test cjcheverie$ view save.jpg
    Colin-Cheveries-MacBook-Pro:test cjcheverie$ ls -la
    total 6256
    drwxr-xr-x+ 4 cjcheverie staff 136 21 Oct 08:44 .
    drwxr-xr-x+ 7 cjcheverie staff 238 18 Oct 21:21 ..
    -rw-r–r–+ 1 cjcheverie staff 3144689 18 Oct 20:58 ffmpeg_test_video.mp4
    -rw-r–r–@ 1 cjcheverie staff 56982 21 Oct 08:44 save.jpg

    Plugin Author AlexRayan

    (@alexrayan)

    Hi Colin,

    Thank you for the very detailed report!

    I think I know what the problem might be. The correct path in “Path to ffmpeg installation” should be just the path to the directory without ffmpeg, so please change it to “/usr/local/bin/” from “/usr/local/bin/ffmpeg” and Re-Check the ffmpeg from the System Environment block.

    Please let me know if it changes anything for you to the positive outcome.

    Best regards,
    Alex

    Thread Starter ccheverie

    (@ccheverie)

    Yeah, I had it like that before, and just tried now and still not working. Any specific files I might need to chmod permissions on perhaps?

    Thread Starter ccheverie

    (@ccheverie)

    Wait, check that, getting this message now… progress? πŸ™‚

    I had to change path to what you suggested, do a Recheck which still say Not Found, but then after I clicked Update Options, I see this now:
    http://www.boothead.ca/screen2.png

    Plugin Author AlexRayan

    (@alexrayan)

    Hi Colin,

    Yes, it does look like a progress to me : )
    Do you see a settings block for ffmpeg at the bottom of the page? If so, ffmpeg is found correctly.

    The settings, however, are recorded as “update_option(‘wpvp_ffmpeg_exists’, false);”.

    Looks like this command is failing at some step: wpvp_command_exists_check()
    If the file is generated in the directory /test/ and you can see it, try changing permissions of the file. It could be that file_exists() returns false.
    Please print_r($source) before file_exists() on line 32 in wpvp-helper-class.php, you should see the output in the default settings page.

    Best regards,
    Alex

    Plugin Author AlexRayan

    (@alexrayan)

    Here’s the steps we can do to test:
    1. Check if the file /test/ffmpeg_test_video.mp4.jpg exists.
    If it does, please do #a.
    If it does not, please do #b.

    #a Change permissions on the file ffmpeg_test_video.mp4.jpg and check what file_exists() function returns – true or false – on line 32 in wpvp-helper-class.php. Please print_r $source that goes into file_exists() for me.

    #b Click on “Re-Check FFMPEG”.
    Check if the file /test/ffmpeg_test_video.mp4.jpg exists.
    If it does not please let me know. In this case the flags passed to the encoding command of ffmpeg may be failing for your version of ffmpeg. We’ll investigate further if that’s the case.

    Best regards,
    Alex

    Thread Starter ccheverie

    (@ccheverie)

    Okay I tried this Alex and it prints out:
    /Users/cjcheverie/Sites/boot/_projects/cps/stay-in-the-game/site/src/wp-content/plugins/wp-video-posts/classes/test/ffmpeg_test_video.mp4

    I changed permissions like you suggested.

    Here’s the weird thing. If I change the “path to ffmpeg” to something like /usr/local/bin/, and Update Options, then go back and change it to proper, /usr/local/bin, and Update Options – I get Found message and yes, I am seeing the Advanced Options for FFMPEG at the bottom of the page now. But still getting the error: FFMPEG test encoding failed. Possible reasons: permissions on the plugins directory, incorrectly configured ffmpeg, etc.

    AND… if I reload this page, or navigate away and come back, it goes back to Not Found, and I have to repeat the steps.

    I think this might be a “me” issue, the php you have here seems correct as a condition check. I think I need to test on a PC machine and come back with results there.

    Plugin Author AlexRayan

    (@alexrayan)

    Hi Colin,

    There are actually 2 checks being made in the plugin.
    First, it checks if extension is present by running

    which /usr/local/bin/ffmpeg

    which is your case seems to correctly return true now.
    When the above returns false, you would not be able to see the ffmpeg settings at the bottom.

    Then the second check is trying to encode a test video from /classes/test/ directory to a single frame jpg via a command. And here’s where it’s failing for you.

    You said that the encoded file was present in /classes/test, right? The file name should be ffmpeg_test_video.mp4.jpg (please note jpg extension at the end).
    It means that the encoding itself ran correctly, but the file_exists() check at the end of the function returned false.

    Hence, it could be that if(file_exists('/Users/cjcheverie/Sites/boot/_projects/cps/stay-in-the-game/site/src/wp-content/plugins/wp-video-posts/classes/test/ffmpeg_test_video.mp4.jpg')) returns false due to either permissions on the file itself or on the parent directory where the file is located.

    This is another check you could do. Place the following somewhere in an options file (wpvp-options.php) to execute where you can see the output and please let me know if you get the correct response and if the file is actually physically there:

    $source = '/Users/cjcheverie/Sites/boot/_projects/cps/stay-in-the-game/site/src/wp-content/plugins/wp-video-posts/classes/test/ffmpeg_test_video.mp4.jpg';
    if(file_exists($source)):
       echo 'File exists '.$source;
    else:
       echo 'Does not exist '.$source;
    endif;

    Best regards,
    Alex

    Thread Starter ccheverie

    (@ccheverie)

    I ran it like this and it named the jpg, “save.jpg”:
    $ ffmpeg -y -i ffmpeg_test_video.mp4 -vframes 1 -ss 2 -f image2 save.jpg

    That might be my problem then!

    Plugin Author AlexRayan

    (@alexrayan)

    Hi Colin,

    So you are saying you don’t have this file ffmpeg_test_video.mp4.jpg in /classes/test/ directory?
    If so, then it could be permissions on /test/ folder.
    Could you please tell me what permissions are on that folder and who’s the owner and the group on it?

    Regards,
    Alex

    Thread Starter ccheverie

    (@ccheverie)

    Thats right, I named the jpg file “save.jpg” in the ffmpeg script to test it. Here are my settings:
    drwxr-xr-x+ 4 cjcheverie staff 136 21 Oct 12:41 test

    Plugin Author AlexRayan

    (@alexrayan)

    hmm, sorry Colin, it’s a little difficult for me to debug what the problem might be without having access to the server since it’s on your local machine.

    Here’s what you can try in order for us to test further if at least the conversion works fine.

    Please update the following option in the options table:
    wpvp_ffmpeg_exists to 1.

    If you do that and then refresh the settings page, the error message should go away.

    After that you can create a test video under Videos and see if it gets encoded correctly and a thumbnail gets created.

    Best regards,
    Alex

Viewing 15 replies - 1 through 15 (of 17 total)

The topic ‘Does this work with WP 4?’ is closed to new replies.