Jump to content

anyone good with ffmpeg?


schilly

Recommended Posts

I've been using this cmd to generate thumbnails automatically for videos my employer uploads.

$ffmpeg -i $movie1 -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -s $size -f mjpeg $thumb 2>&1

 

It has been working great until we recently switched all our videos over the H264 at which point it now fails.

 

I've tried switching the -vcodec and -f flags to libx264 and various combinations with mjpeg with no luck.

 

Here is one cmd:

$ffmpeg -i $video -deinterlace -an -ss 5 -t 00:00:01 -r 1 -y -vcodec libx264 -vpre default -f mjpeg -s $size $thumb 2>&1

 

Debug:

 

FFmpeg version 0.5, Copyright © 2000-2009 Fabrice Bellard, et al.

configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-demuxer=v4l --enable-libamr-nb --enable-libamr-wb --enable-libdirac --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-x11grab

libavutil 49.15. 0 / 49.15. 0

libavcodec 52.20. 0 / 52.20. 0

libavformat 52.31. 0 / 52.31. 0

libavdevice 52. 1. 0 / 52. 1. 0

libswscale 0. 7. 1 / 0. 7. 1

libpostproc 51. 2. 0 / 51. 2. 0

built on Jul 24 2009 02:04:07, gcc: 3.4.6 20060404 (Red Hat 3.4.6-11)

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9ac0ef0]multiple edit list entries, a/v desync might occur, patch welcome

 

Seems stream 0 codec frame rate differs from container frame rate: 2000.00 (2000/1) -> 10.00 (10/1)

 

Seems stream 1 codec frame rate differs from container frame rate: 20.00 (20/1) -> 10.00 (10/1)

Last message repeated 2 times

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_url':

Duration: 00:06:44.40, start: 0.000000, bitrate: 218 kb/s

Stream #0.0(eng): Video: h264, yuv420p, 960x540, 10 tbr, 1k tbn, 2k tbc

Stream #0.1(eng): Video: h264, yuv420p, 960x540, 10 tbr, 10 tbn, 20 tbc

Stream #0.2(eng): Audio: aac, 44100 Hz, stereo, s16

Output #0, mjpeg, to 'thumb.jpg':

Stream #0.0(eng): Video: libx264, yuv420p, 320x180, q=10-51, 200 kb/s, 90k tbn, 1 tbc

Stream mapping:

Stream #0.0 -> #0.0

[libx264 @ 0x9b03490]width or height not divisible by 16 (320x180), compression will suffer.

[libx264 @ 0x9b03490]using cpu capabilities: MMX2 SSE2 SSE3 Cache64

[libx264 @ 0x9b03490]profile Main, level 1.3

Press [q] to stop encoding

[h264 @ 0x9adb070]out of range intra chroma pred mode at 54 2

[h264 @ 0x9adb070]error while decoding MB 54 2

[h264 @ 0x9adb070]AVC: nal size -2075580329

[h264 @ 0x9adb070]concealing 1915 DC, 1915 AC, 1915 MV errors

[h264 @ 0x9adb070]AVC: nal size -1088897551

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size 1865416703

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size 1795161772

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size -3

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size -3

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size -3

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size -3

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size -3

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size -3

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

[h264 @ 0x9adb070]AVC: nal size -3

[h264 @ 0x9adb070]no frame!

Error while decoding stream #0.0

frame= 0 fps= 0 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbits/s

frame= 0 fps= 0 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbits/s

frame= 0 fps= 0 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbits/s

frame= 0 fps= 0 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbits/s

frame= 0 fps= 0 q=-11009996.7 Lsize= 0kB time=10000000000.00 bitrate= 0.0kbits/s

video:0kB audio:0kB global headers:0kB muxing overhead nan%

[libx264 @ 0x9b03490]final ratefactor: -4.34

 

 

New thumb created. Thumb = thumb.jpg, Video = video_url, Aspect = 16:9 Time = 373

 

 

 

Can anyone help me out?

 

let me know if you need any additional info.

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/202533-anyone-good-with-ffmpeg/
Share on other sites

I spent ages looking for this, so when i found it i had to share it on the web. It works !!! ( took me 2 days) Warning this only works if you already have the ffmpeg libary already installed ( my host did)

 

$extension = "ffmpeg";

$extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;

$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;

 

// load extension

if(!extension_loaded($extension)) {

    dl($extension_soname) or die("Can't load extension $extension_fullname\n");

}

 

  $exec_string = 'ffmpeg -i /home/parkhall/public_html/bands/design/uploads/001Spin.mp3 /home/parkhall/public_html/bands/design/uploads/omfg.mp3';

  exec($exec_string);

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.