Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (77)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    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 (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

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

Sur d’autres sites (8979)

  • How to write a unit test class that creates a new process in C#

    12 mars 2023, par IceAge

    I have a question about how to write unit test method that creates a new process.

    


    At the moment I write a normal unit test to create a process, but it's very difficult to setup.

    


    This is my code I want to test.

    


    using System;&#xA;using System.Collections.Generic;&#xA;using System.Diagnostics;&#xA;using System.IO;&#xA;using System.Linq;&#xA;using System.Text;&#xA;using System.Text.RegularExpressions;&#xA;using System.Threading.Tasks;&#xA;&#xA;namespace xxx&#xA;{&#xA;    public class FFmPeg&#xA;    {&#xA;        private Process _process;&#xA;        private string ffmpegPath { get; set; }&#xA;        private Regex _durationRegex;&#xA;&#xA;        public event EventHandler<string> OutputData;&#xA;        public event EventHandler<int> ProgressChange;&#xA;&#xA;        public FFmPeg()&#xA;        {&#xA;            _process = new Process();&#xA;            ffmpegPath = Path.Combine(Directory.GetCurrentDirectory(), "engine", "ffmpeg.exe");&#xA;        }&#xA;&#xA;        public void Run(string Argument)&#xA;        {&#xA;            _process.StartInfo.FileName = ffmpegPath;&#xA;            _process.StartInfo.Arguments = $"{Argument} -y";&#xA;            _process.StartInfo.UseShellExecute = false;&#xA;            _process.StartInfo.RedirectStandardOutput = true;&#xA;            _process.StartInfo.RedirectStandardError = true;&#xA;            _process.StartInfo.StandardOutputEncoding = Encoding.UTF8;&#xA;            _process.StartInfo.CreateNoWindow = true;&#xA;            _process.OutputDataReceived &#x2B;=(o,e) =>&#xA;                     {&#xA;                     };&#xA;            _process.ErrorDataReceived &#x2B;= (o, e) =>&#xA;            {&#xA;                if (string.IsNullOrEmpty(e.Data) == false)&#xA;                {&#xA;                    OnProgressChange(OutputExtractor.GetProgress(e.Data));&#xA;                }//end if.check data is not empty&#xA;            };&#xA;&#xA;            _process.Start();&#xA;            _process.BeginOutputReadLine();&#xA;            _process.BeginErrorReadLine();&#xA;            _process.WaitForExit();&#xA;        } //end method&#xA;&#xA;        protected virtual void OnProgressChange(int progress)&#xA;        {&#xA;            ProgressChange?.Invoke(this,progress);&#xA;        } //end method&#xA;&#xA;        protected virtual void OnOutputData(string data)&#xA;        {&#xA;            OutputData?.Invoke(this, data);&#xA;        }&#xA;    }&#xA;}&#xA;</int></string>

    &#xA;

    Thanks for any helpful answers, and sorry for my English.

    &#xA;

  • RMPT Stream Startup Dalay on FFMPEG and Gstreamer compared to OBS

    24 mars 2023, par Arruda

    I'm trying to use ffmpeg to stream a video into my RTMP server.&#xA;The problem I'm having right now is that FFMPEG seems to take a long time to start streaming the output (from what I see in my Oven Media Engine server).

    &#xA;

    At the same time, when I use OBS Studio my stream starts almost immediately.&#xA;I also tried using Gstreamer, and got the same amount of delay when using FFMPEG.

    &#xA;

    After a long process, I finally saw that if I added an empty audio track, then FFMPEG would start as quickly as OBS.

    &#xA;

    This is my final FFMPEG command (using the empty audio track) :

    &#xA;

    ffmpeg -f v4l2 -i /dev/video0 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -profile:v main -pix_fmt yuv420p -preset ultrafast -tune zerolatency -vcodec libx264 -r 10 -g 10 -keyint_min 10 -sc_threshold 0 -b:v 2000k -maxrate 2000k -bufsize 2000k -s 768x432 -acodec aac  -f flv rtmp://localhost:1935/app/mystream&#xA;

    &#xA;

    I'm streaming my webcam at 768x432, at 10FPS.

    &#xA;

    Now, is this a bad solution in the case where there is no need for an audio in the output video ?

    &#xA;

    There is no problem, nor noticible delay in the videstream if I remove the audio, the only downside is the startup time that is about 30-40 seconds.

    &#xA;

    Is this delay when not using a audio track a FFMPEG issue ? or is this related to how the Oven Media Engine ingest the RTMP stream ?

    &#xA;

  • FFMPEG C++ API audio/video sync, video is longer [closed]

    11 mai 2023, par Gábor Gombor

    I create a video from frames in C++ with a given FPS and supply it to FFMPEG API. I record from an Unreal engine viewport and feed FFMPEG with the images. In this interval I have also an audio track in FLAC which I want sync with the video. When the music ends, I close the video and merge them, but the final video has sync problems, the video is a little bit longer than the audio, so I will have an increasing delay. For example I record 0:55 secs, the audio is ok=same length, but the video from frames will be 0:56 secs.

    &#xA;

    I think the following code is problematic :

    &#xA;

    bool MyVideoExporter::writeFrame(OutputStream* oStream, AVFrame* frame, int&amp; framePTS)&#xA;{&#xA;    auto* packet = oStream->pkt->pkt;&#xA;    auto* codecContext = oStream->enc->codecContext;&#xA;&#xA;    frame->pts = framePTS;&#xA;    frame->pkt_dts = frame->pts;&#xA;&#xA;    auto ret = avcodec_send_frame(codecContext, frame);&#xA;    if (ret >= 0) {&#xA;        auto retVal = 0;&#xA;        while (retVal >= 0) {&#xA;            retVal = avcodec_receive_packet(codecContext, packet);&#xA;            if (retVal == AVERROR(EAGAIN) || retVal == AVERROR_EOF) break;&#xA;            else if (retVal &lt; 0) {&#xA;                return false;&#xA;            }&#xA;&#xA;            // rescale to audio, usually 1/44100&#xA;            av_packet_rescale_ts(packet, m_audiotimestamp, oStream->st->time_base);&#xA;            // rescale to FPS, usually 1/30 or 1/60&#xA;            av_packet_rescale_ts(packet, codecContext->time_base, oStream->st->time_base);&#xA;&#xA;            packet->stream_index = oStream->st->index;&#xA;&#xA;            retVal = av_interleaved_write_frame(m_avFormatContext.avFormatContext, packet);&#xA;            if (retVal &lt; 0) {&#xA;                return false;&#xA;            }&#xA;&#xA;            framePTS&#x2B;&#x2B;;&#xA;        }&#xA;&#xA;        return retVal == AVERROR_EOF;&#xA;    }&#xA;&#xA;    return false;&#xA;}&#xA;&#xA;

    &#xA;

    Any idea what is wrong ?

    &#xA;

    I tried change the order of av_packet_rescale_ts lines or move the frame increase code to another places, but getting far worse results.

    &#xA;