Recherche avancée

Médias (0)

Mot : - Tags -/inscription3

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

Autres articles (47)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

  • Contribute to translation

    13 avril 2011

    You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
    To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
    MediaSPIP is currently available in French and English (...)

Sur d’autres sites (6843)

  • Send MP3 audio extracted from m3u8 stream to IBM Watson Speech To Text

    20 novembre 2018, par Link69

    I’m extracting audio in MP3 format from a M3U8 live url and the final goal is to send the live audio stream to IBM Watson Speech To Text. The m3u8 is obtained by calling an external script via a Process. Then I use FFMPEG script to get the audio in stdout. It works if I save the audio in a file but I don’t want to save the extracted audio, I need to send the datas directly to the STT service. So far I proceeded like this :

    SpeechToTextService speechToTextService = new SpeechToTextService(sttUsername, sttPassword);
    string m3u8Url = "https://something.m3u8";
    char[] buffer = new char[48000];
    Process ffmpeg = new ProcessHelper(@"ffmpeg\ffmpeg.exe", $"-v 0 -i {m3u8Url} -acodec mp3 -ac 2 -ar 48000 -f mp3 -");

    ffmpeg.Start();
    int count;
    while ((count = ffmpeg.StandardOutput.Read(buffer, 0, 48000)) > 0)
    {
       ffmpeg.StandardOutput.Read(buffer, 0, 48000);
       var answer = speechToTextService.RecognizeSessionless(
           audio: buffer.Select(c => (byte)c).ToArray(),
           contentType: "audio/mpeg",
           smartFormatting: true,
           speakerLabels: false,
           model: "en-US_BroadbandModel"
       );
       // Get answer.ResponseJson, deserializing, clean buffer, etc...
    }

    When requesting the transcribed audio I’m getting this error :

    An unhandled exception of type 'System.AggregateException' occurred in IBM.WatsonDeveloperCloud.SpeechToText.v1.dll: 'One or more errors occurred. (The API query failed with status code BadRequest: Bad Request | x-global-transaction-id: bd6cd203720a70d83b9a03451fe28973 | X-DP-Watson-Tran-ID: bd6cd203720a70d83b9a03451fe28973)'
    Inner exceptions found, see $exception in variables window for more details.
    Innermost exception     IBM.WatsonDeveloperCloud.Http.Exceptions.ServiceResponseException : The API query failed with status code BadRequest: Bad Request | x-global-transaction-id: bd6cd203720a70d83b9a03451fe28973 | X-DP-Watson-Tran-ID: bd6cd203720a70d83b9a03451fe28973
      at IBM.WatsonDeveloperCloud.Http.Filters.ErrorFilter.OnResponse(IResponse response, HttpResponseMessage responseMessage)
      at IBM.WatsonDeveloperCloud.Http.Request.<getresponse>d__30.MoveNext()
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at IBM.WatsonDeveloperCloud.Http.Request.<asmessage>d__23.MoveNext()
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at IBM.WatsonDeveloperCloud.Http.Request.<as>d__24`1.MoveNext()
    </as></asmessage></getresponse>

    ProcessHelper is just for convenience :

    class ProcessHelper : Process
    {
       private string command;
       private string arguments;
       public ProcessHelper(string command, string arguments, bool redirectStandardOutput = true)
       {
           this.command = command;
           this.arguments = arguments;
           StartInfo = new ProcessStartInfo()
           {
               FileName = this.command,
               Arguments = this.arguments,
               UseShellExecute = false,
               RedirectStandardOutput = redirectStandardOutput,
               CreateNoWindow = true
           };
       }
    }

    Pretty sure I’m doing it wrong, I’d love someone to shine a light on this. Thanks.

  • How to convert a Stream on the fly with FFMpegCore ?

    18 octobre 2023, par Adrian

    For a school project, I need to stream videos that I get from torrents while they are downloading on the server.&#xA;When the video is a .mp4 file, there's no problem, but I must also be able to stream .mkv files, and for that I need to convert them into .mp4 before sending them to the client, and I can't find a way to convert my Stream that I get from MonoTorrents with FFMpegCore into a Stream that I can send to my client.

    &#xA;

    Here is the code I wrote to simply download and stream my torrent :

    &#xA;

    var cEngine = new ClientEngine();&#xA;&#xA;var manager = await cEngine.AddStreamingAsync(GenerateMagnet(torrent), ) ?? throw new Exception("An error occurred while creating the torrent manager");&#xA;&#xA;await manager.StartAsync();&#xA;await manager.WaitForMetadataAsync();&#xA;&#xA;var videoFile = manager.Files.OrderByDescending(f => f.Length).FirstOrDefault();&#xA;if (videoFile == null)&#xA;    return Results.NotFound();&#xA;&#xA;var stream = await manager.StreamProvider!.CreateStreamAsync(videoFile, true);&#xA;return Results.File(stream, contentType: "video/mp4", fileDownloadName: manager.Name, enableRangeProcessing: true);&#xA;

    &#xA;

    I saw that the most common way to convert videos is by using ffmpeg. .NET has a package called FFMpefCore that is a wrapper for ffmpeg.

    &#xA;

    To my previous code, I would add right before the return :

    &#xA;

    if (!videoFile.Path.EndsWith(".mp4"))&#xA;{&#xA;    var outputStream = new MemoryStream();&#xA;    FFMpegArguments&#xA;        .FromPipeInput(new StreamPipeSource(stream), options =>&#xA;        {&#xA;            options.ForceFormat("mp4");&#xA;        })&#xA;        .OutputToPipe(new StreamPipeSink(outputStream))&#xA;        .ProcessAsynchronously();&#xA;    return Results.File(outputStream, contentType: "video/mp4", fileDownloadName: manager.Name, enableRangeProcessing: true);&#xA;}&#xA;

    &#xA;

    I unfortunately can't get a "live" Stream to send to my client.

    &#xA;

  • Find video resolution and video duration of remote mediafile

    22 février 2012, par osgx

    I want to write an program which can find some metainformation of mediafile. I'm interested in popular video formats, such as avi, mkv, mp4, mov (may be other popular too). I want basically to get :

    • Video size (720, 1080, 360 etc)
    • Total runtime of video (may be not very exact)
    • Number of audio streams
    • Name of video codec
    • Name of audio codec

    There is already the mediainfo, but in my program I want to get information about remote file, which may be accessed via ftp, http, samba ; or even torrent (there are some torrent solutions, which allows to read not-yet downloaded file).

    MediaInfo library have no support of samba (smb ://) and mkv format (for runtime).

    Also, I want to know, how much data should be downloaded to get this information. I want not to download full videofile because I have no enough disk space.

    Is this information in the first 1 or 10 or 100 KiloBytes of the file ? Is it at predictable offset if I know the container name and total file size ?

    PS : Platform is Linux, Language is C/C++