Recherche avancée

Médias (1)

Mot : - Tags -/intégration

Autres articles (109)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

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

  • Submit enhancements and plugins

    13 avril 2011

    If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
    You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone.

Sur d’autres sites (8421)

  • 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
  • How can I open a program using PYTHON with Mutliprocessing, and send it strings from the main process ?

    12 février 2018, par Just Askin

    I have a program that sends frames as strings to FFMPEG using something similar to :

    Working script that streams without using multiprocessing module currently on Ubuntu

    #!/usr/bin/python
    import sys, os
    import subprocess as sp
    import pygame
    from pygame.locals import QUIT, KEYUP, K_ESCAPE
    import pygame.display

    pygame.init()
    os.environ['SDL_VIDEODRIVER'] = 'dummy'
    pygame.display.init()
    Display_Surface = pygame.display.set_mode([1280,720], 0, 32)

    # FFMPEG command and settings
    command = ['ffmpeg', '-framerate', '25', '-s', '1280x720', '-pix_fmt', 'rgba', '-f', 'rawvideo', '-i', '-',
              '-f', 'lavfi', '-i', 'anullsrc=cl=mono',
              '-pix_fmt', 'yuv420p','-s', 'hd720', '-r', '25', '-g', '50',
              '-f', 'flv', 'rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx']

    pipe = sp.Popen(command, bufsize=0, stdin=sp.PIPE)

    while True:
       # Quit event handling
       for event in pygame.event.get():
           if event.type == QUIT or (event.type == KEYUP and event.key == K_ESCAPE):
               pygame.quit()
               sys.exit()

       pipe.stdin.write(pygame.image.tostring(Display_Surface, "RGBA"))

    pipe.stdin.close()
    pygame.display.quit()
    os._exit()

    This works fine, except for the fact that it is killing my CPU, which in turn causes my live stream to freeze often. The stupid GIL won’t let FFMPEG run on another CPU/Core while I have 3 perfectly good cores doing nothing.

    I just whipped up some code to open FFMPEG in another process. (By the way, I’m familiar with threading.Thread, but not Multiprocessing).

    import os
    import subprocess as sp
    import multiprocessing

    class FFMPEG_Consumer():

       def __init__(self):
           proc = multiprocessing.Process(target=self.start_ffmpeg)
           proc.start()

       def start_ffmpeg(self):
           command = ['ffmpeg','-pix_fmt', 'rgba', '-f', 'rawvideo', '-i', '-',
                      '-f, 'lavfi', '-i', 'anullsrc=channel_layout=stereo:sample_rate=44100',
                      '-pix_fmt', 'yuv420p','-s', 'hd720', '-f', 'flv', 'rtmp://example.com']

           pipe = sp.Popen(command, bufsize=-1, stdin=sp.PIPE)

       def send_down_the_pipe(self, frame):
           pipe.stdin.write(frame)

    ffmpeg = FFMPEG_Consumer()

    For anyone that knows how to use multiprocessing, I’m sure you will immediately see that this does not work because I can’t share variables this way across processes. But, it does open FFMPEG on another core.

    Most online tutorials and resources focus creating pools of workers and queues to send those workers something to be processed until a job is finished. I am however trying to send a new string repeatedly to FFMPEG through each iteration.

    How can I pipe my string to that process/instance of FFMPEG ?

    Or is what I’m trying to do not possible ?

    This was the working solution (with dumbed down FFMPEG settings) :

    #!/usr/bin/python
    import sys, os, multiprocessing
    import subprocess as sp
    import pygame
    from pygame.locals import QUIT, KEYUP, K_ESCAPE
    import pygame.display

    pygame.init()
    os.environ['SDL_VIDEODRIVER'] = 'dummy'
    pygame.display.init()
    Display_Surface = pygame.display.set_mode([1280,720], 0, 32)

    class FFMPEGConsumer(object):
       def __init__(self):
           self._r, self._w = multiprocessing.Pipe()
           self.reader = os.fdopen(self._r.fileno(), 'r')
           self.writer = os.fdopen(self._w.fileno(), 'w', 0)
           self.proc = None

       def start_ffmpeg(self):

           command = ['ffmpeg', '-framerate', '25', '-s', '1280x720', '-pix_fmt', 'rgba', '-f', 'rawvideo', '-i', '-',
              '-f', 'lavfi', '-i', 'anullsrc=cl=mono',
              '-pix_fmt', 'yuv420p','-s', 'hd720', '-r', '25', '-g', '50',
              '-f', 'flv', 'rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx']

           self.proc = sp.Popen(command, bufsize=-1, stdin=self.reader)

       def send_down_the_pipe(self, frame):
           self.writer.write(frame)
           #print self._stdin.read()

       def __del__(self):
           self.reader.close()
           self.writer.close()

    ffmpeg = FFMPEGConsumer()

    while True:
       # Quit event handling
       for event in pygame.event.get():
           if event.type == QUIT or (event.type == KEYUP and event.key == K_ESCAPE):
               pygame.quit()
               sys.exit()

       ffmpeg.send_down_the_pipe(pygame.image.tostring(Display_Surface, "RGBA"))
       proc.join()

    pipe.stdin.close()
    pygame.display.quit()
    os._exit()

    All cores are firing and no lags so far !!!