Hi!

My installation does not work anymore since we've upgraded FFmpeg.

It seems like FFmpeg has split the -formats option into -formats AND -codecs.
http://ffmpeg.org/changelog.html
http://ffmpeg.org/ffmpeg-doc.html#SEC8

FFmpeg versions that I've tested:
FFmpeg SVN-r21107/git-f10acf5 on Debian Lenny
FFmpeg SVN-r21153 on Ubuntu 9.10 Desktop in Virtualbox

FFmpegWrapper can not list available codecs with these versions.

All the best!
/Jonas

Comments

arthurf’s picture

Can you run ffmpeg and give the output here so I can see how the regex needs to be adjusted?

HappyCloud’s picture

I've attached outputs from:

ffmpeg -formats
ffmpeg -codecs

And a screen dump from /admin/settings/ffmpeg_wrapper in Drupal.

Tell me if you want something else.

torgospizza’s picture

StatusFileSize
new7.52 KB
new1.13 KB

Subscribing. I have this same issue. I am running ffmpeg SVN-r21643, PHP 5.2.6-ubuntu3.

Attached is some output from admin/settings/ffmpeg_wrapper as well as running ffmpeg -formats.

Thanks!

torgospizza’s picture

StatusFileSize
new20.61 KB

Attached is the output containing the -codecs output as well.

fdavis47714’s picture

I would like to try out this module, but am concerned about this issue. Can anyone tell me the last known ffmpeg version that should be safe to use?

torgospizza’s picture

For me, I was able to get ffmpeg wrapper working by changing the lines in code that checked for the positions of the start and end points of the list of codecs/file formats. (See my previous attachment for how it looks on my setup.)

The lines I changed ended up being:

// Approx. line 429 in ffmpeg_wrapper_get_codecs($return = 'rows')
$codecs_formats_pos = strpos($output, "Codecs:");
$codecs_formats_pos_end = strpos($output, "Note");

// Approx. line 614, in ffmpeg_wrapper_get_file_format($ret = 'row')
$startpos = strpos($formats, 'File formats:');
$endpos = strpos($formats, 'FFmpeg version');

You can see that the new values coincide with the beginning and end of the output from doing ffmpeg -codecs or ffmpeg -formats. I'm not sure how this varies from install to install, though.

So perhaps a text input configuration (an override) would help, where if you are troubleshooting the issue of not having any available formats or codecs, reviewing the output from ffmpeg can give you an idea of what the new values are, and you can override them by setting the config variable. It would change the above lines to something like this:

$codecs_formats_pos = strpos($output, variable_get('ffmpeg_wrapper_codecs_start',  'Codecs:'));
$codecs_formats_pos_end = strpos($output, variable_get('ffmpeg_wrapper_codecs_end', 'Note'));

$startpos = strpos($formats, variable_get('ffmpeg_wrapper_formats_start', 'File formats:'));
$endpos = strpos($formats, variable_get('ffmpeg_wrapper_formats_end', 'FFmpeg version'));

I also had to delete the cache once I did this since NULL values were currently stored. HTH.

arthurf’s picture

Ok this is really helpful. One option is to write a function that gets the ffmpeg version (ffmpeg -v) and switches how it parses the output. Another might be to write a grep that can handle the differences... long term it's probably better to do it based on version as there is no doubt that it will change again.

arthurf’s picture

oh, fyi, going to admin/settings/ffmpeg_wrapper should clear the cache- was it not for you?

jcmarco’s picture

Status: Active » Needs review
StatusFileSize
new1.24 KB

That are the changes I needed to run FFmpeg version SVN-r21861

zuzu83’s picture

hi,

I am use ffmpeg SVN-r21874.

your patch is good, codecs is detected.

Supported file formats is not detected...

....?

hypertext200’s picture

This is what video module users also faced, and this patch will work

arthurf’s picture

Version: 6.x-1.1-beta2 » 6.x-1.x-dev

applied patch to 6.1, 6.2, thanks jcmarco!

seanb’s picture

StatusFileSize
new4.3 KB

I had the same problem a while ago. The attached patch fixes the issue voor FFmpeg version SVN-r20783. Codecs and file formats work for me. Let me know if it helps!

Regards,
Sean

jcmarco’s picture

StatusFileSize
new3.66 KB

I found that different versions of FFmpeg have the -codecs command or not.
In the "official" version 0.5 only works with -formats
but from SVN-r20561 the -formats command split in different ones thus includes the -codecs command

I have added a new function that gives the version information in different formats,
and using this information I get the codecs and formats using different strings for extracting the configuration.

I have tested it in two installations with different versions (0.5 and SVN-r21861) I guess that it should work to everybody.

arthurf’s picture

@jcmarco - once again, thank you so much for the patch. This is committed to 6.1x, needs to be applied to 6.2x Please test and let me know if we have some success

arthurf’s picture

Patch is applied to 6.2x

delykj’s picture

In my case this is not working. I modified a little bit ffmpeg_wrapper_get_codecs function:

old code:

if ( ((int)$ffmpeg_version >= 20561) || ((float)$ffmpeg_version > 0.5)  ) {

new code:

    $float_ffmpeg_version = ( is_float($ffmpeg_version) || ( (float) $ffmpeg_version != round($ffmpeg_version) || strlen($ffmpeg_version) != strlen( (int) $ffmpeg_version) ) && $ffmpeg_version != 0 );
    if ( ((int)$ffmpeg_version >= 20561) || ($float_ffmpeg_version && ((float)$ffmpeg_version > 0.5))  ) {    
arthurf’s picture

Ok, I did a bunch of refactoring in the 6.2x branch to try to get this code a bit more abstract. Here's what I've come up with:

/**
   * Returns the installed version of FFmpeg
   * @param $format
   *   one of string, version
   * @return $version
   *   String, FFmpeg version
   */
  function get_version($format = 'string') {
    // get string from ffmpeg and return it if it is enough
    $output = $this->command('-version');

    if ($format == 'string') {
      return $output;
    }

    // Search for SVN string
    // FFmpeg version SVN-r20438, Copyright (c) 2000-2009 Fabrice Bellard, et al.
    $pattern = "/ffmpeg version SVN-r([0-9.]*)/i";
    if (preg_match($pattern, $output, $matches)) {
      return array(
        'svn' => (int) $matches[1],
        'version' => (int) $matches[1],
      );
    }

    // Do we have a release?
    // ffmpeg version 0.4.9-pre1, build 4736, Copyright (c) 2000-2004 Fabrice Bellard
    $pattern = "/ffmpeg version ([0-9.]*)/i";
    if (preg_match($pattern, $output, $matches)) {
      return array(
        'release' => (float) $matches[1],
        'version' => (float) $matches[1]
      );
    }

    // Do we have a build version?
    // ffmpeg version 0.4.9-pre1, build 4736, Copyright (c) 2000-2004 Fabrice Bellard
    $pattern = "/ffmpeg version.*, build ([0-9]*)/i";
    if (preg_match($pattern, $output, $matches)) {
      return array(
        'build' => (float) $matches[1],
        'version' => (float) $matches[1],
      );
    }
  }


  /**
   * Acquires all of the codes in use
   * @return unknown_type
   */
  function get_codecs() {
    // Can we utilize cached data?
    if ($codecs = variable_get('ffmpeg_wrapper_codecs', FALSE)) {
      return $codecs;
    }

    // We know where the codecs are by looking at the output of
    // ffmpeg -formats or ffmpeg -codecs depending of
    // version SVN-r > 20561 or version > 0.5
    $ffmpeg_version = $this->get_version('svn');
    if ($ffmpeg_version['svn'] >= 20561 || $ffmpeg_version['release'] > 0.5 ) {
      $codecs = $this->command('-codecs');
      // Remove the leading space
      $codecs_formats_pos = strpos($codecs, 'Codecs:') + 8;
      $codecs_formats_pos_end = strpos($codecs, 'Note,');
    }
    else {
      $codecs = $this->command('-formats');
      // Remove the leading space
      $codecs_formats_pos = strpos($codecs, 'Codecs:') + 8;
      $codecs_formats_pos_end = strpos($codecs, 'Supported file protocols:');
    }

The reason for this approach is that I'd like to move the exception logic out of all the functions that depend on get_version() as much as possible. This doesn't quite get around that, but it moves in that direction. If anybody has any ideas, I'm really open to something different.

mfb’s picture

StatusFileSize
new2.04 KB

I found a server with an unrecognized version number format: r11872+debian_0.svn20080206-18+lenny1 It starts with r rather than SVN-r Also the logic in the 6.x-1.x branch doesn't handle version or revision numbers between 0.5 and 20561 correctly. Patch is attached, guess it needs to be ported to 6.x-2.x

rob c’s picture

i agree with mfb #19

also running a custom version of ffmpeg and the current release just does not work this way.

(-ubuntu-robin-r#number for example)

did not review the patch yet, but i did patched (cut out) the version check and hard code my own version in it and now all is well. (from the get_formats and get_codecs functions that is)

arthurf’s picture

@allrob can you do this on the 2x branch and test? I'm trying to avoid touching the 1.x branch. I'll commit mfb's patch shortly

arthurf’s picture

I committed to parts of the patch- the svn check I think is already handled correctly

rob c’s picture

Downloaded v2.x dev version of today.

Tested on a clean system - this system is running Ubuntu 10.04 (lucid) with the unstripped ffmpeg libs, no fancy stuff, just the basics and stable, no testing, no medibuntu.

results:
print_r ( $ffmpeg_version );
Array (
[svn] => 0
[version] => 0
)

FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1, Copyright (c) 2000-2009 Fabrice Bellard, et al.

FFmpeg wrapper config page:
Supported file formats: works.
Installed codecs: do not.

Tweaking the codec check (so the else part of the parser statement is always used) makes it work again.

And on my other dev system (custom almost everything)

FFmpeg version git-391a132, Copyright (c) 2000-2011 the FFmpeg developers
built on Mar 6 2011 19:13:13 with gcc 4.4.3

And both formats and codecs work, testing mp4/aac/xvid encoding seems to work, no tweaking required. (so it works with a git version.)

I'll add some ffmpeg -formats dumps if you need them.

#14 jcmarco
'In the "official" version 0.5 only works with -formats
but from SVN-r20561 the -formats command split in different ones thus includes the -codecs command'

For the git version i use i can confirm the same, so this will be the future? Better have the straight forward 'official' stuff by default? The rest is old and will be axe-able anyway someday.

And for SVN-r0.5.1-4:0.5.1-1ubuntu1 on lucid i can confirm the -codecs argument is not working, while it's 0.5.x + So that's a small issue to work on.

Keep it up!

arthurf’s picture

So it sounds like the regex for version needs to be updated to include: SVN-r0.5.1-4:0.5.1-1ubuntu1 ?

rob c’s picture

This list can become quite large, but it will do the job.

darrick’s picture

StatusFileSize
new595 bytes

I just downloaded the latest code for 6.x-2.x as of March 14th, 2011 and ran into this problem. Found that $this->get_version('svn') returns an array not a string. I've attached a patch.

arthurf’s picture

Your patch was the correct fix, though looking at my own code, get_version() was a problem. I refactored this a bit to be easier to use and then fixed up the few instances where it is getting called.

mfb’s picture

ffmpeg recently switched from svn to git, and soon after forked into multiple git repositories including one called libav. Yay decentralization. Not sure what this means for ffmpeg versions going forward...

arthurf’s picture

@mfb hopefully these modern versions will handle codecs/formats the same way so that version detection from here forward won't be necessary- note that in the last fix I added support for a version of ffmpeg from *2004* blech!

begun’s picture

This module does not work when ffmpeg is compiled from the git repository. This was causing me all sorts of frustrations. I ended up modifying the ffmpeg_wrapper_class.inc. Had to add the following code to function get_version(). Now it appears to work.

I guess I should submit a patch, but I am rather new to this and am not sure how to do it. Guess it would be a good time to learn ;-)

// Search for git string
// FFmpeg version git-N-29240-gefb5fa7, Copyright (c) 2000-2011 the FFmpeg developers.
$pattern = "/ffmpeg version git-N-([0-9.]*)/i";
if (preg_match($pattern, $output, $matches)) {
  return array(
    'svn' => (int) $matches[1],
    'version' => NULL, // Return NULL as there appears to be no version number.
  );
}
arthurf’s picture

@Begun You might want to check out: http://drupal.org/node/707484 for information on patching

The one thing about your patch here is that I'm guessing that we need to be careful of which git versions are being caught by your pattern. I'm guessing everything greater than 29240 would be ok for now, but we should probably check against previous versions.

mhawker’s picture

Begun,

Thanks for posting this, now the codecs show up for the version of FFmpeg I installed (ffmpeg version git-N-29577-gc402ce4-syslint, Copyright (c) 2000-2011), but I still don't see any Formats.

Do you see formats? I assume this is why I don't have any "Output formats" when try the Test convert file.

arthurf’s picture

It's likely that changes are needed for both get_codecs() and get_formats() - unfortunately I don't have access to a git version of ffmpeg, otherwise I could test this out and get a patch in.

mhawker’s picture

Let me know if I can help. Unfortunately, I'm not a developer/programmer (that's why I used an install script) so I might not be much help.

mfb’s picture

to compile your own ffmpeg from git: git clone git://git.videolan.org/ffmpeg.git && cd ffmpeg && ./configure && make (of course more configure flags would be needed for full codec support)

begun’s picture

@mhawker I was also not getting any formats appearing. I just took another look at ffmpeg_wrapper_class.inc and the problem appears to be occurring in the get_formats method. There is a problem with the value assigned to $endpos variable. I found that changing the following line worked.

Original code on line 270

$endpos = strpos($formats, 'FFmpeg version');

Updated code on line 270

$endpos = strpos($formats, 'ffmpeg version');

Below is the tail end of the 'ffmpeg -formats' command as seen from the command line. As you can see in this version of ffmpeg the first line after the formats uses a lowercase 'f' in 'ffmpeg'. This fixed it for me.

/** Shortened for brevity **/
 D  xa              Maxis XA File Format
 D  xwma            Microsoft xWMA
 D  yop             Psygnosis YOP Format
 DE yuv4mpegpipe    YUV4MPEG pipe format
ffmpeg version git-N-29730-g6841c8c, Copyright (c) 2000-2011 the FFmpeg developers
  built on May  9 2011 17:35:24 with gcc 4.4.3
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libmp3lame --enable-libvpx
  libavutil    51.  2. 1 / 51.  2. 1
  libavcodec   53.  5. 0 / 53.  5. 0
  libavformat  53.  0. 3 / 53.  0. 3
  libavdevice  53.  0. 0 / 53.  0. 0
  libavfilter   2.  5. 0 /  2.  5. 0
  libswscale    0. 14. 0 /  0. 14. 0
  libpostproc  51.  2. 0 / 51.  2. 0
arthurf’s picture

@begun so stripos() works for you?

mhawker’s picture

Again, thanks Begun. That worked for me as well.

In regards to a Git repository install, the changes you made to ffmpeg_wrapper_classic.inc cause codecs and formats installed with FFmpeg now to show up in FFmpeg Wrapper.

arthurf’s picture

@mhawker - do you mean that stripos() fixes the issue alone, or is the additional regex still necessary?

mhawker’s picture

I think additional regex would be needed so that stripos() ignores letter-case for FFmpeg in this particular instance.

EDIT after reading below post:
I had to lookup regex to know what you were asking me so I'm probably the wrong person to ask. I just know when I changed

$endpos = strpos($formats, 'FFmpeg version');
to
$endpos = strpos($formats, 'ffmpeg version');
the formats showed up.

begun’s picture

I just tried out stripos() and it did the trick (see code below). I don't think there is a need to change the regex. I have run both ffmpeg -codecs and ffmpeg -formats from the command line and as far as I can see the output from the git version appears compatible with the regex patterns already in place.

$endpos = stripos($formats, 'FFmpeg version');
arthurf’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

I've committed the above changes- please check to see if things are working.

mhawker’s picture

Installed FFmpeg Wrapper 6.x-2.x-dev (2011-May-13) and my settings are back to the way they were without the changes to ffmpeg_wrapper_class.inc (from Begun's posts).

No formats are listed and the listed codecs all list Decode/Encode - No

ffmpeg version git-N-29577-gc402ce4-syslint, Copyright (c) 2000-2011 the FFmpeg developers built on May 3 2011 13:29:00 with gcc 4.1.2 20080704 (Red Hat 4.1.2-50)

jantoine’s picture

Status: Needs review » Needs work

I am running into this same issue with the ffmpeg_wrapper module version 6.x-2.x-dev as of 2011-05-13 and ffmpeg version ffmpeg git-N-30811-gd8ee777. Below is the version string pulled from the ffmpeg_wrapper module.

ffmpeg git-N-30811-gd8ee777 libavutil 51. 8. 0 / 51. 8. 0 libavcodec 53. 7. 0 / 53. 7. 0 libavformat 53. 3. 1 / 53. 3. 1 libavdevice 53. 1. 1 / 53. 1. 1 libavfilter 2. 18. 0 / 2. 18. 0 libswscale 0. 14. 1 / 0. 14. 1 libpostproc 51. 2. 0 / 51. 2. 0 ffmpeg version git-N-30811-gd8ee777, Copyright (c) 2000-2011 the FFmpeg developers built on Jun 16 2011 17:26:15 with gcc 4.4.3 configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libmp3lame --enable-libvpx libavutil 51. 8. 0 / 51. 8. 0 libavcodec 53. 7. 0 / 53. 7. 0 libavformat 53. 3. 1 / 53. 3. 1 libavdevice 53. 1. 1 / 53. 1. 1 libavfilter 2. 18. 0 / 2. 18. 0 libswscale 0. 14. 1 / 0. 14. 1 libpostproc 51. 2. 0 / 51. 2. 0 

The problem lies in the get_version function. It is currently matching my version with the pattern found on line 179 which is meant to check for releases. The pattern is not actually requiring that a version number be found as the "*" represents zero or more characters. I replaced the "*" with a "+" (one or more characters) and this seems to have fixed the error on the settings page. I am guessing this should be applied to all patterns.

Cheers,

Antoine

heavy_engineer’s picture

^^ worked for me too. thanks.

arthurf’s picture

Status: Needs work » Needs review

I moved the git check up in the version check- I think that should work before the more generic version gets run. Please let me know if this works for you

robmil29’s picture

I am running into the same issue and tried what #44 suggested with no luck. Using the latest 6.x-2.x-dev as of 2011-06-20.

ffmpeg N-31031-gf211d9d libavutil 51. 10. 0 / 51. 10. 0 libavcodec 53. 7. 0 / 53. 7. 0 libavformat 53. 4. 0 / 53. 4. 0 libavdevice 53. 1. 1 / 53. 1. 1 libavfilter 2. 24. 0 / 2. 24. 0 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0 ffmpeg version N-31031-gf211d9d, Copyright (c) 2000-2011 the FFmpeg developers built on Jun 27 2011 01:36:41 with gcc 4.4.3 configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libvpx --enable-libmp3lame libavutil 51. 10. 0 / 51. 10. 0 libavcodec 53. 7. 0 / 53. 7. 0 libavformat 53. 4. 0 / 53. 4. 0 libavdevice 53. 1. 1 / 53. 1. 1 libavfilter 2. 24. 0 / 2. 24. 0 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0 
arthurf’s picture

@robmil29 - can you put some debugging code into the version check function to see what version it's trying to give you?

robmil29’s picture

Hmm.. looks like its trying to give me ffmpeg version 0.4.9-pre1, build4736, under do we a release ? Thank you

mhawker’s picture

The newest dev version recognizes and list everything correctly for me now - ffmpeg git-N-29577-gc402ce4-syslint

arthurf’s picture

@robmil29

Can you try adding the following to pick up your version of ffmpeg?

$pattern = "/ffmpeg N-([0-9.]*)/i";
    if (preg_match($pattern, $output, $matches)) {
      return $matches[1];
    }
virtuali1151’s picture

I seem to be running into the same problem.. and I am using the latest dev 2 version as well... from the command line my version shows: FFmpeg version git-N-29059-g44a8b0d-syslint, From the UI it shows FFmpeg git-N-29059-g44a8b0d-syslint so this seems to be correct... but I am still not sure why it doesnt list the output formats etc... I have tried the above fixes to no avail...

arthurf’s picture

@virtuali1151 try setting the return value in get_version to 29059 to see if this starts showing your formats.

virtuali1151’s picture

Yup.. that worked but I also had to change line 182 (if ($matches[1] >= 29240) ) to 29059 to get the output formats to show up... the video and audio codecs are now working as well....

cheers.

robmil29’s picture

Hey arthurf, your solution in #51 did the trick. Thank you for your help!

arthurf’s picture

Ok so it sounds like the regex is still the issue.

arthurf’s picture

I just changed the regex for the git string- this is working for me switching between a cvs and git version. Also committed the fix to the 7.x branch.

SlayJay’s picture

I'm having this same problem, and the 2011-Jul-22 dev version just spins forever until php times out when I try to use it.

Not sure what info you need, ffmpeg wrapper lists my ffmpeg as:

ffmpeg version N-31627-g9c2651a, Copyright (c) 2000-2011 the FFmpeg developers built on Jul 23 2011 15:02:13 with gcc 4.6.1 configuration: --enable-gpl --enable-version3 --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 51. 11. 0 / 51. 11. 0 libavcodec 53. 9. 0 / 53. 9. 0 libavformat 53. 6. 0 / 53. 6. 0 libavdevice 53. 2. 0 / 53. 2. 0 libavfilter 2. 27. 3 / 2. 27. 3 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0 Expected number for v but found: -v

this is the same version if I do ffmpeg -version... but it lists nothing available under codecs.

running ffmpeg -codecs manually shows lots of codecs with different combinations of D E A

Hope that helps.

arthurf’s picture

Hrm, I would think that would be getting picked up in $ffmpeg->get_version(). Can you see if the regex that is there for git is not catching it?

SlayJay’s picture

$pattern = "/ffmpeg version ([0-9.]*)/i"; catches it, but $matches[1] is blank.

$matches print_r is:

Array
(
[0] => ffmpeg version
[1] =>
)

SlayJay’s picture

I fixed the codec detection by adding the following code as the first pattern check. It's a modified version of post #51 but I added version in front of ffmpeg.

HOWEVER, when I go to actually use it under test convert file, I still have nothing show up under output format. It's a blank list. I've tried this with two different files.

code to at least fix the codec display page:


// Make this the first pattern check
$pattern = "/ffmpeg version N-([0-9.]*)/i";
    if (preg_match($pattern, $output, $matches)) {
		
      return array(
        'svn' => (int) $matches[1],
        'version' => (int) $matches[1],
      );
    }

arthurf’s picture

Try changing the regex to: /ffmpeg version.*?([0-9.]*)/i

SlayJay’s picture

that matches, but leaves the version # blank again like it was. And the output dropdown is still blank under test convert file.

arthurf’s picture

did you go to admin/config/ffmpeg_wrapper? That will reset the cache of the codecs

SlayJay’s picture

StatusFileSize
new23.6 KB

Yes, and I just did it again to make sure.

Output drop down remains blank.

(attached a screen shot if that helps any)

SlayJay’s picture

Ok, one step closer:

under function get_formats() you have the lines:

  if ($ffmpeg_version['svn'] >= 20561 || $ffmpeg_version['release'] > 0.5) {
      $endpos = strpos($formats, 'FFmpeg version');
    }

for this version at least, FFmpeg is all lower case. Changing this to


  if ($ffmpeg_version['svn'] >= 20561 || $ffmpeg_version['release'] > 0.5) {
      $endpos = strpos($formats, 'ffmpeg version');
    }

Populates the drop down box. HOWEVER it's still not working. Now when I try to use it, I get the error:

There were errors during the conversion!
There were errors during the conversion!
Errors found: The file could not be transcoded because the video codec is not supported

arthurf’s picture

Try replacing those with stripos?

SlayJay’s picture

That fixes the populate the output box problem, but still getting the Errors found: The file could not be transcoded because the video codec is not supported error.

avatxus’s picture

Hi endorn,

Were you able to make this work?

arthurf’s picture

@endorn can you update to the latest dev version and let me know if that is working for you?

heavy_engineer’s picture

Latest dev version works fine for me with latest ffmpeg

ffmpeg version N-31809-g9acffed, Copyright (c) 2000-2011 the FFmpeg developers

naeluh’s picture

sub

naeluh’s picture

Hi I am using the latest dev version
I installed updated and got this error -

Warning: Missing argument 2 for variable_get(), called in /var/www/sites/all/modules/ffmpeg_wrapper/ffmpeg_wrapper.module on line 83 and defined in variable_get() (line 614 of /var/www/includes/bootstrap.inc

How I can I fix this. thanks.

The wrapper still functions properly dspite this warning

I am using ffmpeg N-31981

torgospizza’s picture

You can turn off warnings in your php settings. You can override that in settings.php if you like. Since it's just a warning it can be ignored, but variable_get is being used incorrectly in that module - it always needs the 2nd argument which is the default if variable_get() returns with nothing. http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/variab...

osopolar’s picture

The issue to the warning in #73 is this: #1202902: Add integration with ffmpeg_converter

bnordgren’s picture

StatusFileSize
new1.24 KB
new8.17 KB

Hey guys, hate to beat a dead horse, but I think ffmpeg changed things again. As of 35110 (possibly earlier), the only thing going to stdout from an "ffmpeg -formats" command is the list of formats. Trying to find $endpos and trim the output down actually fails (e.g., no output to process).

I modified the get_formats function as follows:

    if ((int) $ffmpeg_version < 35110) { 
      if (((int) $ffmpeg_version >= 20561) || ((int) $ffmpeg_version < 1000 && (float) $ffmpeg_version > 0.5)) {
        $endpos = stripos($formats, 'FFmpeg version');
      }
      else {
        $endpos = stripos($formats, 'Codecs:');
      }

      $formats = drupal_substr($formats, $startpos, $endpos - $startpos);
      // remove the header
      $formats = str_replace('File formats:', '', $formats);
    }

Also, I had to add #51 myself. (I'm using 7.x-1.0alpha2) Was it supposed to be committed already?

Finally, I think the get_file_info function may be broken too. The test file conversion in the admin menu is not listing any information on the source file. I'm attaching the output from this as well. Note that there is nothing at all going to stdout. I had to copy from stderr to capture something in my file...Would this perhaps be merit a separate issue?

molenick’s picture

StatusFileSize
new14.53 KB

It looks like this is still an issue with the 7.x-1.x-dev verison released yesterday. Since this seems to be a reocurring issue, may I suggest putting a drupal_set_warning in get_version() if no version is found? This will at least notify users that something is wrong and will hopefully shortcut the troubleshooting process.

iva2k’s picture

This issue will most likely be an ongoing chase, as ffmpeg seems to be changing its interface all the time.

I just pulled the latest version from ffmpeg git, and found that everything is broken again by a couple of drastic interface changes:

  1. ffmpeg -codecs now returns a list of supported media stream formats. Here's a snipped from the manpage:

    -codecs
    Show all codecs known to libavcodec.

    Note that the term 'codec' is used throughout this documentation as a shortcut for what is more
    correctly called a media bitstream format.

  2. The format of the -codecs output changed:
    • legend is now at the top
    • legend content is different "DEVSDT" -> "DEVILS"
    • what used to be letter/space now is letter/dot, i.e. "DE IL " -> "DE.IL."
  3. What FFmpeg Wrapper needs now is to get ffmpeg -encoders command, which shows available encoders. But it's output also differs from old -codecs command (dots used and different meaning of letters, legend up at the top).

I'm doing a patch, but what I need to finish it is a version number when these changes happened (so the "if" statements can be precise). Can anyone post the cutoff version numbers or point to the place where it can be found?

iva2k’s picture

I filed a separate issue #1933740: Support for latest ffmpeg (git version 50450) to track that latest ffmpeg Git head.