Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (112)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (11862)

  • Ffmpeg only receives a piece of information from the pipe

    4 juillet 2017, par Maxim Fedorov

    First of all - my english is not very good, i`m sorry for that.

    I use ffmpeg from c# to convert images to video. To interact with ffmpeg, I use pipes.

    public async Task ExecuteCommand(
           string arguments,
           Action<namedpipeserverstream> sendDataUsingPipe)
       {
           var inStream = new NamedPipeServerStream(
               "from_ffmpeg",
               PipeDirection.In,
               1,
               PipeTransmissionMode.Byte,
               PipeOptions.Asynchronous,
               PipeBufferSize,
               PipeBufferSize);

           var outStream = new NamedPipeServerStream(
               "to_ffmpeg",
               PipeDirection.Out,
               1,
               PipeTransmissionMode.Byte,
               PipeOptions.Asynchronous,
               PipeBufferSize,
               PipeBufferSize);

           var waitInConnectionTask = inStream.WaitForConnectionAsync();
           var waitOutConnectionTask = outStream.WaitForConnectionAsync();

           byte[] byteData;

           using (inStream)
           using (outStream)
           using (var inStreamReader = new StreamReader(inStream))
           using (var process = new Process())
           {
               process.StartInfo = new ProcessStartInfo
               {
                   RedirectStandardOutput = true,
                   RedirectStandardError = true,
                   RedirectStandardInput = true,
                   FileName = PathToFfmpeg,
                   Arguments = arguments,
                   UseShellExecute = false,
                   CreateNoWindow = true
               };

               process.Start();

               await waitOutConnectionTask;

               sendDataUsingPipe.Invoke(outStream);

               outStream.Disconnect();
               outStream.Close();

               await waitInConnectionTask;

               var logTask = Task.Run(() => process.StandardError.ReadToEnd());
               var dataBuf = ReadAll(inStream);

               var shouldBeEmpty = inStreamReader.ReadToEnd();
               if (!string.IsNullOrEmpty(shouldBeEmpty))
                   throw new Exception();

               var processExitTask = Task.Run(() => process.WaitForExit());
               await Task.WhenAny(logTask, processExitTask);
               var log = logTask.Result;

               byteData = dataBuf;

               process.Close();
               inStream.Disconnect();
               inStream.Close();
           }

           return byteData;
       }
    </namedpipeserverstream>

    Action "sendDataUsingPipe" looks like

    Action<namedpipeserverstream> sendDataUsingPipe = stream =>
           {
               foreach (var imageBytes in data)
               {
                   using (var image = Image.FromStream(new MemoryStream(imageBytes)))
                   {
                       image.Save(stream, ImageFormat.Jpeg);
                   }
               }
           };
    </namedpipeserverstream>

    When I send 10/20/30 images (regardless of the size) ffmpeg processes everything.
    When I needed to transfer 600/700 / .. images, then in the ffmpeg log I see that it only received 189-192, and in the video there are also only 189-192 images.
    There are no errors in the logs or exceptions in the code.

    What could be the reason for this behavior ?

  • cinepakenc : fixes and improvements

    27 juin 2017, par addr-see-the-website@aetey.se
    cinepakenc : fixes and improvements
    

    version 2013-02-08 Rl
    - fixes/optimization in multistrip encoding and codebook size choice,
    quality/bitrate is now better than that of the binary proprietary encoder

    version 2013-02-12 Rl
    - separated codebook training sets, avoided the transfer of wasted bytes,
    which yields both better quality and smaller files
    - now using the correct colorspace (TODO : move conversion to libswscale)

    version 2013-02-14 Rl "Valentine’s Day" version :
    - made strip division more robust
    - minimized bruteforcing the number of strips,
    (costs some R/D but speeds up compession a lot), the heuristic
    assumption is that score as a function of the number of strips has
    one wide minimum which moves slowly, of course not fully true
    - simplified codebook generation,
    the old code was meant for other optimizations than we actually do
    - optimized the codebook generation / error estimation for MODE_MC

    version 2013-04-28 Rl
    - bugfixed codebook optimization logic

    version 2014-01-20 Rl
    - made the encoder compatible with vintage decoders
    and added some yet unused code for possible future
    incremental codebook updates
    - fixed a small memory leak

    version 2014-01-21 Rl
    - believe it or not, now we get even smaller files, with better quality
    (which means I missed an optimization earlier :)

    Signed-off-by : Diego Biurrun <diego@biurrun.de>

    • [DBH] libavcodec/cinepakenc.c
  • ffmpeg : specify/force pixel format for input H.264 video

    30 juillet 2017, par AndreG

    I have some MP4 video files missing the pixel format in their header information. I have already tried setting probesize and analyzeduration to their maximum values 2147483647 but that didn’t help.

    So I know these videos are probably corrupt but if this is the only information missing I was thinking I could maybe recover them by rebuilding their header information or somehow decoding them by forcing a pixel format. Does anyone have any idea if this is possible ? Some more background on the file :

    Mediainfo :

    $ mediainfo DJI_0090.MOV
    General
    Complete name                            : DJI_0090.MOV
    Format                                   : MPEG-4
    Format profile                           : QuickTime
    Codec ID                                 : qt   2014.02 (qt  )
    File size                                : 165 MiB
    Duration                                 : 22 s 322 ms
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 61.8 Mb/s
    Encoded date                             : UTC 2017-05-31 18:04:45
    Tagged date                              : UTC 2017-05-31 18:04:45
    Comment                                  : 0.9.145
    ©gpt                                     : -170.60
    ©gyw                                     : +157.30
    ©grl                                     : +0.00
    IsTruncated                              : Yes

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.2
    Format settings, CABAC                   : Yes
    Format settings, RefFrames               : 1 frame
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 22 s 322 ms
    Bit rate mode                            : Variable
    Bit rate                                 : 59.4 Mb/s
    Maximum bit rate                         : 50.0 Mb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 59.940 (60000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.478
    Stream size                              : 158 MiB (96%)
    Title                                    : DJI.AVC
    Language                                 : English
    Encoded date                             : UTC 2017-05-31 18:04:45
    Tagged date                              : UTC 2017-05-31 18:04:45
    Color range                              : Limited
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709

    ffprobe :

    $ ffprobe -analyzeduration 2147483647 -probesize 2147483647 DJI_0090.MOV
    ffprobe version 3.3.2 Copyright (c) 2007-2017 the FFmpeg developers
     built with Apple LLVM version 8.1.0 (clang-802.0.42)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables     --enable-avresample --cc=clang --host-cflags= --host-ldflags= --disable-indev=qtkit --enable-ffplay --enable-libfdk-aac --enable-libmp3lame     --enable-libsoxr --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-opencl --disable-lzma     --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.1.2_1/include/openjpeg-2.1 --enable-nonfree     --enable-vda
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc2e9002600] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080):     unspecified pixel format
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'DJI_0090.MOV':
     Metadata:
       major_brand     : qt  
       minor_version   : 538182144
       compatible_brands: qt  
       creation_time   : 2017-05-31T18:04:45.000000Z
       comment         : 0.9.145
     Duration: 00:00:22.36, bitrate: 61732 kb/s
       Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), none, 1920x1080, 59.94 fps, 59.94 tbr, 60k tbn, 120k tbc (default)
       Metadata:
         creation_time   : 2017-05-31T18:04:45.000000Z
         handler_name    : DJI.AVC
         encoder         : Dji AVC encoder

    I can’t force the pixel_format on ffmpeg this way :

    $ ffmpeg -pixel_format yuv420p -i DJI_0090.MOV test.mp4
    ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
     built with Apple LLVM version 8.1.0 (clang-802.0.42)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables     --enable-avresample --cc=clang --host-cflags= --host-ldflags= --disable-indev=qtkit --enable-ffplay --enable-libfdk-aac --enable-libmp3lame     --enable-libsoxr --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-opencl --disable-lzma     --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/2.1.2_1/include/openjpeg-2.1 --enable-nonfree     --enable-vda
     libavutil      55. 58.100 / 55. 58.100
     libavcodec     57. 89.100 / 57. 89.100
     libavformat    57. 71.100 / 57. 71.100
     libavdevice    57.  6.100 / 57.  6.100
     libavfilter     6. 82.100 /  6. 82.100
     libavresample   3.  5.  0 /  3.  5.  0
     libswscale      4.  6.100 /  4.  6.100
     libswresample   2.  7.100 /  2.  7.100
     libpostproc    54.  5.100 / 54.  5.100
    Option pixel_format not found.

    Is there any other way to accomplish this with ffmpeg ? Is it possible to edit their header information to include the pixel format information ?