Recherche avancée

Médias (0)

Mot : - Tags -/performance

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

Autres articles (94)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Les sons

    15 mai 2013, par
  • 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"

Sur d’autres sites (5986)

  • Extract audio from video in mp3 format using android-ffmpeg-library

    28 mai 2014, par user2870161

    I want extrat audio from any type of video file and save it in mp3 format using android-ffmpeg-library.

    My most of work is done here i am create wav file using this code but problame is when i create mp3 file it make only 0kb file in sdcard.

    I hope I’ve made myself clear, and thanks for taking the time to read this.

       if (inputPath == null || outputPath == null) {
           throw new IllegalStateException("Need an input and output filepath!");
       }  

       final List<string> cmd = new LinkedList<string>();


       String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();
       String fileName = "3.mp4";
       String fileName1 = "2.mp3";

       String path  = baseDir + "/" + fileName;
       String path1  = baseDir + "/" + fileName1;

         File f = new File(path);

         if(f.exists()){
             System.out.println("File existed");
         }else{
             System.out.println("File not found!");
         }

         cmd.add(mFfmpegPath);
         cmd.add("-i");
         cmd.add(path);

         cmd.add("-vn");
         cmd.add("-acodec");
         cmd.add("copy");

         cmd.add(path1);








       final ProcessBuilder pb = new ProcessBuilder(cmd);
       return new ProcessRunnable(pb);
    </string></string>
  • How to Write the Numpy array video to Disk While adding Audio from File using the python ffmpegio

    31 décembre 2023, par soham tilekar

    I Have an A NumPy array Representing the Video in the memory how Can I Use the ffmpegio python module to save it on the File on the disk While adding the audio.

    &#xA;

    I Try Many things. I Also Ask answer on the python-ffmpegio github page.&#xA;Discussinnon link

    &#xA;

    The Whole module Code is on the vidiopy

    &#xA;

    I Get an Error : -

    &#xA;

    Traceback (most recent call last):&#xA;  File "d:\soham_code\video_py\test.py", line 5, in <module>&#xA;    clip.write_videofile(r&#x27;D:\soham_code\video_py\test\test_video.mp4&#x27;)&#xA;  File "d:\soham_code\video_py\vidiopy\video\VideoClips.py", line 190, in write_videofile&#xA;    with ffmpegio.open(&#xA;  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\contextlib.py", line 137, in __enter__&#xA;    return next(self.gen)&#xA;           ^^^^^^^^^^^^^^&#xA;  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages\ffmpegio\__init__.py", line 324, in open&#xA;    stream = StreamClass(*args, **kwds)&#xA;             ^^^^^^^^^^^^^^^^^^^^^^^^^^&#xA;  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages\ffmpegio\streams\SimpleStreams.py", line 489, in __init__&#xA;    super().__init__(&#xA;  File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages\ffmpegio\streams\SimpleStreams.py", line 365, in __init__&#xA;    configure.add_url(ffmpeg_args, "input", *input)&#xA;TypeError: add_url() takes from 3 to 5 positional arguments but 765 were given&#xA;</module>

    &#xA;

    Modified Code : -

    &#xA;

        def write_videofile(self, filename, fps=None, codec=None,   &#xA;                        bitrate=None, audio=True, audio_fps=44100,&#xA;                        preset="medium", pixel_format=None,&#xA;                        audio_codec=None, audio_bitrate=None,&#xA;                        write_logfile=False, verbose=True,&#xA;                        threads=None, ffmpeg_params: dict[str, str] | None = None,&#xA;                        logger=&#x27;bar&#x27;, over_write_output=True):&#xA;        &#xA;        # video_np = np.asarray(tuple(self.iterate_frames_array_t(fps if fps else self.fps if self.fps else (_ for _ in ()&#xA;        #                                                                                                     ).throw(Exception(&#x27;Make Frame is Not Set.&#x27;)))))&#xA;&#xA;        audio_name, _ = os.path.splitext(filename)&#xA;&#xA;&#xA;        ffmpeg_options = {&#xA;            &#x27;preset&#x27;: preset,&#xA;            &#xA;            **(ffmpeg_params if ffmpeg_params is not None else {}),&#xA;            **({&#x27;c:v&#x27;: codec} if codec else {}),&#xA;            **({&#x27;b:v&#x27;: bitrate} if bitrate else {}),&#xA;            **({&#x27;pix_fmt&#x27;: pixel_format} if pixel_format else {}),&#xA;            **({&#x27;c:a&#x27;: audio_codec} if audio_codec else {}),&#xA;            **({&#x27;ar&#x27;: audio_fps} if audio_fps else {}),&#xA;            **({&#x27;b:a&#x27;: audio_bitrate} if audio_bitrate else {}),&#xA;            **({&#x27;threads&#x27;: threads} if threads else {}),&#xA;        }&#xA;&#xA;        with tempfile.NamedTemporaryFile(&#xA;            suffix=".wav", prefix=audio_name &#x2B; "_temp_audio_"&#xA;        ) as temp_audio_file:&#xA;            if self.audio and audio:&#xA;                self.audio.write_audio_file(temp_audio_file)&#xA;                # audio_file_name = temp_audio_file.name&#xA;&#xA;                ffmpeg_options.update(&#xA;                    {"extra_inputs": [temp_audio_file.name], "acodec": "copy", "map": ["0:v", "1:a"]}&#xA;                )&#xA;&#xA;            with ffmpegio.open(&#xA;                filename,&#xA;                "wv",&#xA;                fps,&#xA;                **ffmpeg_options,&#xA;                overwrite=over_write_output,&#xA;                show_log=True,) as f:&#xA;                &#xA;                for I in self.iterate_frames_array_t(fps):  # if fps else self.fps if self.fps else (_ for _ in ()&#xA;                #                                                                                             ).throw(Exception(&#x27;Make Frame is Not Set.&#x27;))):&#xA;                    f.write(I)&#xA;

    &#xA;

    I Tried Many things : -&#xA;using transcode, providing the -i flag with audio name While using the ffmpegio.write, etc.

    &#xA;

  • Write tests to check if a ffmpeg is installed

    7 novembre 2018, par gldraphael

    TLDR : I need a test that ensures FooAsync() throws FfmpegNotFoundInPathException if ffmpeg is not in path.


    I have a method like :

    public Task FooAsync() { /* ... */ }

    that throws an FfmpegNotFoundInPathException if ffmpeg is not in path.
    How do I go about writing tests for this ?

    (It’s okay if the test passes only within docker. I can selectively skip the test outside of Docker using Nate McMaster’s xunit extensions.)


    For completeness, FooAsync() looks something like this :

    public async Task FooAsync()
    {
       try
       {
           new Cli("ffmpeg")
               .SetArguments(args)
               .EnableStandardErrorValidation(false)
               .ExecuteAsync();
       }
       catch (Exception e)
       {
           // ...
           throw new FfmpegNotFoundInPathException(e);
       }
    }

    (Cli is from the CliWrap package.)