Recherche avancée

Médias (91)

Autres articles (87)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

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

  • 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"
  • More problems with FFmpeg not recognizing the directory I'm sending it to

    8 novembre 2019, par Requiem_7

    I am creating a program that takes an audio file, breaks it up into 30-second audio files, and sends those files to Google’s Speech Recognition API to transcribe the audio. I’m using FFmpeg to break up the original audio file and make the 30-second files. It was working for about 20 minutes and I didn’t change anything but now it’s giving me an error saying that no such file or directory exists.

    Here is the error it gives me :

    C:\Users\hmkur\Desktop\Python\Transcribing_Audio_GoogleAPI_Python>ffmpeg -i source/valve.flac -f segment -segment_time 30 -c copy parts/out%01d.flac
    ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 9.1.1 (GCC) 20190807
     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. 31.100 / 56. 31.100
     libavcodec     58. 54.100 / 58. 54.100
     libavformat    58. 29.100 / 58. 29.100
     libavdevice    58.  8.100 / 58.  8.100
     libavfilter     7. 57.100 /  7. 57.100
     libswscale      5.  5.100 /  5.  5.100
     libswresample   3.  5.100 /  3.  5.100
     libpostproc    55.  5.100 / 55.  5.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'source/valve.flac':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2mp41
       encoder         : Lavf58.29.100
     Duration: 00:11:42.54, start: 0.000000, bitrate: 129 kb/s
       Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         handler_name    : ISO Media file produced by Google Inc.
    [segment @ 000001f8e84bd100] Opening 'parts/out0.flac' for writing
    [segment @ 000001f8e84bd100] Failed to open segment 'parts/out0.flac'
    Could not write header for output file #0 (incorrect codec parameters ?): No such file or directory
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
       Last message repeated 1 times

    Both the folder "source" with "valve.flac" exists as well as the folder "parts" and the files "out0.flac", etc. I was originally trying in the wav file format, switched to flac and it worked for about 20 minutes then stopped working.

  • Piping stream to ffmpeg via forked process stdin

    6 novembre 2019, par Yanick Salzmann

    I am piping data from my raspberry pi camera to ffmpeg to convert them into an mp4 stream. I do so not with libavformat/libavformat but I call ffmpeg directly like this :

           context->ffmpeg_process = utils::launch_subprocess(
                   "ffmpeg",
                   {"-f", "rawvideo", "-pix_fmt", "yuv420p", "-s", "1920x1080", "-r", "30", "-i", "-", "-c", "libx264", "-f", "mp4", "-movflags", "frag_keyframe+empty_moov", "-", "-loglevel", "trace"}
           );

    This is my wrapper around fork and exec like this :

           const auto child = fork();
           if(child == 0) {
               if (dup2(stdin_pipe[PIPE_READ], STDIN_FILENO) == -1) {
                   exit(errno);
               }

               // same for stdout and sterr

               execvp(command.c_str(), proc_args);
               exit(errno);
           } else if(child > 0) {
               // same for stdout and stderr
               ret_process.stdin_pipe = stdin_pipe[PIPE_WRITE];
           }

    Now I have a callback that is called by the raspberry pi camera :

       void CameraHandler::handle_camera_frame(const std::vector &data, std::size_t size) {
           FILE* f = fopen("output.yuv4", "ab");
           fwrite(data.data(), 1, size, f);
           fclose(f);

           std::lock_guard l{_listener_lock};
           for (const auto &listener : _data_listeners) {
               std::size_t written = 0;
               while (written < size) {
                   const auto num_written = write(listener->ffmpeg_process.stdin_pipe, data.data() + written, size - written);
                   written += num_written;
                   if(num_written < 0) {
                       log->error("Broken stdin pipe");
                       break;
                   }
               }
           }
       }

    I deliberately append every frame to a file because I am running the exact same command as above (with cat output.yuv4 | ffmpeg ... > output4.mp4 to cross check).

    Now I can see that I am reading some data from my camera and pushing it to the ffmpeg process. But already after the first read ffmpeg complains, that the input data is invalid :

    [2019-11-06 20:08:04.010] [11872:11932] [carpi::data::CameraHandler] [info] Launched ffmpeg process. PID: 11933, error: 0
    [2019-11-06 20:08:04.014] [11872:11932] [carpi::video::RawCameraStream] [info] Camera dimension: 1920/1080
    ffmpeg version 4.1.4-1+rpt1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 8 (Raspbian 8.3.0-6+rpi1)
     configuration: --prefix=/usr --extra-version='1+rpt1~deb10u1' --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
     libavutil      56. 22.100 / 56. 22.100
     libavcodec     58. 35.100 / 58. 35.100
     libavformat    58. 20.100 / 58. 20.100
     libavdevice    58.  5.100 / 58.  5.100
     libavfilter     7. 40.101 /  7. 40.101
     libavresample   4.  0.  0 /  4.  0.  0
     libswscale      5.  3.100 /  5.  3.100
     libswresample   3.  3.100 /  3.  3.100
     libpostproc    55.  3.100 / 55.  3.100
    Successfully parsed a group of options.
    Parsing a group of options: input url -.
    Applying option pix_fmt (set pixel format) with argument yuv420p.
    Applying option s (set frame size (WxH or abbreviation)) with argument 1920x1080.
    Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 30.
    Successfully parsed a group of options.
    Opening an input file: -.
    [NULL @ 0xcd02d0] Opening 'pipe:' for reading
    [pipe @ 0xcd0b50] Setting default whitelist 'crypto'
    [AVIOContext @ 0xcd8d50] Statistics: 1048576 bytes read, 0 seeks
    pipe:: Invalid data found when processing input

    I am now confused. This is literally the same as I am fwriteing and then piping from the file. Is there something wrong with my write ?