Recherche avancée

Médias (91)

Autres articles (34)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (3878)

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

    


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

    


    var cEngine = new ClientEngine();

var manager = await cEngine.AddStreamingAsync(GenerateMagnet(torrent), ) ?? throw new Exception("An error occurred while creating the torrent manager");

await manager.StartAsync();
await manager.WaitForMetadataAsync();

var videoFile = manager.Files.OrderByDescending(f => f.Length).FirstOrDefault();
if (videoFile == null)
    return Results.NotFound();

var stream = await manager.StreamProvider!.CreateStreamAsync(videoFile, true);
return Results.File(stream, contentType: "video/mp4", fileDownloadName: manager.Name, enableRangeProcessing: true);


    


    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.

    


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

    


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


    


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

    


  • 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++

  • avformat/matroskadec : Check min_luminance more thoroughly

    16 février 2021, par Andreas Rheinhardt
    avformat/matroskadec : Check min_luminance more thoroughly
    

    In the absence of an explicitly coded minimal luminance, the current
    code inferred it to be -1, an invalid value. Yet it did not check the
    value lateron at all, so that if a valid maximum luminance is
    encountered, but no minimal luminance, an invalid minimal luminance of
    - 1 is exported. If an minimal luminance element with a negative value is
    present, it is exported, too. This can be simply fixed by adding a check
    for the value of the element.

    Yet given that a minimal luminance of zero Cd/m² is legal and can be
    coded with a length of zero, we must not use a fake default value to
    find out whether the element is present or not. Therefore this patch
    uses an explicit counter for it.

    While just at it, also check for max_luminance > min_luminance.

    Reviewed-by : Ridley Combs <rcombs@rcombs.me>
    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavformat/matroskadec.c