Recherche avancée

Médias (91)

Autres articles (33)

  • Pas question de marché, de cloud etc...

    10 avril 2011

    Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
    sur le web 2.0 et dans les entreprises qui en vivent.
    Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
    Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
    le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
    Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (2769)

  • avformat : remove more unneeded avio_flush() calls

    4 janvier 2020, par Marton Balint
    avformat : remove more unneeded avio_flush() calls
    

    These instances are simply redundant or present because avio_flush() used to be
    required before doing a seekback. That is no longer the case, aviobuf code does
    the flush automatically on seek.

    This only affects code which is either disabled for streaming IO contexts or
    does no seekbacks after the flush, so this change should have no adverse effect
    on streaming.

    Signed-off-by : Marton Balint <cus@passwd.hu>

    • [DH] libavformat/asfenc.c
    • [DH] libavformat/avienc.c
    • [DH] libavformat/gxfenc.c
    • [DH] libavformat/segafilmenc.c
    • [DH] libavformat/wavenc.c
  • Trying to redirect binary stdout of ffmpeg to NeroAacEnc stdin

    2 mai 2017, par Ben

    I am trying to write a program in C# 2010 that converts mp3 files to an audio book in m4a format via ffmpeg.exe and NeroAACenc.exe.
    For doing so I redirect stdout of ffmpeg to stdin of the Nero encoder within my application using the build in Diagnostics.Process class.

    Everything seems to work as expected but for some reason StandardOutput.BaseStream
    of ffmpeg stops receiving data at some time. The process does not exit and the ErrorDataReceived event is also not getting raised.
    The produced output m4a file has always a length of 2 minutes. The same applies if I just encode the mp3 file to a temp wav file without feeding Nero.

    I tried the same via the command line and this works without any problem.

    ffmpeg -i test.mp3 -f wav - | neroAacEnc -ignorelength -if - -of test.m4a

    Can anyone please tell me what I am doing wrong here ?
    Thanks in advance.

    class Encoder
    {
       private byte[] ReadBuffer = new byte[4096];
       private Process ffMpegDecoder = new Process();
       private Process NeroEncoder = new Process();
       private BinaryWriter NeroInput;

       //Create WAV temp file for testing
       private Stream s = new FileStream("D:\\test\\test.wav", FileMode.Create);
       private BinaryWriter outfile;

       public void Encode()
       {
           ProcessStartInfo ffMpegPSI = new ProcessStartInfo("ffmpeg.exe", "-i D:\\test\\test.mp3 -f wav -");
           ffMpegPSI.UseShellExecute = false;
           ffMpegPSI.CreateNoWindow = true;
           ffMpegPSI.RedirectStandardOutput = true;
           ffMpegPSI.RedirectStandardError = true;
           ffMpegDecoder.StartInfo = ffMpegPSI;

           ProcessStartInfo NeroPSI = new ProcessStartInfo("neroAacEnc.exe", "-if - -ignorelength -of D:\\test\\test.m4a");
           NeroPSI.UseShellExecute = false;
           NeroPSI.CreateNoWindow = true;
           NeroPSI.RedirectStandardInput = true;
           NeroPSI.RedirectStandardError = true;
           NeroEncoder.StartInfo = NeroPSI;

           ffMpegDecoder.Exited += new EventHandler(ffMpegDecoder_Exited);
           ffMpegDecoder.ErrorDataReceived += new DataReceivedEventHandler(ffMpegDecoder_ErrorDataReceived);
           ffMpegDecoder.Start();

           NeroEncoder.Start();
           NeroInput = new BinaryWriter(NeroEncoder.StandardInput.BaseStream);

           outfile = new BinaryWriter(s);

           ffMpegDecoder.StandardOutput.BaseStream.BeginRead(ReadBuffer, 0, ReadBuffer.Length, new AsyncCallback(ReadCallBack), null);

       }

       private void ReadCallBack(IAsyncResult asyncResult)
       {
           int read = ffMpegDecoder.StandardOutput.BaseStream.EndRead(asyncResult);
           if (read > 0)
           {

               NeroInput.Write(ReadBuffer);
               NeroInput.Flush();

               outfile.Write(ReadBuffer);
               outfile.Flush();

               ffMpegDecoder.StandardOutput.BaseStream.Flush();

               ffMpegDecoder.StandardOutput.BaseStream.BeginRead(ReadBuffer, 0, ReadBuffer.Length, new AsyncCallback(ReadCallBack), null);
           }
           else
           {
               ffMpegDecoder.StandardOutput.BaseStream.Close();
               outfile.Close();
           }

       }

       private void ffMpegDecoder_Exited(object sender, System.EventArgs e)
       {
           Console.WriteLine("Exit");
       }

       private void ffMpegDecoder_ErrorDataReceived(object sender, DataReceivedEventArgs errLine)
       {
           Console.WriteLine("Error");
       }

    }
  • FFmpeg library drops frame in mp4 video using filter 'fps' or 'framerate'

    28 juin 2019, par Dzmitry

    After decoding/encoding original mp4 video with fps 25 I’ve gotten video with fps 25 bui if I set video filter fps=fps=25 then last frame drops and I get the following result (AV_LOG_TRACE) :

    ...
    [Parsed_fps_0 @ 0x7f8f2c735f80] fps=25/1
    [Parsed_fps_0 @ 0x7f8f2c735f80] Read frame with in pts 1024, out pts 2
    [Parsed_fps_0 @ 0x7f8f2c735f80] Read frame with in pts 1536, out pts 3
    [Parsed_fps_0 @ 0x7f8f2c735f80] Set first pts to 2
    [Parsed_fps_0 @ 0x7f8f2c735f80] Writing frame with pts 2 to pts 2
    [Parsed_fps_0 @ 0x7f8f2c735f80] Read frame with in pts 2048, out pts 4
    [Parsed_fps_0 @ 0x7f8f2c735f80] Writing frame with pts 3 to pts 3
    [Parsed_fps_0 @ 0x7f8f2c735f80] Read frame with in pts 2560, out pts 5
    [Parsed_fps_0 @ 0x7f8f2c735f80] Writing frame with pts 4 to pts 4
    ...
    [Parsed_fps_0 @ 0x7f8f2c735f80] Read frame with in pts 90624, out pts 177
    [Parsed_fps_0 @ 0x7f8f2c735f80] Writing frame with pts 176 to pts 176
    [Parsed_fps_0 @ 0x7f8f2c735f80] Read frame with in pts 91136, out pts 178
    [Parsed_fps_0 @ 0x7f8f2c735f80] Writing frame with pts 177 to pts 177
    [Parsed_fps_0 @ 0x7f8f2c735f80] Dropping frame with pts 178
    [Parsed_fps_0 @ 0x7f8f2c735f80] 177 frames in, 176 frames out; 1 frames dropped, 0 frames duplicated.

    I’ve tried to set input/output options like these :

    //input
    av_dict_set(&amp;options, "r", "25", 0); //doesn't help
    avformat_open_input(&amp;pFormatContext, NULL, NULL, &amp;options);
    //input video graph filter fps
    ...
    // encoder
    AVOutputFormat* pOutputFormat = av_guess_format("mp4", NULL, NULL);
    AVFormatContext* pFormatContext = avformat_alloc_context();
    pFormatContext->oformat = pOutputFormat;
    AVStream* pVideoStream = avformat_new_stream(m_pFormatContext, NULL);

    AVCodec* pCodec = avcodec_find_encoder_by_name("libx264");
    AVCodecContext* pCodecContext = avcodec_alloc_context3(pCodec);
    pCodecContext->codec_id = pOutputFormat->video_codec;
    pCodecContext->codec_type = AVMEDIA_TYPE_VIDEO;
    pCodecContext->level = 51;
    pCodecContext->width = 800;
    pCodecContext->height = 600;
    pCodecContext->time_base = (AVRational) {1, 25};
    pCodecContext->framerate = av_inv_q(pCodecContext->time_base);
    pCodecContext->gop_size = 12;
    pCodecContext->max_b_frames = 1;
    pCodecContext->qcompress = 1.0f;
    pCodecContext->pix_fmt = AV_PIX_FMT_YUV420P;
    //...
    av_opt_set(pCodecContext->priv_data, "x264opts", "fps=25", 0); //doesn't help

    pVideoStream->time_base = pCodecContext->time_base;
    pVideoStream->avg_frame_rate = pCodecContext->framerate; //doesn't help
    // output
    av_dict_set(&amp;options, "r", "25", 0); //doesn't help
    avformat_write_header(m_pFormatContext, &amp;options);
    // flush decoder
    // flush filterbuffer and encoder
    av_write_trailer(pFormatContext);

    I’ve expected to get video with value 25 without drops frames.