when I run the test:
Invalid argument supplied for foreach() in /home/xxxxx/public_html/sites/all/modules/ffmpeg_wrapper/ffmpeg_wrapper.module on line 371.

and nothing converted
It`s PHP 5.3 issue

CommentFileSizeAuthor
#5 formatspatch.patch627 bytesHonorsGrad

Comments

HonorsGrad’s picture

I'm getting the same with PHP 5.2.

HonorsGrad’s picture

Looks like it is an issue with this set of code:

    $output = ffmpeg_wrapper_run_command('-formats');

    // parse the list
    // we know where the codecs are by looking at the output of ffmpeg -formats
    $codecs_formats_pos = strpos($output, "Codecs:");
    $codecs_formats_pos_end = strpos($output, "Supported file protocols:");
    $codecs = substr($output, $codecs_formats_pos, ($codecs_formats_pos_end - $codecs_formats_pos));

    // remove the extra text
    $codecs = str_replace('Codecs:', '', $codecs);
    // convert to array
    $codecs = explode("\n", $codecs);

The substr is returning an empty string, which results in an empty array for the subsequent foreach (a few lines down). Ultimately, this then returns an empty array to line 371.

HonorsGrad’s picture

FFMPEG Vitals

FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 4 2010 15:35:31 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0

arthurf’s picture

Can you confirm this under the 6.2.x branch?

HonorsGrad’s picture

StatusFileSize
new627 bytes

Looks like the command to ffmpeg has changed parameters. It should be "-codecs" vs. "-formats". Patch is attached.

Steps to Resolve:

1. Upload Patch [formatspatch.patch] to ffmpeg_wrapper
2. Apply Patch (within ffmpeg_wrapper directory)
patch < formatspatch.patch
3. Clear Cache (command below for drush-enabled sites)
drush cache-clear all
4. Test

HonorsGrad’s picture

@arthurf

No, I'm using 6.x-1.1-beta2

arthurf’s picture

Can you try the 6.2.x branch and confirm this? If you look at class_ffmpeg_wrapper, get_codecs() this change should be correctly accounted for.

arthurf’s picture

Sorry, seems like we keep overlapping one another in posts here.

In the dev version of 6.1.x this should be correctly handled. ffmpeg_wrapper_get_codecs() checks for the version before trying to do formats or codecs. If you could testwith the 6.2.x branch though- that's where all future work will go- that'd be awesome as I would like to drop the 6.1.x as soon as possible.

HonorsGrad’s picture

Based on inspecting the CVS, it looks to be appropriately handled in 6.2.x (much more elegantly than the patch does, I might add). I'll test and report back.

How close/stable is -dev? I really need this module for a site going to production by end of year and that was the reason for choosing the alpha over dev. Does the 6.2.x branch have an alpha/beta/official release in the works?

arthurf’s picture

The 6.2.x should be no more/less stable than the 6.1.x. The main difference is in some of the UI functionality which allows for testing transcoding of files. In terms of their architectural differences, 6.2.x is redone, but basically using the same functions from 6.1.x. I think they are pretty much compatible.

ayalsule’s picture

thanks for quick reply I applied the Patch in #5 and The Error disappear but the conversion failed and the message say:There were errors during the conversion!

HonorsGrad’s picture

@ayalsule

Did you clear cache, etc? What is the file format you're converting from and to? Does the ffmpeg install (not the drupal module) handle it? Are you using default settings? I was able to successfully move several video files (mainly avi) to flv without issue. As arthurf noted, 2.x dev may be a better alternative - or 1.x dev.

@arthurf

I tested 6.2.x dev without success. The AJAX call is failing on the conversion - still investigating why.

Thanks for the help and info.

ayalsule’s picture

Dear @HonorsGrad

dp 6.19 / FFMPEG_WRAPPER 6.x-1.1-beta2
I cleared the cache and run cron , FFMPEG installed
wmv -> flv
any way I was testing ffmpeg converting because FlashVideo conversion failed
The Error was caused by (mp3):
-i @input -f flv -acodec mp3 -ar 22050 -ab 64k -ac 1 @output
I replaced mp3 with libmp3lame :
-i @input -f flv -acodec libmp3lame -ar 22050 -ab 64k -ac 1 @output
and It`s worked.
Thanks