Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (99)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (8375)

  • Moviepy : subclip fails when iterating through CSV

    5 mai 2016, par user3316291

    I am trying to randomize the order of video clips based on timing from a CSV file and then reassemble the randomized clips into a single video. However, I am receiving an error in the loop that iterates through each clip timing to create the subclip.

    Here is what my CSV looks like :

    00:00:32.18,00:00:52.10,1
    00:00:52.11,00:00:56.09,2
    00:00:56.10,00:00:58.15,3
    00:00:58.16,00:01:05.16,4
    00:01:05.17,00:01:16.04,5

    column 1 is clip onset
    column 2 is clip offset
    column 3 is scene number that I use to randomize

    Here is my code :

    import os
    import csv
    import numpy as np
    from moviepy.editor import *

    f = open('SceneCuts.csv')
    csv_f = csv.reader(f)

    scenes = []
    ons = []
    offs = []
    for row in csv_f:
       ons.append(row[0])
       offs.append(row[1])
       scenes.append(row[2])

    r_scene = scenes
    np.random.seed(1000)
    np.random.shuffle(r_scene)
    r_scene = map(int, r_scene)

    clip = VideoFileClip("FullVideo.m4v")

    temp = []
    for row in r_scene:
       print(row)
       temp.append(clip.subclip(ons[row-1], offs[row-1]))

    catclip = concatenate_videoclips(temp)
    catclip_resize = catclip.resize((1024,576))
    catclip_resize.write_videofile("RandomVideo.mp4")

    Here is the output, error occurs at line 29 (temp.append)

    File "/Users/Dustin/anaconda/lib/python2.7/site-packages/moviepy/video/io/ffmpeg_reader.py", line 87, in initialize
    self.proc = sp.Popen(cmd, **popen_params)

    File "/Users/Dustin/anaconda/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)

    File "/Users/Dustin/anaconda/lib/python2.7/subprocess.py", line 1316, in _execute_child
    data = _eintr_retry_call(os.read, errpipe_read, 1048576)

    File "/Users/Dustin/anaconda/lib/python2.7/subprocess.py", line 476, in _eintr_retry_call
    return func(*args)

    OSError: [Errno 22] Invalid argument

    Based on my research, it appears to be something regarding child processes and subprocess.Popen, but I can’t figure it out. Thanks !

    EDIT to add new information :
    I have been running the above script in Spyder (anaconda) and receiving the above errors. However, when I run from a terminal or sublime (cmd+b), the code "works". It runs and I do not get the above error, however, the resulting video file is a mess. There are multiple conflicting audio tracks that shouldn’t be there. I am not sure what is going on in Spyder, but I’d love to know. Also, I still need to fix the audio problem.

  • How to use ffmpeg to overlay waveforms on xstack mosaics and specify specific audio for playback

    1er mai 2022, par kellib

    I would like to make a mosaic of multiple titled streams, 1) specifying which of the audio streams to play and 2) overlay waveforms at the bottom of each of the video tiles for the audio that they belong to.

    


    I'm successfully able to create the titled mosaic of streams with the code below.

    


    However :

    


      

    1. I'm having a hard time figuring out how to specify just one of the specific audio sources. I found amix, but I don't really want to mix them, I just want to specify audio [a0], or [a1], or [a2], etc.
    2. 


    


    and

    


      

    1. I'm having a hard time figuring out how to overlay the wave forms at the bottom of the video for each of the tiles. I struggled trying to figure out putting showwaves into the mix. Is it possible ?
    2. 


    


    I want each tile to look like this, but since these are rtmp streams, they need to play-out the matching waveforms dynamically with each stream. https://dragonquest64.blogspot.com/2020/01/ffmpeg-audio-waveform.html

    


    If someone could point me in the right direction, that would be great. I'm getting close, but I'm pretty new to all of this, and have already spent way more time than I should have, so would love a little help.

    


    ffmpeg \
-i rtmp://my.cdn.com/srcEncoders/STREAM-1 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-2 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-3 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-4 \
  -filter_complex " \
      [0:v] setpts=PTS-STARTPTS, scale=qvga \
    , drawtext=text=STREAM-1:fontsize=20:x=10:y=10:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5 [a0]; \
      [1:v] setpts=PTS-STARTPTS, scale=qvga \
    , drawtext=text=STREAM-2:fontsize=20:x=10:y=10:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5 [a1]; \
      [2:v] setpts=PTS-STARTPTS, scale=qvga \
    , drawtext=text=STREAM-3:fontsize=20:x=10:y=10:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5 [a2]; \
      [3:v] setpts=PTS-STARTPTS, scale=qvga \ 
    , drawtext=text=STREAM-4:fontsize=20:x=10:y=10:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5 [a3]; \
      [a0][a1][a2][a3]xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0[out]; \
    amix=inputs=1
      " \
  -map "[out]" \
 -c:v libx264 -b:v 1000k -g 30 -keyint_min 120 -profile:v baseline -preset veryfast -f mpegts "udp://127.0.0.1:1234?pkt_size=1316"


    


  • FFmpeg - cannot find ExecuteBinaryResponseHandler - Android/Java

    20 juillet 2018, par pudility

    I am trying to make a module for react-native that will change a video into a gif. I have little to no experience with android studios/java, but I would love to learn more ! I am using this library to convert the video to a gif. Here is my code :

    package com.reactlibrary;

    import android.widget.Toast;
    import com.facebook.react.bridge.ReactApplicationContext;
    import com.facebook.react.bridge.ReactContextBaseJavaModule;
    import com.facebook.react.bridge.ReactMethod;
    import com.github.hiteshsondhi88.libffmpeg.FFmpeg;

    public class RNGifMakerModule extends ReactContextBaseJavaModule {

     private final ReactApplicationContext reactContext;

     public RNGifMakerModule(ReactApplicationContext reactContext) {
       super(reactContext);
       this.reactContext = reactContext;
     }

     @Override
     public String getName() {
       return "RNGifMakerModule";
     }

     @ReactMethod
     public void alert(String message) {
         Toast.makeText(getReactApplicationContext(), "Error", Toast.LENGTH_LONG).show();
         String[] cmd = {"-i"
                 , message
                 , "Image.gif"};
         conversion(cmd);
     }

     public void conversion(String[] cmd) {

       FFmpeg ffmpeg = FFmpeg.getInstance(this.reactContext);

       try {


         // to execute "ffmpeg -version" command you just need to pass "-version"
         ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {

           @Override
           public void onStart() {
           }

           @Override
           public void onProgress(String message) {
           }

           @Override
           public void onFailure(String message) {
           }

           @Override
           public void onSuccess(String message) {
           }

           @Override
           public void onFinish() {
           }
         });
       } catch (FFmpegCommandAlreadyRunningException e) {
         // Handle if FFmpeg is already running
         e.printStackTrace();
       }
     }
    }

    And I get this error :

    Error:(43, 31) error: cannot find symbol class ExecuteBinaryResponseHandler

    This seems odd to be, because in the documentation for ffmpeg-android-java it says to use almost exactly the same code.

    Bounty

    The bounty will be awarded to you if you can find a way to convert a video.mp4 into a gif. You do not necessarily have to use FFmpeg, but your solution has to work with java/android studios.