Recherche avancée

Médias (91)

Autres articles (71)

  • 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.

  • 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 (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (8387)

  • ffmpeg php video basic uses and types

    15 mai 2014, par HackerManiac

    Can anyone give a code on how do i covert a video using ffmpeg.

    As thought currently i have only uploading system.

    vu.php(only a part is shown)

    define('UPLOAD','../../videos/');
       $fileName = time().$file['name'];
       $target = UPLOAD.$fileName;

     if(move_uploaded_file($file['tmp_name'],$target)){                
         exec("ffmpeg -i ".UPLOAD." ".UPLOAD.$filename.".flv");
     }

    This pice of code block just uploads the video on video folder but does not converts it to .flv.
    I am not sure how to use ffmpeg.

    My diretory looks like this

    www[localhost]->videos[videos folder]
    www[localhost]->pictures[pictures folder]
    www[localhost]->resources[folder]->php[folder]->vu.php

    I also want to return a .jpg image of any frame of video through json by converting via ffmpeg and uploading it to pictures folder.

    return json_encode(array("thumbnail"=>$image_src));

    UPDATE 1

    The above stuff was solved but now i have a question regarding video conversion.
    Suppose i have a file.avi and i want to convert it in 3 sizes of .flv format -> Low(320p) ,Medium (720p)and HD(1080p)

    what commands will i have to send to shell_exec(); and will that be fast enough ?
    CUrrently what i have is

    $vidSize = "640x480";
    $ffmpeg -i $videoFile -ar 22050 -ab 32 -f flv -s $vidSize $vidFile

    And i am not sure what -ar and -ab means and what value will be good for all those 3 sized videos ?

  • After transcoding using ffmpeg, I found audio bitrate is not the value I expected

    16 mai 2017, par penny

    I used ffmpeg to transcode some files into new format and with certain parameters. After transcoding, I found some output file’s metadata is not what I expected, the output value is not the same with I set in the cmd line.

    Before transcoding I check the media info of the inputfile :

    ffmpeg -i dz2015082000010.mpg

    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers
    built with gcc 4.8.3 (GCC) 20140911 (Red Hat 4.8.3-9)
    configuration : —enable-static —enable-memalign-hack —enable-libx264
    —enable-gpl —enable-pthreads —enable-version3 —enable-avisynth —enable-bzlib —enable-iconv —enable-zlib —enable-nonfree —extra-cflags=-I/usr/local/include/ —extra-ldflags=-L/usr/local/lib —enable-debug=3 —disable-optimizations —enable-nonfree —enable-libmp3lame libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 /
    57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 /
    54. 1.100 Input #0, mpeg, from ’dz2015082000010.mpg’ : Duration : 00:01:49.30, start : 0.685389, bitrate : 15723 kb/s
    Stream #0:0[0x1e0] : Video : mpeg2video (Main), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr,
    90k tbn, 50 tbc
    Stream #0:1[0x1c0] : Audio : mp2, 48000 Hz, stereo, s16p, 384 kb/s At least one output file must be specified

    Next, transcoding with the cmd line :

    ffmpeg -i dz2015082000010.mpg -vcodec libx264 -b:v 4000k -s 1920x1080 -r 25 -g 25  -vprofile main -acodec aac -strict -2 -b:a 128k -ac 2 -ar 44100 -y output.ts

    After transcoding, I check the media info of the output file :

    ffmpeg -i output.ts    

    ffmpeg version 3.2.4 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.3 (GCC) 20140911 (Red Hat
    4.8.3-9) configuration : —enable-static —enable-memalign-hack —enable-libx264 —enable-gpl —enable-pthreads —enable-version3 —enable-avisynth —enable-bzlib —enable-iconv —enable-zlib —enable-nonfree —extra-cflags=-I/usr/local/include/ —extra-ldflags=-L/usr/local/lib —enable-debug=3 —disable-optimizations —enable-nonfree —enable-libmp3lame libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101
    / 57. 64.101 libavformat 57. 56.101 / 57. 56.101
    libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100
    / 6. 65.100 libswscale 4. 2.100 / 4. 2.100
    libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100
    / 54. 1.100 Input #0, mpegts, from ’full-2.ts’ : Duration :
    00:01:49.30, start : 1.456778, bitrate : 4455 kb/s Program 1
    Metadata :
    service_name : Service01
    service_provider : FFmpeg
    Stream #0:0[0x100] : Video : h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr,
    90k tbn, 50 tbc
    Stream #0:1[0x101] : Audio : aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 4 kb/s At least one output file must be
    specified

    I don’t know why the audio bitrate is changed to 4 kb/s after transcoding, I set the value with -b:a 128k before, anybody can help me ? BTW, the output file sounds all right.

  • Why is the external executable I bundled with my azure function not being found at runtime, despite it being present in the expected location ?

    6 septembre 2023, par Cristian Camilo Garcia Barrera

    I have a group of Azure functions that I publish to a functions app. One of these is a blob triggered function, meant to extract thumbnails from videos uploaded to Azure storage, and to do so, uses ffmpeg.exe.

    


    I have published the project via Visual Studio, adding the executable in a directory in the root of the project. The relative path is exe/ffmpeg.exe. To include the executable in the published bundle I followed the instructions in this Microsoft Developer instructional video.

    


    After publication, If I enter the Kudu debug console for this function app, I can find the file under C:\home\site\wwwroot\exe\ffmpeg.exe, as expected. I can even use that absolute path to execute ffmpeg inside the Kudu console.

    


    This is the code I use to call the ffmpeg executable in the blob function :

    


    using (var process = new Process())
{
    process.StartInfo = new ProcessStartInfo
    {
        FileName = @"C:\home\site\wwwroot\exe\ffmpeg.exe",
        Arguments = $"-hide_banner -loglevel error -i {videoTempPath} -frames:v 1 {thumbTempPath}",
        UseShellExecute = false,
        RedirectStandardOutput = true,
        RedirectStandardError = true,
        CreateNoWindow = true
    };

    process.Start();
    await process.WaitForExitAsync();
}


    


    However, this does not work. I get the following error in the logs :

    


    


    An error occurred trying to start process 'C :\home\site\wwwroot\exe\ffmpeg.exe' with working directory 'C :\Program Files (x86)\SiteExtensions\Functions 4.25.2132bit. The system cannot find the file specified.

    


    


    And indeed my thumbnails are never created. How can I solve this, or why does it happen ?