Recherche avancée

Médias (91)

Autres articles (94)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

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

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

Sur d’autres sites (4555)

  • Why is image loading from ffmpeg using stdout slow ?

    23 octobre 2017, par Jirka Šáda

    I was just experimenting with FFMPEG, and wrote this testing piece of code, that is reading frames from FFMPEG and displaying them :

    public partial class MainWindow : Window
    {
       private WriteableBitmap wbm = new WriteableBitmap(1920, 1080, 96, 96, PixelFormats.Rgb24, null);
       private IntPtr backBuffer;
       private int totalFrames = 0;
       private bool drawing = false;

       public MainWindow()
       {
           InitializeComponent();

           backBuffer = wbm.BackBuffer;

           Thread t = new Thread(new ThreadStart(RunFFMPEG));
           t.Start();

           Thread measurer = new Thread(new ThreadStart(Measure));
           measurer.Start();
       }

       private void Measure()
       {
           while(true)
           {
               Thread.Sleep(1000);
               Console.Title = "FPS: " + totalFrames;
               totalFrames = 0;
           }
       }

       private void UpdateBitmap()
       {
           drawing = true;

           wbm.Lock();
           wbm.AddDirtyRect(new Int32Rect(0, 0, 1920, 1080));
           wbm.Unlock();

           mainImage.Source = wbm;

           drawing = false;
       }

       private void RunFFMPEG()
       {
           totalFrames = 0;

           int length = 1920 * 1080 * 3;

           // start FFMPEG process and pipe standart output
           ProcessStartInfo info = new ProcessStartInfo("ffmpeg.exe", "-f dshow -vcodec mjpeg -video_size 1920x1080 -framerate 30 -i video=\"A4 TECH HD PC Camera\" -y -pix_fmt rgb24 -f rawvideo -framerate 30 pipe:1");
           info.WindowStyle = ProcessWindowStyle.Hidden;
           info.UseShellExecute = false;
           info.CreateNoWindow = true;
           info.RedirectStandardOutput = true;

           Process p = new Process();
           p.StartInfo = info;
           p.Start();

           while (true) // read frames from standart output
           {

               byte[] data = new byte[length];

               for (int i = 0; i < length; i++) // read byte by byte, if we call normal Read(), the returned array is always mostly empty
                   data[i] = (byte)p.StandardOutput.BaseStream.ReadByte();

               if (!drawing)
               {
                   Marshal.Copy(data, 0, backBuffer, length);
                   Dispatcher.Invoke(() => UpdateBitmap()); // we are not in UI thread
               }

               totalFrames++;
           }
       }  
    }

    The problem is, although I get around 17-20 FPS reported, the Image is redrawing very very slowly (once or twice per a second) and even though the mainImage.Source =... line takes always similar amount of time, the speed at which the Image visually updates itself is getting progressively slower. What could be the cause ?? Thanks for any tips

    PS : I know the code is ugly and not following MVVM pattern, but it’s just and only for testing, please don’t hate me :-)

    Edit : The problem is not speed at which I’m reading from stdout, that’s fine (20 FPS), the problem is, that WPF Image is visually updating very slowly

  • Problems with video playback using the ffplay

    7 octobre 2023, par Anzor Gergov

    everyone. I have problems with video playback using the ffplay. Used the following command

    



    ffplay -i input.avi


    



    But the following error occurred.

    



    ffplay version N-87353-g183fd30 Copyright (c) 2003-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.101 / 57. 82.101
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.105.100 /  6.105.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[avi @ 00000000024bd9e0] Could not find codec parameters for stream 0 (Video: none (HEVC / 0x43564548), none, 1920x1080, 1697 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, avi, from 'c:\problem.avi':
  Duration: 00:00:25.00, start: 0.000000, bitrate: 1701 kb/s
    Stream #0:0: Video: none (HEVC / 0x43564548), none, 1920x1080, 1697 kb/s, 30.92 fps, 30.92 tbr, 30.92 tbn, 30.92 tbc
No codec could be found with id 0
Failed to open file 'c:\problem.avi' or configure filtergraph


    



    This video is playable without any problems via the VLC, Media Player Classic. 
After trying to find out more information about the video file, I used ffprobe command

    



    ffprobe -v 0  c:\problem.avi -print_format json -show_format -show_streams

{
    "streams": [
        {
            "index": 0,
            "codec_type": "video",
            "codec_tag_string": "HEVC",
            "codec_tag": "0x43564548",
            "width": 1920,
            "height": 1080,
            "has_b_frames": 0,
            "sample_aspect_ratio": "0:1",
            "display_aspect_ratio": "0:1",
            "level": -99,
            "r_frame_rate": "773/25",
            "avg_frame_rate": "773/25",
            "time_base": "25/773",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 773,
            "duration": "25.000000",
            "bit_rate": "1697304",
            "nb_frames": "773",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            }
        }
    ],
    "format": {
        "filename": "c:\\bin\\Virtual\\problem\\problem.avi",
        "nb_streams": 1,
        "nb_programs": 0,
        "format_name": "avi",
        "format_long_name": "AVI (Audio Video Interleaved)",
        "start_time": "0.000000",
        "duration": "25.000000",
        "size": "5318210",
        "bit_rate": "1701827",
        "probe_score": 100
    }
}


    



    What could be the problem with this videofile ?

    


  • How can i merge two videos using ffmpeg ?

    10 novembre 2017, par hasib prince

    I am using writingminds:FFmpegAndroid:0.3.2 library.and facing this permission denied issue.

    D/Video merging :: progress: /storage/emulated/0/DCIM/Camera/VID_20171109_070248.mp4: Permission denied

    11-10 17:35:09.905 10592-10592/com.example.hasib.vjoiner D/Video merging: : failure : ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 4.8 (GCC)

                                                                            libavutil      55. 17.103 / 55. 17.103
                                                                            libavcodec     57. 24.102 / 57. 24.102
                                                                            libavformat    57. 25.100 / 57. 25.100
                                                                            libavdevice    57.  0.101 / 57.  0.101
                                                                            libavfilter     6. 31.100 /  6. 31.100
                                                                            libswscale      4.  0.100 /  4.  0.100
                                                                            libswresample   2.  0.101 /  2.  0.101
                                                                            libpostproc    54.  0.100 / 54.  0.100
                                                                          /storage/emulated/0/DCIM/Camera/VID_20171109_070248.mp4: Permission denied

    11-10 17:35:09.905 10592-10592/com.example.hasib.vjoiner D/Video merging: : finished

    and this is the command i was going to execute.

    String[] command = new String[]{"-y", "-i", videoPaths.get(0), "-i", videoPaths.get(1).toString(), "-strict", "experimental", "-filter_complex",
               "[0:v]scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v0];[1:v] scale=iw*min(1920/iw\\,1080/ih):ih*min(1920/iw\\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\\,1080/ih))/2:(1080-ih*min(1920/iw\\,1080/ih))/2,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1",
               "-ab", "48000", "-ac", "2", "-ar", "22050", "-s", "1920x1080", "-vcodec", "libx264", "-crf", "27", "-q", "4", "-preset", "ultrafast", outputPath + "/output.mp4"};