Recherche avancée

Médias (91)

Autres articles (13)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (3402)

  • C# Process in loop reading error output, causes "No async read operation is in progress on the stream" error

    29 mai 2023, par TSLee

    I am trying to read the format of multiple video files using ffmpeg in an asynchronous operation of Process and facing an error, "No async read operation is in progress on the stream". According to https://social.msdn.microsoft.com/Forums/vstudio/en-US/c961f461-7afb-4a92-b0ae-f78c2003b5de/help-an-asynchronous-read-operation-is-already-in-progress-on-the-standardoutput-stream?forum=csharpgeneral, I think I have to use CancelErrorRead(), as BeginErrorReadLine() can't be launched more than once. I also wonder if I use this function in the wrong place, because the read operation has ended in process1.exited() ? But the operation can't proceed to the second index with this error.

    


    How could I use CancelErrorRead()/CancelOutputRead() properly and where should I place them on the code ? I also did an experiment in that I commented these two CancelRead(), and a different error "async read operation has been started on the stream" will appear.

    


                Process process1 = new Process();
            process1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            process1.StartInfo.CreateNoWindow = true;
            process1.StartInfo.UseShellExecute = false;
            process1.StartInfo.FileName = ".\\ffmpeg.exe";
            process1.StartInfo.WorkingDirectory = ".\\";
            process1.EnableRaisingEvents = true;
            process1.StartInfo.RedirectStandardOutput = true; //if this is true, UseShellExecute must be false. true if output should be written to StandardOutput
            process1.StartInfo.RedirectStandardError = true;
            //indicates that the associated Process has written a line that's terminated with a newline
            process1.ErrorDataReceived += new DataReceivedEventHandler(inputHandler);
            process1.Exited += (ending, p) =>
            {
                flag = true;
                process1.CancelOutputRead();
                process1.CancelErrorRead();//
            };
            foreach (String file in inputList)
            {
                if (flag == true)
                {
                    flag = false;
                    process1.StartInfo.Arguments = "-i " + " \"" + file + "\"";
                    Console.WriteLine(process1.StartInfo.Arguments);
                    process1.Start();
                    process1.BeginOutputReadLine();//
                    process1.BeginErrorReadLine();
                    process1.WaitForExit(); //for asynchronous output
                }


            }
        }
        private void inputHandler(object sender, DataReceivedEventArgs l)
        {
             cba.Append(l.Data + "\n");
             videoInput = l.Data;
             //Console.WriteLine(cba);
             //Process p = sender as Process;
             Console.WriteLine(videoInput);

             this.BeginInvoke(new MethodInvoker(() =>
             {

              if (!String.IsNullOrEmpty(videoInput))
              {
                    if (videoInput.Contains("Stream #0:0"))
                    {
                        String subvideoInput1 = 
                        videoInput.Substring(videoInput.IndexOf("Stream #0:0"));
                        String video_inputType = subvideoInput1;
                        textBox1.Text += video_inputType + System.Environment.NewLine;
                        Console.WriteLine(video_inputType);
                     }
                     if (videoInput.Contains("Stream #0:1"))
                     {
                         String subvideoInput2 = 
                         videoInput.Substring(videoInput.IndexOf("Stream #0:1"));
                         Console.WriteLine(subvideoInput2.IndexOf("\n"));
                         Console.WriteLine(subvideoInput2);
                         String audio_inputType = subvideoInput2;
                         textBox1.AppendText(audio_inputType + System.Environment.NewLine);
                         Console.WriteLine(audio_inputType);
                     }
                     if (videoInput.Contains("Duration:"))
                     {
                         String videoinputDuration = 
                         videoInput.Substring(videoInput.IndexOf("Duration:"));
                         String subvideo_inputDuration = videoinputDuration.Substring(9);
                         String inputvideoDuration = 
                     subvideo_inputDuration.Remove(subvideo_inputDuration.IndexOf("."));
                         Console.WriteLine(inputvideoDuration);
                         double totalseconds = 
                         TimeSpan.Parse(inputvideoDuration).TotalSeconds;
                    
                    

                }
            }

        }));


    }


    


  • Index error with MoviePy and OSError : MoviePy error : failed to read the duration of file

    24 août 2022, par Alejandro

    I made a small script to concatenate some clips. The names of the clips are stored in another text file that is read from.

    


    I get the error first that

    


    in ffmpeg_parse_infos
line = [l for l in lines if keyword in l][index]
IndexError: list index out of range


    


    then during that exception above, another occurs below

    


    Traceback (most recent call last):&#xA;  File "e:\Projects\TwitchMontage\VideoCompilation\src\create_video.py", line 32, in <module>&#xA;    clips = create_clips_from_list(list)&#xA;  File "e:\Projects\TwitchMontage\VideoCompilation\src\create_video.py", line 20, in create_clips_from_list&#xA;    clip = VideoFileClip(str(video_file_path))&#xA;  File "C:\Users\Alejandro\AppData\Local\Programs\Python\Python38\lib\site-packages\moviepy\video\io\VideoFileClip.py", line 88, in __init__&#xA;    self.reader = FFMPEG_VideoReader(filename, pix_fmt=pix_fmt,&#xA;  File "C:\Users\Alejandro\AppData\Local\Programs\Python\Python38\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 35, in __init__&#xA;    infos = ffmpeg_parse_infos(filename, print_infos, check_duration,&#xA;  File "C:\Users\Alejandro\AppData\Local\Programs\Python\Python38\lib\site-packages\moviepy\video\io\ffmpeg_reader.py", line 289, in ffmpeg_parse_infos&#xA;    raise IOError(("MoviePy error: failed to read the duration of file %s.\n"&#xA;OSError: MoviePy error: failed to read the duration of file E:\Projects\TwitchMontage\VideoCompilation\VideoFiles\raw_clips\clip0.mp4&#xA;</module>

    &#xA;

    I suspect something is wrong with FFMPEG but I have no idea what to change to fix this. Is there any manipulation I can make to FFMPEG or the videos themselves to make them work with moviepy ?

    &#xA;

    Code is below :

    &#xA;

    import os&#xA;from moviepy.editor import VideoFileClip, concatenate_videoclips&#xA;&#xA;PATH_TO_VALID_CLIPS = &#x27;VideoCompilation/ClipData/valid_clips.txt&#x27;&#xA;PATH_TO_RAW_CLIPS = &#x27;E:\Projects\TwitchMontage\VideoCompilation\VideoFiles\\raw_clips&#x27;&#xA;os.environ[&#x27;IMAGEIO_FFMPEG_EXE&#x27;] = &#x27;ffmpeg&#x27;&#xA;&#xA;def read_valid_clips_list():&#xA;    #read valid clips&#xA;    file = open(PATH_TO_VALID_CLIPS, &#x27;r&#x27;)&#xA;    list = file.readlines()&#xA;    return list&#xA;&#xA;def create_clips_from_list(list):&#xA;    clips = []&#xA;    for i, filename in enumerate(list):&#xA;        print(str(i) &#x2B; &#x27;\n&#x27;)&#xA;        video_file_path = os.path.abspath(os.path.join(PATH_TO_RAW_CLIPS, filename))&#xA;        print(video_file_path &#x2B; &#x27;\n&#x27;)&#xA;        clip = VideoFileClip(str(video_file_path))&#xA;        clips.append(clip)&#xA;&#xA;    return clips&#xA;&#xA;def create_draft(clips):&#xA;    draft = concatenate_videoclips(clips)&#xA;    draft.write_videofile("VideoCompilation/VideoFiles/videos/draft.mp4")&#xA;    return draft&#xA;&#xA;list = read_valid_clips_list()&#xA;clips = create_clips_from_list(list)&#xA;draft = create_draft(clips)&#xA;

    &#xA;

    EDIT :

    &#xA;

    I discovered something strange. When I manually create the combined video, there are no errors but the video created is corrupted and unplayable.

    &#xA;

    sample code image

    &#xA;

  • ERROR in ./node_modules/fluent-ffmpeg/index.js Module not found : Error : Can't resolve './lib-cov/fluent-ffmpeg'

    3 octobre 2023, par yasgur99

    When I do yarn add fluent-ffmpeg i get this issue :

    &#xA;&#xA;

    WARNING in ./node_modules/electron-debug/index.js 96:45-58&#xA;Critical dependency: the request of a dependency is an expression&#xA; @ dll renderer&#xA;&#xA;WARNING in ./node_modules/electron-debug/index.js 97:61-74&#xA;Critical dependency: the request of a dependency is an expression&#xA; @ dll renderer&#xA;&#xA;WARNING in ./node_modules/fluent-ffmpeg/lib/options/misc.js 27:21-40&#xA;Critical dependency: the request of a dependency is an expression&#xA; @ ./node_modules/fluent-ffmpeg/lib/fluent-ffmpeg.js&#xA; @ ./node_modules/fluent-ffmpeg/index.js&#xA; @ dll renderer&#xA;&#xA;ERROR in ./node_modules/fluent-ffmpeg/index.js&#xA;Module not found: Error: Can&#x27;t resolve &#x27;./lib-cov/fluent-ffmpeg&#x27; in &#x27;/Users/yasgur99/Documents/desktopapp/node_modules/fluent-ffmpeg&#x27;&#xA; @ ./node_modules/fluent-ffmpeg/index.js 1:48-82&#xA; @ dll renderer&#xA;

    &#xA;&#xA;

    They said they fixed it in this GitIssue : here

    &#xA;&#xA;

    Anyone have any advice ?

    &#xA;&#xA;

    Some notes : Im using babel, I'm building an electron application

    &#xA;