Automatic video thumbnail creation (Requires ffmpeg) - Page 2 Automatic video thumbnail creation (Requires ffmpeg) - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Automatic video thumbnail creation (Requires ffmpeg)

Started by Abbas Ali, November 24, 2006, 11:56:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lifter

Quote from: Abbas Ali on September 07, 2007, 07:30:32 AM
Thats the first thing to check for as my first post describes.

Appears I have it installed - and this mod still doesn't work ;(

Host confirmed that it's installed and I can see that it is because when I use adrianbj's modification to see a thumb preview during the upload process, I do end up seeing the thumb.  When I try to continue and place the movie into an album - it won't go - the movie does however appear via FTP in an uploaded folder

Abbas Ali

Chief Geek at Ranium Systems

lifter

/include/picmgmt.inc.php

    * Notice line 50: Undefined index: OS
    * Warning line 72: unlink(albums/edit/af41288e99ed440c5e145f8529725de1%d.jpg) [function.unlink]: No such file or directory


This is the error that I get - it uploads the file, because it's still on my FTP, but it appears it's not placing it because it can't find the thumb (which doesn't get created..)

lifter

extremely weird... using the modification alexbj posted to see the thumbnail preview while you are uploading, I see the thumbnail.... so ffmpeg is installed and working, however when I press 'continue' to place the file into an album, it still says "The file could not be placed" and still gives this error:

/include/picmgmt.inc.php

    * Notice line 50: Undefined index: OS
    * Warning line 72: unlink(albums/edit/e0bde2401ccb0498f3e3b4dc66e266ab%d.jpg) [function.unlink]: No such file or directory

lifter

Not sure if this helps, but the thumbnail preview comes up as: /albums/edit/preview_5df573cc1.jpg

Abbas Ali

@lifter : PM me the admin un/pass, url of your gallery along with a link to this topic. If that doesn't help then i might ask for ftp access too (if you are happy to provide that).
Chief Geek at Ranium Systems

sokheng

This mod work perfectly Great! Two Thumbs Up!! If you are able to install ffmpeg, everything will work just fine.

zendiz

Hi, seems a great hack...but... >:(

I have followed all settings (running cpg4.14 on my server with ffmpeg, and installed all hack lines from this thread)
I manually upload 1 file -> 1 uploads were successful.
Shows thumbnail !! and asks me what album to put file in. (so far so good) -> continue

The previous file was placed successfully. You have successfully placed all the files. -> continue

Then this sucks -> Showing album with this standard uggly Mpeg icon from coppermine  ???

What am I doing wrong.




zendiz

To add to my post, I just uploaded a movie file with debug mode on, it showed preview of thumbnail as before, no errors during upload.
Still that ridiculous standard coppermine icon when i check the album.  gmmm

Abbas Ali

Can't say much without looking at your gallery. Provide a test user account (with upload privileges) and the link to your gallery.
Chief Geek at Ranium Systems

JPNARF

Hi Abbas Ali !!
This is my first post ! Hello to all !!

I have a problem, i copied exactly that you post... but i have this error:

Parse error: parse error, expecting `']'' in C:\Web Server\foto\Coppermine\include\picmgmt.inc.php on line 36

The line 36 is:
    $dest_file = $CONFIG['fullpath']."edit/".md5(uniqid(time()))."%d.jpg";

Any suggestion ?

Regards,
Juan.

Nibbler


JPNARF

Hi Nibbler !

Here the picmgmt.inc.php file

Thanks !

Nibbler

You changed the wrong side of the code

$CONFIG['ffmpeg_path'] = '/usr/local/bin/'; // Change the path according to your server.

Change the path and leave the variable name alone.

JPNARF

Sorry Nibble... terrible error  :o

now i put:
$CONFIG['ffmpeg_path'] = "C:\ffmpeg\"; // Change the path according to your server.

but other error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in C:\Web Server\foto\Coppermine\include\picmgmt.inc.php on line 36

I Have Windows OS

Nibbler

Quote from: JPNARF on January 20, 2008, 03:13:44 AM
I Have Windows OS

I know.

Use


$CONFIG['ffmpeg_path'] = 'C:\ffmpeg\\'; // Change the path according to your server.


Also reverse where you changed the wrong part in the rest of the code. You only need to set your path once, where instructed to do so.

JPNARF

Yes ! Work !!
Thanks Nibbler.

One more  ::)

I try to add all enhancing, now i am in : overlap a "play this movie" image (jpeg,gif or png) to the videothumb (like in youtube) by oscar_rocha

After:
$return = str_replace("%d", "1", $dest_file);

I add the following code:

  $image_path = "C:\Web Server\foto\Coppermine\themes\hardwired\images\Play.jpg"
  $background = imagecreatefromjpeg($return);
  $insert = imagecreatefromgif($image_path);
  imagecolortransparent($insert,imagecolorat($insert,0,0));
  $insert_x = imagesx($insert);
  $insert_y = imagesy($insert);
  imagecopymerge($background,$insert,45,35,0,0,$insert_x,$insert_y,100);
  imagejpeg($background, $return, 100);


But i received the message:
"Parse error: parse error in C:\Web Server\foto\Coppermine\include\picmgmt.inc.php on line 80"

Line 80 is:
$background = imagecreatefromjpeg($return);

I check phpinfo() and is OK:
gd
GD Support    enabled
GD Version    bundled (2.0.28 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
GIF Read Support    enabled
GIF Create Support    enabled
JPG Support    enabled
PNG Support    enabled
WBMP Support    enabled
XBM Support    enabled

JPNARF

SORRY AGAIN... is the time 1 AM here  :'(

i forgot
$image_path = "C:\Web Server\foto\Coppermine\themes\hardwired\images\Play.jpg"[b];[/b]

:-[

JPNARF

Hi All,
I moved my Coppermine to another OS Windows 2003, i configure all again... import data base, etc.

But i have the problem now, when i try to upload videos using this mod (before in Windows 2000 Work !!) display the PB icon.
Using original file picmgmt.inc.php work, but with the mod not  :-\

Here my debug:

QuoteUSER:
------------------
Array
(
    [ID] => a298ee8ceb581dab4ac09e99b4f82a3c
    [am] => 1
    [uid] => 1
    [liv] => Array
        (
           
  • => 1049
                [1] => 1045
                [2] => 1048
                [3] => 1052
                [4] => 1040
            )

        [lap] => 2
        [lang] => english
    )

    ==========================
    USER DATA:
    ------------------
    Array
    (
        [user_id] => 1
        [user_name] => foto
        [groups] => Array
            (
               
  • => 1
            )

        [disk_max] => 0
        [disk_min] => 0
        [can_rate_pictures] => 1
        [can_send_ecards] => 1
        [ufc_max] => 2
        [ufc_min] => 2
        [custom_user_upload] => 0
        [num_file_upload] => 0
        [num_URI_upload] => 1
        [can_post_comments] => 1
        [can_upload_pictures] => 1
        [can_create_albums] => 1
        [has_admin_access] => 1
        [pub_upl_need_approval] => 0
        [priv_upl_need_approval] => 0
        [group_name] => Administrators
        [upload_form_config] => 2
        [group_quota] => 0
        [can_see_all_albums] => 1
        [group_id] => 1
    )

    ==========================
    Queries:
    ------------------
    Array
    (
       
  • => SELECT extension, mime, content, player FROM copp_filetypes; (0.037s)
        [1] => select * from copp_plugins order by priority asc; (0.002s)
        [2] => delete from `fotos`.copp_sessions where time<1201664782 and remember=0; (0.002s)
        [3] => delete from `fotos`.copp_sessions where time<1200458782; (0.001s)
        [4] => select user_id from `fotos`.copp_sessions where session_id=md5("5500db23b9625a3b2426a6a216a1883228db823b029eabc861ae2fac83e293ee"); (0.001s)
        [5] => select user_id as id, user_password as password from `fotos`.copp_users where user_id=1 (0.004s)
        [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `fotos`.copp_users AS u INNER JOIN `fotos`.copp_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0.006s)
        [7] => SELECT user_group_list FROM `fotos`.copp_users AS u WHERE user_id='1' and user_group_list <> ''; (0.013s)
        [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM copp_usergroups WHERE group_id in (1) (0.001s)
        [9] => SELECT group_name FROM  copp_usergroups WHERE group_id= 1 (0.002s)
        [10] => update `fotos`.copp_sessions set time='1201668382' where session_id=md5('5500db23b9625a3b2426a6a216a1883228db823b029eabc861ae2fac83e293ee'); (0.002s)
        [11] => SELECT user_favpics FROM copp_favpics WHERE user_id = 1 (0.001s)
        [12] => DELETE FROM copp_banned WHERE expiry < '2008-01-30 01:46:22' (0.002s)
        [13] => SELECT * FROM copp_banned WHERE (ip_addr='10.10.10.1' OR ip_addr='10.10.10.1' OR user_id=1) AND brute_force=0 (0.177s)
        [14] => SELECT aid, title FROM copp_albums WHERE 1 (0.005s)
        [15] => SELECT COUNT(*) FROM copp_pictures WHERE approved = 'NO' (0.001s)
    )

    ==========================
    GET :
    ------------------
    Array
    (
        [insert] => 1
    )

    ==========================
    POST :
    ------------------
    Array
    (
        [d0000] => 22
        [pics] => Array
            (
               
  • => i0000
                [1] => i0001
            )

        [album_lb_id_i0000] => d0000
        [picfile_i0000] => dXNlcnBpY3MvYS9RdWludGFKSihFbmUtMDgpLmZsdg==
        [album_lb_id_i0001] => d0000
        [picfile_i0001] => dXNlcnBpY3MvYS9TYWtlRHVtYm8ubXBn
        [insert] => Insert selected files
    )

    ==========================
    VERSION INFO :
    ------------------
    PHP version: 5.2.5 - OK
    ------------------
    mySQL version: 5.0.45-community-nt
    ------------------
    Coppermine version: 1.4.15(stable)
    ==========================
    Module: GD
    ------------------
    GD Version: bundled (2.0.34 compatible)
    FreeType Support: 1
    FreeType Linkage: with freetype
    T1Lib Support: 1
    GIF Read Support: 1
    GIF Create Support: 1
    JPG Support: 1
    PNG Support: 1
    WBMP Support: 1
    XPM Support:
    XBM Support: 1
    JIS-mapped Japanese Font Support:

    ==========================
    Module: mysql
    ------------------
    MySQL Supportenabled
    Active Persistent Links 0
    Active Links 1
    Client API version 5.0.45
    ==========================
    Module: zlib
    ------------------
    ZLib Support enabled
    Stream Wrapper support compress.zlib://
    Stream Filter support zlib.inflate, zlib.deflate
    Compiled Version 1.2.3
    Linked Version 1.2.3
    ==========================
    Server restrictions (safe mode)?
    ------------------
    Directive | Local Value | Master Value
    safe_mode | Off | Off
    safe_mode_exec_dir | no value | no value
    safe_mode_gid | Off | Off
    safe_mode_include_dir | no value | no value
    safe_mode_exec_dir | no value | no value
    sql.safe_mode | Off | Off
    disable_functions | no value | no value
    file_uploads | On | On
    include_path | .;C:\php5\pear | .;C:\php5\pear
    open_basedir | no value | no value
    ==========================
    email
    ------------------
    Directive | Local Value | Master Value
    sendmail_from | no value | no value
    sendmail_path | no value | no value
    SMTP | localhost | localhost
    smtp_port | 25 | 25
    ==========================
    Size and Time
    ------------------
    Directive | Local Value | Master Value
    max_execution_time | 30 | 30
    max_input_time | 60 | 60
    upload_max_filesize | 2M | 2M
    post_max_size | 8M | 8M
    ==========================
    Page generated in 0.398 seconds - 16 queries in 0.257 seconds - Album set : ; Meta set: ;
Thanks !

worenklein

What do I need to add to util.php (in the update_thumbs() function)?

My guess is that this is the offending line:

$thumb = $CONFIG['fullpath'] . $row['filepath'] . $CONFIG['thumb_pfx'] . $row['filename'];

Sorry, I'm not a PHP guy yet (give me a few days -- if I can figure out TCL, I can figure out anything  :D)
David C Worenklein