Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (15)

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

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

Sur d’autres sites (4691)

  • ffmpeg livestream only shows one frame at a time

    28 octobre 2016, par user3308335

    So, I’ve tried to turn one of my pis into a silly "baby cam" for my pet and I followed the tutorial made by Ustream.tv on how to do this.

    This is the script I run to start the stream :

    #!/bin/bash
    RTMP_URL=<rtmpurl>
    STREAM_KEY=<streamkey>
    while :
    do
     raspivid -n -hf -t 0 -w 640 -h 480 -fps 15 -b 400000 -o - | ffmpeg -i - -vcodec copy -an  -f flv $RTMP_URL/$STREAM_KEY
     sleep 2
    done
    </streamkey></rtmpurl>

    However, whenever I go to view the stream, the stream shows only one frame. The same frame until I refresh the browser, watch the ad again, and then it’s a new same frame that it’ll show.

    Does anyone have an idea why this might be happening or any troubleshooting tricks for me to try ?

  • Unusual results extracting VP9 pkt_size with ffprobe as compared to H.264

    26 novembre 2016, par Jeff S.

    I’m trying to graph the bitrate over time for H.264 and VP9 videos by extracting the frame size with ffprobe, but many of the VP9 videos are showing significantly lower bitrate and total size than both the file size would indicate and that ffprobe reports.

    Can someone point me in the right direction for finding the missing bytes ?

    For example :

    # The extracted values and the ffprobe values are very close for mp4
    Video Codec: h264
    Video Bitrate: 0.668869
    Frame Bitrate: 0.665552571931
    Video Size: 6381536.0
    Frame Total Size: 6349891

    # The extracted values and the ffprobe values are very different for some vp9 videos
    Video Codec: vp9
    Video Bitrate: 0.600966
    Frame Bitrate: 0.375144984531
    Video Size: 5730519.0
    Frame Total Size: 3577195

    Below is what I’m using for validation. Note that the sample videos do not contain audio.

    import subprocess
    import json

    def export_video_info(video_id):
       proc = subprocess.Popen(['ffprobe',
           '-v', 'quiet', '-print_format',
           'json', '-show_format',
           '-show_streams', '-show_frames',
           video_id
           ],
           stdout=subprocess.PIPE,
       )
       return proc.communicate()[0]

    # Example video:  https://www.youtube.com/watch?v=g_OdgCrnzYo
    # youtube-dl --id -f 135 https://www.youtube.com/watch?v=g_OdgCrnzYo
    # youtube-dl --id -f 244 https://www.youtube.com/watch?v=g_OdgCrnzYo
    video_list = ['g_OdgCrnzYo.mp4', 'g_OdgCrnzYo.webm']

    '''
    Format for every frame:

       {
           "media_type": "video",
           "key_frame": 0,
           "pkt_pts": 84484,
           "pkt_pts_time": "84.484000",
           "pkt_dts": 84484,
           "pkt_dts_time": "84.484000",
           "best_effort_timestamp": 84484,
           "best_effort_timestamp_time": "84.484000",
           "pkt_duration": 33,
           "pkt_duration_time": "0.033000",
           "pkt_pos": "7103361",
           "pkt_size": "28",
           "width": 854,
           "height": 480,
           "pix_fmt": "yuv420p",
           "sample_aspect_ratio": "1:1",
           "pict_type": "P",
           "coded_picture_number": 0,
           "display_picture_number": 0,
           "interlaced_frame": 0,
           "top_field_first": 0,
           "repeat_pict": 0
       },
    '''


    # NOTE: videos do not include audio
    for video in video_list:
       output = json.loads(export_video_info(video))
       ff_bitrate = float(output['format']['bit_rate']) / 10**6
       ff_duration = float(output['format']['duration'])
       ff_codec = output['streams'][0]['codec_name']
       ff_size = float(output['format']['size'])
       frame_size_sum = 0
       for val, items in enumerate(output['frames']):
           if output['frames'][val]['media_type'] == 'video':
               frame_size_sum += int(output['frames'][val]['pkt_size'])

       frame_bitrate = frame_size_sum / ff_duration * 8 / 10**6
       print('Video Codec: {}\nVideo Bitrate: {}\nFrame Bitrate: {}\nVideo Size: {}\nFrame Total Size: {}\n\n'.format(ff_codec, ff_bitrate, frame_bitrate, ff_size, frame_size_sum))
  • C# FFMPEG Process and Multiple files

    3 novembre 2016, par wesman

    I am working on a C# Form tool that will help me convert all of my phone and DSLR video to HEVC, currently, i have a program that uploads the photos and videos to different directories in my home server each time i connect to the WiFi. Once a month or so, i manually convert all the videos, but thought I would automate the process.. I have the Form working perfectly for processing 1 file. but get into trouble when processing a Directory (with possible sub-directories) all at once..

    Sorry, this is long, just want to be thorough. here is the button calls

    private void processFile_Click(object sender, EventArgs e)
       {
           OpenFileDialog file = new OpenFileDialog();
           file.InitialDirectory = baseMediaDirectory;
           if (file.ShowDialog() == DialogResult.OK)
           {
               ProcessSinlgeFile(file.FileName);
           }
       }

    (above)for one file and (below) for a directory

    private void processDirectory_Click(object sender, EventArgs e)
    {
       FolderBrowserDialog file = new FolderBrowserDialog();
       file.SelectedPath = baseMediaDirectory;
       if(file.ShowDialog() == DialogResult.OK)
       {
          ProcessDirectoryOfFiles(file.SelectedPath);
       }
    }

    private void ProcessDirectoryOfFiles(string selectedPath)
       {
           List<string> listOfFiles = GetAllFiles(selectedPath);
           foreach (string s in listOfFiles)
           {
               ProcessSinlgeFile(s);
           }
       }
    </string>

    both ultimately call this method, to do some checks and setup

    private void ProcessSinlgeFile(string fileName)
       {

           if (IsAcceptableMediaFile(fileName))
           {
               outputWindow.AppendText("File to Process: " + fileName);
               processMediaFile =
                   new MediaFileWrapper(this.outputWindow, new MediaFile(fileName), new NReco.VideoInfo.FFProbe());
               if (processMediaFile.OkToProcess)
               {
                   int initialCRFValue = 15;
                   //ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
                   string intialSpeed = "veryfast";
                   try {

                       ConvertToMPEG(processMediaFile.getFFMPEGCommand(initialCRFValue, intialSpeed), processMediaFile);
                   }
                   catch
                   {
                       // at somepoint, we'll catch a bad file size (or compression)
                       // then change the CRF value and/or compression speed
                   }
               }
           }
       }

    ultimately I get to this Method and run into trouble.

       private async void ConvertToMPEG(string arguments, MediaFileWrapper processMediaFile)
       {
           startTime = DateTime.Now;
           watch = new Stopwatch();
           watch.Start();
           progressBar1.Minimum = 0;
           progressBar1.Maximum = processMediaFile.GetTotalMilliseconds();

           // Start the child process.
           p = new Process();

           //Setup filename and arguments
           outputWindow.AppendText("ffmpeg " + arguments);
           p.StartInfo.Arguments = arguments;
           p.StartInfo.FileName = "ffmpeg.exe";
           p.StartInfo.UseShellExecute = false;

           // Redirect the output stream of the child process.
           p.StartInfo.RedirectStandardOutput = true;
           p.StartInfo.RedirectStandardError = true;
           p.StartInfo.RedirectStandardInput = true;

           // capture the date for stdout and std error
           // note FFMPEG uses Stderr exclusively
           p.ErrorDataReceived += new DataReceivedEventHandler(ErrorDataReceived);
           p.OutputDataReceived += new DataReceivedEventHandler(OutputDataReceived);

           // Hide Console Window
           p.StartInfo.CreateNoWindow = true;
           p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

           p.Start();
           p.BeginErrorReadLine();
           p.BeginOutputReadLine();
           await p.WaitForExitAsync();
       }

    and WaitForExitAsync is in another class because in can not be in here with a Form

       public static Task WaitForExitAsync(this Process process,
           CancellationToken cancellationToken = default(CancellationToken))
       {
           var tcs = new TaskCompletionSource();
           process.EnableRaisingEvents = true;
           process.Exited += (sender, args) => tcs.TrySetResult(null);
           if (cancellationToken != default(CancellationToken))
               cancellationToken.Register(tcs.SetCanceled);

           return tcs.Task;
       }

    however, single files work fine, when I call a directory through, it continuously starts processes for each file, trying to run them all at the same time. You can see I tried implementing this
    process.WaitForExit() asynchronously
    with no luck.