Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (73)

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

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (7878)

  • cut hls files in to many small ".ts" files or keep one big ".ts" file. which is better ?

    5 août 2022, par Evan Lee

    I need to stream my videos using HLS bytes range HTTP requests.

    


    FFmpeg has an option to keep all the ts file to one single large ".ts" file.

    


    Any pros and cons of split the ts files or keep a big ts file ?

    


    Is a big ts file make the request slower ? because of HDD fseek is slow ?

    


  • FFmpeg "movflags" > "faststart" causes av_write_trailer() to return -2

    30 juin 2016, par williamtroup

    I’m setting up the format layout for the ideo as follows :

    AVOutputFormat* outputFormat = ffmpeg.av_guess_format(null, "output.mp4", null);

    AVCodec* videoCodec = ffmpeg.avcodec_find_encoder(outputFormat->video_codec);

    AVFormatContext* formatContext = ffmpeg.avformat_alloc_context();
    formatContext->oformat = outputFormat;
    formatContext->video_codec_id = videoCodec->id;

    ffmpeg.avformat_new_stream(formatContext, videoCodec);

    This is how I am setting up the Codec Context :

    AVCodecContext* codecContext = ffmpeg.avcodec_alloc_context3(videoCodec);
    codecContext->bit_rate = 400000;
    codecContext->width = 1280;
    codecContext->height = 720;
    codecContext->gop_size = 12;
    codecContext->max_b_frames = 1;
    codecContext->pix_fmt = videoCodec->pix_fmts[0];
    codecContext->codec_id = videoCodec->id;
    codecContext->codec_type = videoCodec->type;
    codecContext->time_base = new AVRational
    {
       num = 1,
       den = 30
    };

    I’m using the following code to setup the "movflags" > "faststart" option for the header of the video :

    AVDictionary* options = null;

    int result = ffmpeg.av_dict_set(&options, "movflags", "faststart", 0);

    int writeHeaderResult = ffmpeg.avformat_write_header(formatContext, &options);

    The file is opened and the header is written as follows :

    if ((formatContext->oformat->flags & ffmpeg.AVFMT_NOFILE) == 0)
    {
       int ioOptionResult = ffmpeg.avio_open(&formatContext->pb, "output.mp4", ffmpeg.AVIO_FLAG_WRITE);
    }

    int writeHeaderResult = ffmpeg.avformat_write_header(formatContext, &options);

    After this, I write each video frame as follows :

    outputFrame->pts = frameIndex;

    packet.flags |= ffmpeg.AV_PKT_FLAG_KEY;
    packet.pts = frameIndex;
    packet.dts = frameIndex;

    int encodedFrame = 0;
    int encodeVideoResult = ffmpeg.avcodec_encode_video2(codecContext, &packet, outputFrame, &encodedFrame);

    if (encodedFrame != 0)
    {
       packet.pts = ffmpeg.av_rescale_q(packet.pts, codecContext->time_base, m_videoStream->time_base);
       packet.dts = ffmpeg.av_rescale_q(packet.dts, codecContext->time_base, m_videoStream->time_base);
       packet.stream_index = m_videoStream->index;

       if (codecContext->coded_frame->key_frame > 0)
       {
           packet.flags |= ffmpeg.AV_PKT_FLAG_KEY;
       }

       int writeFrameResult = ffmpeg.av_interleaved_write_frame(formatContext, &packet);
    }

    After that, I write the trailer :

    int writeTrailerResult = ffmpeg.av_write_trailer(formatContext);

    However, writeTrailerResult is always -2. I’m been looking into this problem for days and cannot figure out what the problem is.

    The DLLs used for the AutoGen library are :

    avcodec-56.dll
    avdevice-56.dll
    avfilter-5.dll
    avformat-56.dll
    avutil-54.dll
    postproc-53.dll
    swresample-1.dll
    swscale-3.dll
  • Android : mp4 file plays when downloaded but when choosing "Video" player gets "Cannot play video"

    14 janvier 2014, par gview

    I've converted the video to an mp4 with ffmpeg using the h264 codec and AAC, and used the baseline profile.

    Videos are 540x360x250kbps

    I then ran qt-faststart on the file to move the atoms into the right order.

    I've stuck the file up on a wiki we use and created a link to it.

    My test phone is a Samsung Galaxy S3.

    When I browse to the page that has links to the mp4's on it, and I click on them, I get a popup window with 2 options : Internet and Video.

    If I download the videos using the "Internet" option, I can play them on the phone without issue.

    I've done other encodings with the main profile as well, and these also play fine. I thought that a powerful phone like the s3 would be able to handle the more advanced compression schemes available in h264, however I've also browsed the Android docs in regards to supported video formats, and it seems to state that only the "baseline" compression profile is supported.

    Regardless, what doesn't work is trying to use the "Video" option which I assume tries to stream the video.

    For the wiki in question, clicking on the link reveals that the content-type and content-length headers are being set :

    Content-Length  6175996
    Content-Type    video/mp4;charset=UTF-8

    Clicking on the link with a browser invokes a player (Quicktime in most cases) that can play the mp4's.

    Is there more to having the file HTTP streamable beyond making a link to it ? Why won't my Android 4 play these files ?

    UPDATE :
    I decided to make a quick HTML5 page using the video tag, and the videos do play on both my Galaxy S3 and the latest IOS.