Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (41)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (4583)

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

  • HLS MP4 Independent Segments

    7 décembre 2016, par Mido

    Long story short : Why HLS can’t just play normal MP4 files together one after one ? Why need to segment media file into .ts segments ?

    Details :

    We’ve segmented MP4 file into mini MP4 segments (not TS), each one about 30 seconds for testing. It never plays in any HLS player, just loading all segment files then nothing happens.

    Example MP4 segment Info :

    Format                      : MPEG-4
    Format profile              : Base Media
    Codec ID                    : isom
    File size                   : 1.44 MiB
    Duration                    : 32s 950ms
    Overall bit rate            : 366 Kbps
    Writing application         : Lavf56.25.101

    Video
    ID                          : 1
    Format                      : AVC
    Format/Info                 : Advanced Video Codec
    Format profile              : High@L4.1
    Format settings, CABAC      : Yes
    Format settings, ReFrames   : 6 frames
    Codec ID                    : avc1
    Codec ID/Info               : Advanced Video Coding
    Duration                    : 32s 950ms
    Bit rate                    : 230 Kbps
    Width                       : 426 pixels
    Height                      : 240 pixels
    Display aspect ratio        : 16:9
    Original display aspect rat : 16:9
    Frame rate mode             : Constant
    Frame rate                  : 23.976 fps
    Color space                 : YUV
    Chroma subsampling          : 4:2:0
    Bit depth                   : 8 bits
    Scan type                   : Progressive
    Bits/(Pixel*Frame)          : 0.094
    Stream size                 : 925 KiB (63%)
    Writing library             : x264 core 142 r2495 6a301b6

    Audio
    ID                          : 2
    Format                      : AAC
    Format/Info                 : Advanced Audio Codec
    Format profile              : LC
    Codec ID                    : 40
    Duration                    : 32s 896ms
    Bit rate mode               : Constant
    Bit rate                    : 129 Kbps
    Channel(s)                  : 2 channels
    Channel(s)_Original         : 6 channels
    Channel positions           : Front: L C R, Side: L R, LFE
    Sampling rate               : 48.0 KHz
    Compression mode            : Lossy
    Stream size                 : 517 KiB (35%)

    The Master M3U8 :

    #EXTM3U
    #EXT-X-VERSION:7
    #EXT-X-INDEPENDENT-SEGMENTS

    #EXT-X-STREAM-INF:RESOLUTION=426x240,BANDWIDTH=370000,CODECS="avc1.640015,mp4a.40.2"
    240p.m3u8

    #EXT-X-STREAM-INF:RESOLUTION=640x360,BANDWIDTH=580000,CODECS="avc1.640015,mp4a.40.2"
    360p.m3u8

    #EXT-X-STREAM-INF:RESOLUTION=896x504,BANDWIDTH=900000,CODECS="avc1.640015,mp4a.40.2"
    480p.m3u8

    #EXT-X-STREAM-INF:RESOLUTION=1280x720,BANDWIDTH=1500000,CODECS="avc1.640015,mp4a.40.2"
    720p.m3u8

    240p.m3u8

    #EXTM3U
    #EXT-X-VERSION:7
    #EXT-X-MEDIA-SEQUENCE:0
    #EXT-X-PLAYLIST-TYPE:VOD
    #EXT-X-TARGETDURATION:34

    #EXTINF:33.033033,
    240p000.mp4
    #EXTINF:33.533534,
    240p001.mp4
    #EXTINF:24.941608,
    240p002.mp4
    #EXTINF:28.611945,
    240p003.mp4
    #EXT-X-ENDLIST

    When tested with HLS.js, gives this error :

    Parsing Error:no demux matching with content found,cannot recover,
    last media error recovery failed ...

    Bitmovin Player : loads all segments of all variants and never plays any of them. just stop.

    Tested on Chrome & Firefox On Windows, Safari on Mac, Android and iPad Browsers. Never works on any of them. Are we doing anything wrong ?!