Recherche avancée

Médias (2)

Mot : - Tags -/plugins

Autres articles (96)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (12743)

  • How to write to fifo in while loop and read in continuous process

    18 avril 2019, par Russ_ell

    I’m running 3 multiprocess while loops that each write to seperate fifo’s , that are read by a continuously running ffmpeg process. This runs for the first loop of each process then stops.

    The code below is one of the write loops ( the other two are pretty much the same ), and the read process.

    def dubv():
       while True:
         print('loop')
         file, dur = getFile('vocal')
         fx = (
             AudioEffectsChain()
             .delay()
         )
         songvfx = fx(file)
         with open('/tmp/pipe2.fifo', 'wb') as p1:
             print('open s fifo')
             p1.write(songvfx.T.tobytes())
             p1.close()
             print('close s fifo')
         del songvfx

    def mixer():
       command4 = [
           'ffmpeg',
           '-nostdin',
           '-re',
           '-y',
           '-thread_queue_size', '4096',
           '-ac', '2',
           '-ar', '44100',
           '-f', 'f32le',
           '-i', '/tmp/pipe1.fifo',
           '-thread_queue_size', '4096',
           '-ac', '2',
           '-ar', '44100',
           '-f', 'f32le',
           '-i', '/tmp/pipe2.fifo',
           '-thread_queue_size', '4096',
           '-ac', '2',
           '-ar', '44100',
           '-f', 'f32le',
           '-i', '/tmp/pipe3.fifo',
           '-filter_complex', '[0][1][2]amix=inputs=3:dropout_transition=3[map]',
           '-map', '[map]',
           '-c:a', 'libmp3lame',
           '-b:a', '320k',
           '-f', 'mp3',
           'icecast://source:hackme@localhost:8000/test'
       ]
       o = open('/tmp/pipe1.fifo', 'rb')
       o2 = open('/tmp/pipe2.fifo', 'rb')
       o3 = open('/tmp/pipe3.fifo', 'rb')
       mix = sp.Popen(command4, stdin=DEVNULL, bufsize=4096)
       mix.wait()

    I’d like the write process to write to fifo2 , then loop and continue writing to fifo2 , to be read in the mixer process continuously.

    EDIT :

    I think the problem is coming from the reader closing as the loop runs once , then runs round the loop , open the fifo but never prints ’close s fifo’ again , so i presume it cant write to the file ?

    EDIT 2 :

    I have resolved this by moving the fifo close out of the loop. My writer is now

    def dubv():
     with open('/tmp/pipe2.fifo', 'wb') as p2:
       while True:
         print('loop')
         file, dur = getFile('vocal')
         fx = (
             AudioEffectsChain()
             .delay()
         )
         songvfx = fx(file)
         p2.write(songvfx.T.tobytes())
         del songvfx
         time.sleep(2)
     p2.close()
     print('close s fifo')

    and the reader doesn’t open the fifo files as ffmpeg seems to deal with this.

    def mixer():
     command4 = [
         'ffmpeg',
         '-re',
         '-y',
         '-thread_queue_size', '4096',
         '-ac', '2',
         '-ar', '44100',
         '-f', 'f32le',
         '-i', '/tmp/pipe1.fifo',
         '-thread_queue_size', '4096',
         '-ac', '2',
         '-ar', '44100',
         '-f', 'f32le',
         '-i', '/tmp/pipe2.fifo',
         '-thread_queue_size', '4096',
         '-ac', '2',
         '-ar', '44100',
         '-f', 'f32le',
         '-i', '/tmp/pipe3.fifo',
         '-filter_complex', '[0][1][2]amix=inputs=3:dropout_transition=3[map]',
         '-map', '[map]',
         '-c:a', 'libmp3lame',
         '-b:a', '320k',
         '-f', 'mp3',
         'icecast://source:hackme@localhost:8000/test'
     ]
     mix = sp.Popen(command4, stdin=DEVNULL, bufsize=4096)
     mix.wait()

    If anybody see a ’better’ solution please comment.

    Thank you

  • How to show a watermark for 3 second on a MP4 using FFmpeg

    6 février 2014, par b1izzard

    I need to add a 3-second watermark to a Camera recorded video in Android. I'm using FFmpeg static build to execute the commands.

    Approach I

    I had tried the below command using latest version of FFmpeg(version N-60108-gda25a65) in my Desktop running Linux Mint, the command works fine.

    ffmpeg -y -itsoffset 3 -i input.mp4 -i myImage.jpg -filter_complex "[0:v][1:v]overlay=0:0:enable=between(t\,0\,3)"  -codec:a copy output.mp4

    In Android I'm using the FFmpegv1.2 with below config to execute the command.

    *******Starting FFMPEG
       ***ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers***
       ***  built on Mar 31 2013 23:44:57 with gcc 4.6 (GCC) 20120106 (prerelease)***
       ***  configuration: --arch=arm --target-os=linux --enable-runtime-cpudetect --enable-pic --disable-shared --enable-static --cross-prefix=/opt/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --sysroot=/opt/android-ndk-r8e/platforms/android-8/arch-arm --extra-cflags='-march=armv6' --extra-ldflags= --enable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network***
       ***  libavutil      52. 18.100 / 52. 18.100***
       ***  libavcodec     54. 92.100 / 54. 92.100***
       ***  libavformat    54. 63.104 / 54. 63.104***
       ***  libavdevice    54.  3.103 / 54.  3.103***
       ***  libavfilter     3. 42.103 /  3. 42.103***
       ***  libswscale      2.  2.100 /  2.  2.100***
       ***  libswresample   0. 17.102 /  0. 17.102***

    Java Code to run the FFmpeg command :

    String[] ffmpegCommandToAddWatermark = {
               mFfmpegInstallPath, "-y", "-itsoffset","3",
                "-i", INPUT_VIDEO_PATH, "-i", WATERMARK_IMAGE_PATH,
                "-filter_complex","[0:v][1:v]overlay=0:0:between(t\\,0\\,3)",
                "-strict","-2",
                "-codec:a","copy",OUTPUT_VIDEO_PATH};          
           try {
           Process ffmpegProcess = new ProcessBuilder(ffmpegCommandToAddWatermark)
               .redirectErrorStream(true).start();

           String line;

           BufferedReader reader = new BufferedReader(
               new InputStreamReader(ffmpegProcess.getInputStream()));
           Log.d(TAG, "*******Starting FFMPEG");
           while ((line = reader.readLine()) != null ) {

               Log.d(TAG, "***" + line + "***");
           }
           Log.d(null, "****ending FFMPEG****");

           } catch (Exception e) {
           e.printStackTrace();
           }

    The command execution failed with following error :

    ***[overlay @ 0x271f770] No option name near 'between(t,0,3)'***
    ***[AVFilterGraph @ 0x2711530] Error initializing filter 'overlay' with args '0:0:between(t,0,3)'***
    ***Error configuring filters.***

    The same command executes successfully when :enable=between(t\,0\,3) is removed, but the resulting output video has the watermark throughout the timeline, but I need watermark only for the starting 3 seconds.

    Approach II :

    I tried to convert WaterMarkImage to WaterMarkVideo

    ffmpeg -y -loop 1 -r 30 -i WaterMarkImage.jpg -b:v "4096k" -vf "scale=640:480" -t 3 WaterMarkVideo.mp4

    And then merge the WaterMarkVideo.mp4+CameraRecordedVideo.mp4 using the concat command :

    ffmpeg -y -f concat -i inputs.txt -c copy output.mp4

    The resulting output is corrupt due to BitRate,FrameRate,etc., mismatch. Any idea to solve the problem ?.

  • avformat/wavdec : Consider AV_INPUT_BUFFER_PADDING_SIZE in set_spdif()

    24 novembre 2020, par Michael Niedermayer
    avformat/wavdec : Consider AV_INPUT_BUFFER_PADDING_SIZE in set_spdif()
    

    The buffer is read by using the bit reader
    Fixes : out of array read
    Fixes : 27539/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-5650565572591616

    Found-by : continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavformat/wavdec.c