Fatal error: Cannot use string offset as an array in /var/www/drupal.monster/sites/all/modules/modified/media_mover/mm_node/mm_node.module on line 321

function mm_node_attach_file($file, $configuration) {

  // get drupal file path
  if ($file['data']['file']['drupal_path']) {
    $drupal_path = $file['data']['file']['drupal_path'];
  }

Still just trying to get this working.

I created a process profile to convert uploaded mpegs to FLVs.
I enabled the normal video.module content type.
Attached an mpeg to it and tested.

I added a media mover process to :
- harvest attachments from nodes of type video
- convert to flv
- re-attach to the node.

Sounded sensible. I ran the test and got the above error.

Debugging, the $file variable passed in to the mm_node_attach_file() func is

Array
(
    [mmfid] => 2
    [nid] => 48
    [fid] => 194
    [cid] => 2
    [harvest_file] => /var/www/resourcedb/files/videos/the_annoying_thing_320x256.mpeg
    [process_file] => 
    [storage_file] => 
    [complete_file] => 
    [url] => 
    [status] => 3
    [date] => 1203233683
    [data] => a:20:{s:3:"fid";s:3:"194";s:3:"nid";s:2:"48";s:8:"filename";s:38:"videos/the_annoying_thing_320x256.mpeg";s:8:"filepath";s:64:"/var/www/resourcedb/files/videos/the_annoying_thing_320x256.mpeg";s:8:"filemime";s:10:"video/mpeg";s:8:"filesize";s:7:"2906116";s:3:"vid";s:2:"48";s:4:"type";s:5:"video";s:5:"title";s:13:"Annoying Frog";s:3:"uid";s:1:"1";s:6:"status";s:1:"1";s:7:"created";s:10:"1203232958";s:7:"changed";s:10:"1203232958";s:7:"comment";s:1:"0";s:7:"promote";s:1:"1";s:8:"moderate";s:1:"0";s:6:"sticky";s:1:"0";s:12:"harvest_file";s:64:"/var/www/resourcedb/files/videos/the_annoying_thing_320x256.mpeg";s:14:"harvest_module";s:7:"mm_node";s:14:"harvest_action";s:1:"2";}
)

So it looks like the 'data' is serialized, but hasn't been unpacked properly.
... investigating :-( .

PS. You might want to add some 'components' to this project so we can identify issues against the various sub-modules.

Comments

dman’s picture

additional.
Watchdog tells me that

media_mover had an error converting this file:
The command was: -i '/var/www/resourcedb/files/videos/the_annoying_thing_320x256.mpeg' -acodec mp3 '/var/www/resourcedb/files/media_mover/ffmpeg/converted/2/the_annoying_thing_320x256.mpeg_0.flv'

so it may be that the mm_node_attach_file() failed because of invalid input.
That's understandable, but needs better error-checking and recovery then.

Still looking.

dman’s picture

... turns out that the ACTUAL command that got run was

/usr/bin/ffmpeg -formats
/usr/bin/ffmpeg -i '/var/www/resourcedb/files/videos/the_annoying_thing_320x256.mpeg' -acodec mp3 '/var/www/resourcedb/files/media_mover/ffmpeg/converted/2/the_annoying_thing_320x256.mpeg_1.flv'
 /usr/bin/ffmpeg -i '/var/www/resourcedb/files/videos/the_annoying_thing_320x256.mpeg' -acodec mp3 '/var/www/resourcedb/files/media_mover/ffmpeg/converted/2/the_annoying_thing_320x256.mpeg_1.flv'
ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --extra-cflags=-fomit-frame-pointer -DRUNTIME_CPUDETECT --build i486-linux-gnu --enable-gpl --enable-pp --enable-zlib --enable-vorbis --enable-libogg --enable-theora --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --prefix=/usr
  built on Oct  4 2006 10:57:36, gcc: 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
Input #0, mpeg, from '/var/www/resourcedb/files/videos/the_annoying_thing_320x256.mpeg':
  Duration: 00:00:40.2, start: 0.841456, bitrate: 577 kb/s
  Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 320x256, 25.00 fps, 300 kb/s
  Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, stereo, 224 kb/s
File '/var/www/resourcedb/files/media_mover/ffmpeg/converted/2/the_annoying_thing_320x256.mpeg_1.flv' already exists. Overwrite ? [y/N] y
Output #0, flv, to '/var/www/resourcedb/files/media_mover/ffmpeg/converted/2/the_annoying_thing_320x256.mpeg_1.flv':
  Stream #0.0: Video: flv, yuv420p, 320x256, 25.00 fps, q=2-31, 200 kb/s
  Stream #0.1: Audio: 0x0000, 44100 Hz, stereo, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
[flv @ 0x8336c48]removing common factors from framerate
Unsupported codec for output stream #0.1

So it looks like a problem with the acodec parameter. Without it it works fine!

ffmpeg version CVS, build 3276800, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --extra-cflags=-fomit-frame-pointer -DRUNTIME_CPUDETECT --build i486-linux-gnu --enable-gpl --enable-pp --enable-zlib --enable-vorbis --enable-libogg --enable-theora --enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug --prefix=/usr
  built on Oct  4 2006 10:57:36, gcc: 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

... it may be my build or install. No MP3 support (!) I'll see if an upgrade is needed :-/

dman’s picture

Yeah, my problem was really LAME :-{

... and after an hour of trying to recompile ffmpeg with mp3 on ubuntu it still breaks.

I've gotta use a different -acodec from mp3 (I've now found the setting you've given to allow that to be changed ... but am trying to find an alternative that works)
This is a killer for Ubuntu.

Still, better error-catching is needed further down the track ;-)

arthurf’s picture

Sorry that you had a such a rough experience dealing with FFmpeg. It's a bit of a bear to figure out how to parse what codecs are actually usable for FFmpeg and make those into options that a admin can choose and then hand those back to FFmpeg when it comes time to convert. The way I did it is messy, and really could use some improvement. I'll make lamemp3 the default (which works on Ubuntu pretty well from my experience) which hopefully work better. FYI, you may want to check out my hints for installing FFmpeg on Ubuntu/Debian - there are some file types that won't work with version you posted above

http://www.24b6.net/?p=188

Good luck, and thanks for posting your experiences.

dman’s picture

I can't see lamemp3 listed in the big chart [About FFmpeg installation] either ... yet.
I can't think of a tidier way of handling those hundred weird codecs either. It's impressive you've gone as far as you did to expose the ffmpeg diagnostics. But all those choices just confuse me :-)

This issue has incidentally sent me off into dpkg-hell. Trying to upgrade one utility has now caused me to open my system to the Debian universe instead of / as well as the Ubuntu one.
This in turn has just caused my machine to no longer know who or what it is ... and it's spent the last three hours downloading various competing updates (big stuff like X11, GCC, and a million other libs I never knew I had) from non-synchronous repositories, no longer has a working desktop GUI, and still complains about something new every time I try to trigger apt-get or dselect !!!

I think I said 'Yes, use the unverified update' at the wrong time somewhere in history :-/

I'll sort it out eventually. But what bugs me is that a conflict in the TTF fonts for Urdu or WTF will cause a whole 20 minute upgrade to roll back... *sigh*. All to get sound into my FLVs. ... And I didn't even want to be doing videos!

arthurf’s picture

Ugh, sorry you're in package hell. Looking at what's configured in your FFmpeg output, it looks like you don't have lame support. When I query ffmpeg, I get:

FFmpeg version SVN-r9367, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --prefix=/opt/ffmpeg/svn-2007-06-18 --enable-shared --enable-static --enable-gpl --enable-pp --enable-libmp3lame --enable-libfaad --enable-liba52 --enable-libtheora --enable-libgsm --enable-libogg --enable-libxvid --enable-libfaac --enable-libamr-wb --enable-libamr-nb
  libavutil version: 49.4.0
  libavcodec version: 51.40.4
  libavformat version: 51.12.1
  built on Jun 29 2007 18:47:56, gcc: 3.4.5

note that libmp3lame is included in the list. If you'd like a static binary of ffmpeg that does support it, please download it here:

ffmpeg.static.tgz

This is a static (meaning the libraries are compiled in) version of ffmpeg.

arthurf’s picture

Status: Active » Closed (fixed)