Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (89)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (5448)

  • How do I get the last line of a popen() callback in every iteration ?

    29 mai 2017, par Mike

    I’m trying to create a progress bar with FFMPEG using php and AJAX. When a user uploads a video file I want to be able to display the current percent until completion. I have managed to get everything working but I have one issue.

    The data returns what I want, but it also returns all the data from the previous iterations... like it just keeps stacking everything on top rather than flushing out the data from previous iterations. I tried to work with tail thinking it would return only the last line, but it did not return anything.

    Here is the code I’m working with :

    encode.php

    $video_path = 'test.mp4';
    $cmd        = 'ffmpeg -i ' . $video_path .' -y -hide_banner output.mp4 2>&1';

    while (@ ob_end_flush());

    $proc = popen($cmd, 'r');

    while (!feof($proc))
    {

       $file = escapeshellarg(fread($proc, 4096));
       //$line = `tail -n 1 $file`; // <-tried this with no luck
       echo fread($file, 4096) . "\n";
       @ flush();
    }
    return 'complete';
    pclose($proc);

    The above code returns :

    // first iteration
    frame=   52 fps= 13 q=29.0 size=     279kB time=00:00:00.10 bitrate=22856.9kbits/s

    // second iteration
    frame=   52 fps= 13 q=29.0 size=     279kB time=00:00:00.10 bitrate=22856.9kbits/s    
    frame=   54 fps= 12 q=29.0 size=     329kB time=00:00:00.16 bitrate=16146.6kbits/s

    // third iteration
    frame=   52 fps= 13 q=29.0 size=     279kB time=00:00:00.10 bitrate=22856.9kbits/s    
    frame=   54 fps= 12 q=29.0 size=     329kB time=00:00:00.16 bitrate=16146.6kbits/s    
    frame=   57 fps= 11 q=29.0 size=     464kB time=00:00:00.26 bitrate=14233.2kbits/s

    As you can see the data stacks, I need only the new line of data, not the data stacking.

    ** EDIT ** this has been marked as a duplicate, rather than me explain how it’s different, I’d like to hear how this is the same thing ? I am not writing to a log file and, like most people, do not feel that’s a good solution.

  • Trying to fetch all audio streams with FFmpeg Python

    27 juillet 2022, par Apollo

    I'm using ffmpeg-python to fetch streams from a video and write some parameters (codec_name, resolution, etc.) for each stream into csv.

    


    video = 'test.mkv'
probe = ffmpeg.probe(video)
video_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'video'), None)
print(video_stream['codec_long_name'])
audio_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'audio'), None)
...


    


    My problem is that it works well for a video stream, but not for multiple audio (or subtitles) streams. If the video has several audio streams it returns only one audio stream.

    


    I've tried another approach, but it returns some streams 2-3 times and I get duplicates. So if the video sample has 4 audio tracks, I end up with 9 audio streams instread of 4.

    


    audio_streams = []
for audio in (probe['streams']):
    if (audio['codec_type'] == 'audio'):
        audio_streams.append(audio)
        pprint(audio_streams)


    


    All other ideas I tried don't work, I'm new to programming and I'm stuck with it.
How can I get all audio streams from a file without duplicates ?

    


  • I have installed FFMPEG and can't find it inside a PHP script

    14 novembre 2019, par Antop

    I have installed FFMPeg in CentOS. It works perfectly.
    It’s inside /usr/bin directory. Also, I have PHP 7.2.24 that comes with Plesk 18.0.20.

    I want to use FFMPeg inside a PHP script, but that script can’t find the executable of FFMpeg. I have tried giving the exact route (/usr/bin/ffmpeg) but doesn’t work.

    It’s a production server. The same script, in my development server (macOS) works perfectly.

    I tried using :

    var_dump(getenv('PATH'));
    var_dump(exec('which ffmpeg'));
    var_dump(ini_get('open_basedir'));
    var_dump(is_file(exec('which ffmpeg')));
    var_dump(is_executable(exec('which ffmpeg')));

    And it returns me :

    string(49) "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
    string(0) ""
    string(44) "/var/www/vhosts/name-of-the-domain.com/:/tmp/"
    bool(false)
    bool(false)
    NULL

    ¿What could be happening ?

    A very strange thing I’ve noticed is that I can’t access any command via php :
    I tried using it with echo

    var_dump(exec('which echo'));
    var_dump(is_file(exec('which echo')));
    var_dump(is_executable(exec('which echo')));

    And it returns me :

    string(0) ""
    bool(false)
    bool(false)
    NULL

    And the permissions are right :

    [root@vps bin]# ls -lha echo
    -rwxr-xr-x 1 root root 33K ago 20 08:25 echo

    [root@vps bin]# ls -lha ffmpeg
    -rwxr-xr-x 1 root root 217K abr  4  2019 ffmpeg

    But if I make a

    var_dump(exec('echo "HELLO"'))

    it returns me

    string(5) "HELLO"