Recherche avancée

Médias (0)

Mot : - Tags -/médias

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (50)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (6665)

  • ffmpeg/libav - how to wirte video files with valid pts

    9 mai 2017, par Kai Rohmer

    I’m currently trying the write out a real time rendered video into a h264 encoded file. After reading a lot of (mostly) old samples and the few class references they call a documentation, I manager to write my video file and I’m also able to read it. Unfortunately, I need some metadata for each frame but I’m not having a constant frame rate. So my intension was to start with the presentation timestamps to "frametime" during recoding. But after all I tried I get no pts while reading the the file (pts stays -9223372036854775808). Before wring a lot of code, here are the basics steps I’m doing. I’m probably using the wrong container or I’m missing to set a flag and you will notice it right away.

    // open a AVFormatContext
    avformat_alloc_output_context2(&m_FormatContext, nullptr, "avi", m_FileName.c_str());

    // open a stream
    m_VideoStream = avformat_new_stream(m_FormatContext, avcodec_find_encoder(AV_CODEC_ID_H264));

    // setup the codec context (including bitrate, frame size, ...)
    m_CodecContext = m_VideoStream ->codec;
    m_CodecContext->coder_type = FF_CODER_TYPE_VLC;
    m_CodecContext->time_base = AVRational{1, 120}; // I expect 20-60 Hz
    m_CodecContext->pix_fmt = AV_PIX_FMT_YUV420P;
    m_CodecContext->color_range = AVCOL_RANGE_JPEG;
    ...
    av_opt_set(m_CodecContext->priv_data, "preset", "ultrafast", 0);
    av_opt_set(m_CodecContext->priv_data, "tune", "zerolatency,fastdecode", 0);


    // set the same time_base to the stream
    m_VideoStream ->time_base = m_CodecContext->time_base;

    // open the codec
    avcodec_open2(m_CodecContext, m_CodecContext->codec, nullptr);

    // open file and write header
    avio_open(&m_FormatContext->pb, m_FileName.c_str(), AVIO_FLAG_WRITE);
    avformat_write_header(m_FormatContext, nullptr);

    // then in a loop:
    // render frame, convert RGBA to YUV frame, set the frames pts (timestamp is double application time in seconds)
    frameToEncode.pts = int64_t(timestamp / av_q2d(m_VideoStream->time_base));
    av_init_packet(m_EncodedPacket);
    avcodec_encode_video2(m_CodecContext, m_EncodedPacket, frameToEncode, &got_output);

    // check packet infos
    //m_EncodedPacket->pts equals frameToEncode.pts
    m_EncodedPacket->dts = AV_NOPTS_VALUE; // also tried incrementing numbers, or zero
    m_EncodedPacket->stream_index = m_Stream->index;
    m_EncodedPacket->duration = 0;
    m_EncodedPacket->pos = -1;
    m_EncodedPacket->flags = 0;
    m_EncodedPacket->flags |= AV_PKT_FLAG_KEY; // read that somewhere

    // write the packet to stream
    av_interleaved_write_frame(m_FormatContext, m_EncodedPacket);


    // after the loop
    // I encode delayed frames and write the trailer
    av_write_trailer(m_FormatContext);

    Thats pretty much it. I’m not getting what is missing. Since I have some meta data per frame I tried to add side data to each package but this data also disapered after reading from file. If decode the packets directly (instead of writing them to file, the data is there)

    I’m quite sure the problem is with the encoding. I managed to decode the big buck bunny movie in which case i got valid pts values.

    Thanks a lot for your help !

  • C# execute external program and capture (stream) the output

    22 mars 2017, par Roberto Correia

    I’m making a program to work with some video files.

    I’m using the ffmpeg executable to merge several files in a single file.
    This command takes several minutes to finish, so, I need a way to "monitor" the output, and show a progress bar on GUI.

    Looking at the following stackoverflow topics :

    I made this code :

    Process ffmpeg = new Process
    {
     StartInfo =
     {
       FileName = @"d:\tmp\ffmpeg.exe",
       Arguments = "-f concat -safe 0 -i __sync.txt -c copy output.mp4",
       UseShellExecute = false,
       RedirectStandardOutput = true,
       CreateNoWindow = true,
       WorkingDirectory = @"d:\tmp"
     }
    }

    ffmpeg.EnableRaisingEvents = true;
    ffmpeg.OutputDataReceived += (s, e) => Debug.WriteLine(e.Data);
    ffmpeg.ErrorDataReceived += (s, e) => Debug.WriteLine($@"Error: {e.Data}");
    ffmpeg.Start();
    ffmpeg.BeginOutputReadLine();
    ffmpeg.WaitForExit();

    When I run this code, the ffmpeg start to merge files, I can see the ffmpeg process on Windows Task Manager, and if I wait long enough, the ffmpeg finish the job without any error. But, the Debug.WriteLine(e.Data) is never called (no output on Debug window). Tried to change to Console.WriteLine too (again, no output).

    So, after this, I tried this another version :

    Process ffmpeg = new Process
    {
     StartInfo =
     {
       FileName = @"d:\tmp\ffmpeg.exe",
       Arguments = "-f concat -safe 0 -i __sync.txt -c copy output.mp4",
       UseShellExecute = false,
       RedirectStandardOutput = true,
       CreateNoWindow = true,
       WorkingDirectory = @"d:\tmp"
     }
    }

    ffmpeg.Start();
    while (!ffmpeg.StandardOutput.EndOfStream)
    {
     var line = ffmpeg.StandardOutput.ReadLine();
     System.Diagnostics.Debug.WriteLine(line);
     Console.WriteLine(line);
    }
    ffmpeg.WaitForExit();

    Again, the ffmpeg is started without any error, but the C# "hangs" on While (!ffmpeg.StandardOutput.EndOfStream) until ffmpeg is finished.

    If I execute the exact command on Windows prompt, a lot of output text is showed with progress of ffmpeg.

  • h264 : don’t sync pic_id between threads.

    3 avril 2017, par Ronald S. Bultje
    h264 : don’t sync pic_id between threads.
    

    This is how the ref list manager links bitstream IDs to H264Picture/Ref
    objects, and is local to the producer thread. There is no need for the
    consumer thread to know the bitstream IDs of its references in their
    respective producer threads.

    In practice, this fixes tsan warnings when running fate-h264 :

    WARNING : ThreadSanitizer : data race (pid=19295)
    Read of size 4 at 0x7dbc0000e614 by main thread (mutexes : write M1914) :
    #0 ff_h264_ref_picture src/libavcodec/h264_picture.c:112 (ffmpeg+0x0000013b3709)
    [..]
    Previous write of size 4 at 0x7dbc0000e614 by thread T2 (mutexes : write M1917) :
    #0 build_def_list src/libavcodec/h264_refs.c:91 (ffmpeg+0x0000013b46cf)

    • [DH] libavcodec/h264_picture.c