• Welcome to PHPVIBE Forums. Please log in.

Recent posts

#81
I
Help me! / Re: Allowing PHP beside HMTL i...
Last post by Icey -
Quote from: Marius P. on As for php in the pages, you can modify the

https://github.com/PHPVibe/PHPVibe/blob/master/views/page.route.php
and corresponding theme files
https://github.com/PHPVibe/PHPVibe/blob/master/themes/main/default.php

to add php to specific pages (you can target them by id).


I tried and..tried and..tried this approach and couldn't make it work. Can you please specify what exactly should I need to change?
Thanks!
#82
T
Bug tracker / Re: Conversion failed for:
Last post by tweky94 -
ii tot schimbasem partea la ffmpeg din moderator credeam ma o fi de acolo .. dar am incarcat vreo 5 clipuri si ffmpeg in admin log nu imi dadea nici o recunoastere nimic acum am bagat inapoi partea care o cere phpvibe usr/bin/php/ffmpeg si am incarcat un videoclip   pare ca l-am incarcat si a si luat comanda ffmpeg dar nu e ce trebuie


[25/02/24 03:54:08pm]
Conversion failed for:
/home/georgik5/web/lastcs.ro/public_html/storage/rawmedia/0d106b0e7b0fe28c6b9da9b4d16ea8a2.mp4 - File not found
[25/02/24 03:54:09pm]
ffmpeg -i /home/georgik5/web/lastcs.ro/public_html/storage/rawmedia/c0282fb7571b4a3869ed4e5561d19bf0.mp4 -vf "select=gt(scene,0.3),scale=360:202:force_original_aspect_ratio=increase,crop=360:202" -frames:v 10 -vsync vfr -vf fps=fps=1/60 -qscale:v 2 /home/georgik5/web/lastcs.ro/public_html/storage/media/thumbs/c0282fb7571b4a3869ed4e5561d19bf0-%02d.jpg
#83
T
Bug tracker / Re: Conversion failed for:
Last post by tweky94 -
Quote from: Marius P. on La 4 am nevoie de ce ai in error log , sa stiu de ce pica. eroare 500 e prea globala. Da-mi o copie dupa error_log-ul de pe server, sa vedem ce se intampla.


te ajuta consola inspect element ?
https://ibb.co/71YF0Xt
#84
T
Bug tracker / Re: Conversion failed for:
Last post by tweky94 -
3. in viitorul apropiat este posibil sa rezolvi problema la script cu categoriile  selectate ? ca in momentul de fata este Default dar nici in ala nu se pune sa apara pe prima pagina.....

Quote from: Marius P. on Poti explica asta mai bine, te rog?


este vorba cand incarci un videoclip   >>>>>    https://ibb.co/xDhNcZL

nu se pune pe prima pagina doar daca  ma duc in moderator la videos si selectez de acolo se adauga pe prima pagina in rest asa nu se adauga.
#85
avatar_Marius P.
Bug tracker / Re: Conversion failed for:
Last post by Marius P. -
La 4 am nevoie de ce ai in error log , sa stiu de ce pica. eroare 500 e prea globala. Da-mi o copie dupa error_log-ul de pe server, sa vedem ce se intampla.
#86
avatar_Marius P.
Bug tracker / Re: Conversion failed for:
Last post by Marius P. -
Quote3. in viitorul apropiat este posibil sa rezolvi problema la script cu categoriile  selectate ? ca in momentul de fata este Default dar nici in ala nu se pune sa apara pe prima pagina.....

Poti explica asta mai bine, te rog?
#88
avatar_Marius P.
Bug tracker / Re: Conversion failed for:
Last post by Marius P. -
Uite, am rescris functia din /app/functions/functions.global.php ca sa foloseasca ffprobe:

/* Function to extract video data */
function _get_va($video, $ffmpeg) {
$time = 0; $hours = 0; $mins = 0; $secs = 0;
$size = 0;
    $command = $ffmpeg." -i '" . $video . "' 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//";   
    $time = exec($command);   
$regs = explode(":", $time);
if(isset($regs) && is_array($regs)) {
$hours = $regs [0] ? $regs [0] : null;
        $mins = $regs [1] ? $regs [1] : null;
        $secs = $regs [2] ? $regs [2] : null;
        $secs = round($secs);
$timesec = $hours3600 + $mins * 60 + $secs;
}
$ffcommand = "ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1:nokey=1 " . $video ;
$size = (int)exec($ffcommand);
//* Fallback to ffmpg raw */
if(is_empty($size) || ($size < 1)) {
$wcommand = $ffmpeg." -i '" . $video . "' 2>&1 | grep Video: | grep -Po '\d{3,5}x\d{3,5}' | cut -d'x' -f1";
$size = exec($wcommand); 
}
    return array (           
            'duration' => $timesec,
'durationreadable' => $time,
            'height' => $size,
'hours' => $hours,
            'mins' => $mins,
            'secs' => $secs
    );
}

O sa o actualizez si pe github imediat. Pare un pic mai rapida.
#89
avatar_Marius P.
Bug tracker / Re: Conversion failed for:
Last post by Marius P. -
Salut!

1. Imi pare mie ca se intampla ceva ce nu credeam ca o sa se intample vreodata.

Ffmpeg nu poate returna marimea videoului in cazul tau (De ce...nu ma intreba!).
Hai sa incercam un custom fix ptr situatia ta

Vezi aici https://github.com/PHPVibe/PHPVibe/blob/master/moderator/edit-video.php
sau local in fisierul: /moderator/edit-video.php
linia 102:
$size = str_replace('.mp4','',$bq[1]);
poti pune imediat sub ea :
    if(is_empty($size) || ($size < 1)) { $size = '2160'; /* Let's lie it's 4k */    }

Asta s-ar putea sa nu iti rezolve problema (care to cred ca are mai mult de-a face cu ffmpeg, pe care l-as dezinstala si schimba versiunea),
dar nu va mai anula comenzile de conversie din cauza ca nu are o dimensiune a fisierul ci un zero.

Daca arunci o privire in conversie
https://github.com/PHPVibe/PHPVibe/blob/master/videocron.php

$va = _get_va($input, get_option('ffmpeg-cmd','ffmpeg'));
$size =    $va['height'];
$duration = $va['duration'];

la tine
$size =    $va['height'];

apare ca zero, null. Aia ar trebui sa returneze inaltimea fisierului video.

functia, dependenta de ffmpeg se gaseste in app/functions/functions.global.php

https://github.com/PHPVibe/PHPVibe/blob/master/app/functions/functions.global.php

/* Function to extract video data */
function _get_va($video, $ffmpeg) {
        $time = 0; $hours = 0; $mins = 0; $secs = 0;
        $size = 0;
    $command = $ffmpeg." -i '" . $video . "' 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//";       
    $time = exec($command);   
    $regs = explode(":", $time);
        if(isset($regs) && is_array($regs)) {
        $hours = $regs [0] ? $regs [0] : null;
        $mins = $regs [1] ? $regs [1] : null;
        $secs = $regs [2] ? $regs [2] : null;
        $secs = round($secs);
        $timesec = $hours3600 +    $mins * 60 + $secs;
        }
       
    $wcommand = $ffmpeg." -i '" . $video . "' 2>&1 | grep Video: | grep -Po '\d{3,5}x\d{3,5}' | cut -d'x' -f1";   
    $size = exec($wcommand); 
   
    return array (           
            'duration' => $timesec,
            'durationreadable' => $time,
            'height' => $size,
            'hours' => $hours,
            'mins' => $mins,
            'secs' => $secs           
    );
}

posti rula asta si intr-un terminal pe server ca sa vezi care e beleaua cu ffmpeg-ul tau:

  $command = $ffmpeg." -i '" . $video . "' 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//"
bine, o editezi
ffmpeg -i '/home/blablabla/videodeconvertit.extensie' 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,/

Ar trebuie sa primesti un raspuns ptr durata si apoi

ffmpeg -i '/home/blablabla/videodeconvertit.extensie' 2>&1 | grep Video: | grep -Po '\d{3,5}x\d{3,5}' | cut -d'x' -f1

aici vine raspunsul ptr dimensiune. Dar pare ca nu vine la tine. Deci testeaza direct in ffmpeg video ssh/terminal.

De curiozitate incearca si asta

ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1:nokey=1 /home/userultau/public_html/storage/rawmedia/numefisier.mp4

editeaza path-urile ptr ceva real.
Poate bag optiunea ca fallback intr-un update rapid.

Revin ptr restul.

#90
avatar_Marius P.
Help me! / Re: Allowing PHP beside HMTL i...
Last post by Marius P. -
Hi,

You can use the sidebar.php ( https://github.com/PHPVibe/PHPVibe/blob/master/themes/main/sidebar.php ) or tpl.footer.php files for the links.
Depending on where you want to place the link.

As for php in the pages, you can modify the

https://github.com/PHPVibe/PHPVibe/blob/master/views/page.route.php
and corresponding theme files
https://github.com/PHPVibe/PHPVibe/blob/master/themes/main/default.php

to add php to specific pages (you can target them by id).

Otherwise...storing php in SQL and executing it will prove challenging  https://stackoverflow.com/questions/41406/how-do-i-execute-php-that-is-stored-in-a-mysql-database