Recherche avancée

Médias (9)

Mot : - Tags -/soundtrack

Autres articles (75)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (8160)

  • FFMPEG PHP enter command lines ?

    3 mai 2019, par Robert

    You will have to excuse me I have been spending the past 2 days reading through old FFMPEG posts for an answer but did little but confuse myself.
    It seems from what I read FFMPEG-PHP wrappers aren’t supported anymore ??? and to be honest they don’t seem like the proper way of learning how to incorporate it with PHP as there is a whole lot more help for command line FFMPEG usage and the FFMPEG-PHP wrapper usage looks nothing like the command line as far as I can tell.

    So I have 2 questions on using ffmpeg with PHP. So we are on the same page I posted a little info below.

    I downloaded FFMPEG static for windows 64bit.
    I then ran (in composer)

         $ composer require php-ffmpeg/php-ffmpeg

    in my vendor folder i have the following path.

       vendor\ffmpeg-20190429-ac551c5-win64-static\bin

    if I open the command prompt in that folder and type FFMPEG I get.

    ffmpeg version N-93710-gac551c54b1 Copyright (c) 2000-2019 the FFmpeg
    developers
    built with gcc 8.3.1 (GCC) 20190414
    configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-
    fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-
    libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --
    enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
    --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --
    enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
    --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --
    enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
    libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa
    --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --
    enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-
    nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
    libavutil      56. 26.100 / 56. 26.100
    libavcodec     58. 52.100 / 58. 52.100
    libavformat    58. 27.103 / 58. 27.103
    libavdevice    58.  7.100 / 58.  7.100
    libavfilter     7. 50.100 /  7. 50.100
    libswscale      5.  4.100 /  5.  4.100
    libswresample   3.  4.100 /  3.  4.100
    libpostproc    55.  4.100 / 55.  4.100
    Hyper fast Audio and Video encoder
    usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

    So I’m pretty sure FFMPEG is installed which was my goal.

    Now on my PHP side here is where I am at, and I’m not sure how this works.

    1ST QUESTION. Do I need to save my $_POST files to the drive before manipulating them ? Or can I use the $file and $filep as is ? I don’t really want to store those files, only the output.

    My SLIM code.

    $app->post('/telestrator', function(Request $request, Response $response)
    {

    $response = array();

    if (isset ($_POST['ID']) && ($_POST['position']) && $_FILES['video']
    ['error'] === UPLOAD_ERR_OK && $_FILES['image']['error'] ===
    UPLOAD_ERR_OK) {

    $file = $_FILES['video']['tmp_name'];
    $filep = $_FILES['image']['tmp_name'];
    $time = $_POST['position'];
    $position = msToTime($time);
    $filetime = round(microtime(true) * 1000);
    $outputfolder = 'teletemp/';

    $ID = $_POST['ID'];

    $tempvid = $ID . 'tempvid' . 'mp4';
    $finalvid = $ID  . $filetime . 'mp4';


    $ffmpegpath = "public/ffmpeg.exe";

    echo "Starting ffmpeg...\n\n";
    echo shell_exec("$ffmpegpath -loop 1 -i $filep -c:v libx264 -t 3 -pix_fmt
    yuv420p \"$outputfolder.\" $tempvid /");
    echo shell_exec("$ffmpegpath -i $file -t $position -c copy
    \"$outputfolder\"
    small-1.mp4 -ss $position -codec copy \"$outputfolder\" small-2.mp4 ");
    echo shell_exec("$ffmpegpath -i small-1.mp4 -i $tempvid.mp4 -i small-
    2.mp4 \
    -filter_complex \"[0:v:0][1:v:0][2:v:0]concat=n=3:v=1:a=1[outv]\" \
    -map \"[outv]\" $finalvid" );
    echo "Done.\n";

    $upload = new videouploads();

           $desc = 'telestrated video for ' . $ID . $filetime;
           $ID = $_POST['ID'];  

           if ($upload->saveVideoFile($finalvid, getFileExtension($finalvid),
    $desc, $ID)) {
               $response['error'] = false;
               $response['message'] = 'File Uploaded Successfullly';
           }
        else {
           $response['error'] = true;
           $response['message'] = 'Required parameters are not available';
       }
       echo json_encode($response);
     }
    });

    function getFileExtension($file)
    {
    $path_parts = pathinfo($file);
    return $path_parts['extension'];
    }

    function msToTime($duration) {
    $seconds = floor($duration / 1000);
    $minutes = floor($seconds / 60);
    $hours = floor($minutes / 60);
    $milliseconds = $duration % 1000;
    $seconds = $seconds % 60;
    $minutes = $minutes % 60;

    $format = '%02u:%02u:%02u.%03u';
    $time = sprintf($format, $hours, $minutes, $seconds, $milliseconds);
    return rtrim($time, '0');

    }

    so it’s not running here is my postman. How do I get it to actually run the FFMPEG.

    Starting ffmpeg...

    Done.

    <br />
    <b>Notice</b>:  Undefined index: extension in
    <b>C:\xampp\htdocs\Pathways\public\index.php</b> on line
    <b>14741</b>
    <br />
    {"error":false,"message":"File Uploaded Successfullly"}
  • How to compile FFmpeg as static (single file)

    28 mai 2019, par Patrickz

    I would like to compile FFmpeg 4.1.3 as static or single file, After compiled. It’s shared binary.

    Here is what I do

    Install the dependencies

    apt-get -y install build-essential autoconf automake cmake libtool git \
    checkinstall nasm yasm libass-dev libfreetype6-dev libsdl2-dev libtool \
    libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
    libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev libchromaprint-dev \
    frei0r-plugins-dev ladspa-sdk libcaca-dev libcdio-paranoia-dev \
    libcodec2-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgme-dev \
    libgsm1-dev libjack-dev libmodplug-dev libmp3lame-dev libopencore-amrnb-dev \
    libopencore-amrwb-dev libopenjp2-7-dev libopenmpt-dev libopus-dev \
    libpulse-dev librsvg2-dev librubberband-dev librtmp-dev libshine-dev \
    libsmbclient-dev libsnappy-dev libsoxr-dev libspeex-dev libssh-dev \
    libtesseract-dev libtheora-dev libtwolame-dev libv4l-dev libvo-amrwbenc-dev \
    libvpx-dev libwavpack-dev libwebp-dev libx264-dev libx265-dev \
    libxvidcore-dev libxml2-dev libzmq3-dev libzvbi-dev liblilv-dev libmysofa-dev \
    libopenal-dev opencl-dev gnutls-dev libfdk-aac-devre

    prepare FFmpeg source code

    wget https://github.com/FFmpeg/FFmpeg/archive/n4.1.3.tar.gz
    tar -xvf n4.1.3.tar.gz
    cd FFmpeg-n4.1.3

    Build

    ./configure --disable-shared --enable-static --enable-pthreads --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-filters --enable-openssl --enable-runtime-cpudetect --extra-version=Patrickz

    then make & make install

    Compile passed, but it is shared binary. Any solutions or suggestion please.

  • Launch command from controller avoid loading page

    28 juin 2019, par JoakDA

    When I launch a command from a Symfony controller, the command is executed but the GET request does not finish.

    My command launchs a node.js script that receive rtsp frames transcoded from ffmpeg and broadcast it to a websocket.

    This is a Debian 9 server, running Symfony 4, PHP 7.3.5 and Apache2.

    This is my controller show action that calls the command :

       /**
        * Render view to show device details.
        * @param Request $request
        * @param $deviceid
        * @return Response
        * @Route("devices/show/{deviceid}", name="device_show", methods={"GET"})
        * @IsGranted("ROLE_OPERATOR")
        */
       public function showAction(Request $request, $deviceid)
       {
       try{
           //Find device to show from system
           $deviceToShow = $this->repository->find($deviceid);

           if ($deviceToShow) {
               $this->logger->debug('Show device: . Device has been found. Delete it... Data: ' . $deviceToShow->__toString());

               //Launch video streaming commands
               $command = new VideoServerCommand($this->entityManager, $this->logger, $this->getParameter('kernel.project_dir'));
               $input = new ArrayInput(array(
                   'secret' => str_replace(' ', '', $deviceToShow->getName()),
                   'http_port' => 8002,
                   'ws_port' => 8005
               ));
               $output = new BufferedOutput();
               $resultCode  = $command->run($input, $output);

               $content = $output->fetch();

               if ($resultCode === 0){
                   $this->logger->info('Call Video Server Command: Ok. Video Server started successfully. Console output: ' . $content);
               }else{
                   $this->logger->error('Call Video Server Command: Ko. Could not start video server. Console output: ' . $content);
               }

           }else{
               $message = $this->translator->trans('Device with identifier %deviceid% was not found.',
                   ['%deviceid%' => $deviceid]);

               $this->addFlash('error', $message);

               $this->logger->error('Show device: Ko. Device with identifier ' . $deviceid . ' was not found.');
           }
       }catch (Exception $exception) {
           $message = $this->translator->trans('Error while executing action. Error detail: %detail%.',
               ['%detail%' => $exception->getMessage()]);

           $this->addFlash(
               'error', $message
           );

           $this->logger->critical('Show device: Ko. Exception catched. Error detail: ' . $exception->getMessage());
       }

       $host = explode(':', $request->getUri());

       return $this->render('device/show.html.twig', array(
           'baseurl' => $host[1],
           'secret' => str_replace(' ', '', $deviceToShow->getName()),
           'device' => $deviceToShow,
       ));
       }

    And this is my command code that runs the node.js script

    protected function execute(InputInterface $input, OutputInterface $output)
       {
           try {
               $this->logger->info('Start web socket: Setup websocket server...');
               $this->io = new SymfonyStyle($input, $output);
               $now = new \DateTime();
               $this->io->title('Start websocket server ' . $now->format('d-m-Y G:i:s') . '...');

               //Get input parameters
               $secret = $input->getArgument('secret');
               $tcpPort = $input->getArgument('http_port');
               $wsPort = $input->getArgument('ws_port');

               $output->writeln([
                   'Video Server',// A line
                   '============',// Another line
                   'Starting Video Reception Socket...',// Empty line
               ]);

               //Call node websocket-relay.js
               $command = 'node ' . $this->path . '/assets/js/websocket-relay.js ' . $secret . ' ' . $tcpPort . ' ' . $wsPort;
               //Only want to execute for 60 seconds
               $nodeVideoRelay = new Process(exec($command));
               $nodeVideoRelay->setTimeout(60);
               $nodeVideoRelay->setIdleTimeout(60);

               try {
                   $nodeVideoRelay->run();

                   $this->logger->info('Start video streaming: OK. Video streaming successfully started...');
                   $this->io->success('Start video streaming: OK. Video streaming successfully started...');
                   $this->io->writeln($nodeVideoRelay->getOutput());
               } catch (ProcessTimedOutException $timedOutException) {
                   $nodeVideoRelay->stop(3, SIGINT);
                   $this->io->success('Start video streaming: Ok. Streaming finished.');
               }
               //}
           } catch (Exception $exception) {
               $this->logger->critical('Start video streaming: Ko. Exception catched. Error detail: ' . $exception->getMessage());
               $this->io->error('Start video streaming: Ko. Exception catched. Error detail: ' . $exception->getMessage());
           }
       }

    And the "websocket-relay.js" is an script got from https://github.com/phoboslab/jsmpeg/blob/master/websocket-relay.js

    The result is that the page is not loading. I have another command that process the RTSP stream using ffmpeg and send the date to a websocket.

    On the page that returns my controller action, it appears a canvas where the video will be rendered.

    I want to render the page as soon as possible and that the node.js script runs on background without blocking the main process.

    Thank you for helping me.