Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (54)

  • 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

  • L’utiliser, en parler, le critiquer

    10 avril 2011

    La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
    Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
    Une liste de discussion est disponible pour tout échange entre utilisateurs.

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

Sur d’autres sites (11350)

  • Filesize difference between ffmpeg command line and C API

    31 mars 2021, par Vuwox

    While using following ffmpeg command :

    


    ffmpeg -framerate 12 -pattern_type glob -i 'FRAMES/frame_*.tif' -map 0:v test_binffmpeg.mp4


    


    It uses the default H.264 parameters which are preset=medium and crf=23. This generates a filesize with bit_rate = 1358 kb/s and size = 1659kb.

    


    But by using my own code to encode an mp4 video (using the exact same images), I then have a video around bit_rate = 3929 kb/s and size = 4757kb.

    


    In my code, I leave the codec options to default, and even if I try to overwrite with preset=medium + crf=23, I still have the same size of 4757kb. Im wondering what am I missing ?

    


    My muxer initialization looks like the following :

    


        // Search for the output format based on the file name.
    AVOutputFormat* oformat = av_guess_format(nullptr, m_filename.c_str(), nullptr);
    if ( !oformat ) return false;

    // Allocate the context based on that format
    _ret = avformat_alloc_output_context2(&m_ofmt_ctx, oformat, nullptr, m_filename.c_str());
    if ( _ret ) return false;

    // Get the codec appropriate to that format
    // and be able to set some parameter to that codec.
    AVCodec* codec = avcodec_find_encoder(oformat->video_codec);
    if ( !codec ) return false;

#if _DEBUG
    printf("Codec name: %s\n", avcodec_get_name(codec->id));
    const AVPixelFormat* p = codec->pix_fmts;
    while ( p != NULL && *p != AV_PIX_FMT_NONE )
    {
        printf("supported pix fmt: %s\n", av_get_pix_fmt_name(*p));
        ++p;
    }
#endif

    // Prepare stream/context according to above variable (codec/format).
    AVStream* stream = avformat_new_stream(m_ofmt_ctx, codec);
    if ( !stream ) return false;

    // Allocate the context for that codec.
    m_o_codec_ctx = avcodec_alloc_context3(codec);
    if ( !m_o_codec_ctx ) return false;        

    // Setup the 'global' parameter for the codec (Size, color format, etc)
    stream->codecpar->codec_id = codec->id;
    stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
    stream->codecpar->width = m_width;
    stream->codecpar->height = m_height;
    stream->codecpar->format = AV_PIX_FMT_YUV444P;

    // Assign the global parameter to the context.
    avcodec_parameters_to_context(m_o_codec_ctx, stream->codecpar);

    // Set the framerate.
    m_o_codec_ctx->time_base = { 1, m_framerate };

#if 0 // We can enable this, but it still the default parameters anyway.
    if ( (_ret = av_dict_set(&m_options_dict, "preset", "medium", 0)) < 0 )
        return false;

    if ( (_ret = av_dict_set(&m_options_dict, "crf", "23.0", 0)) < 0 )
        return false;
#endif
    
    avcodec_parameters_from_context(stream->codecpar, m_o_codec_ctx);

    // Open the file and write the header.
    if ( (_ret = avcodec_open2(m_o_codec_ctx, codec, &m_options_dict)) < 0 )
        return false;

    if ( (_ret = avio_open(&m_ofmt_ctx->pb, m_filename.c_str(), AVIO_FLAG_WRITE)) < 0 )
        return false;

    if ( (_ret = avformat_write_header(m_ofmt_ctx, &options_dict)) < 0 )
        return false;

#if _DEBUG
    // This print the stream/output format.
    av_dump_format(m_ofmt_ctx, 0, m_filename.c_str(), 1);
#endif

    // Define the pts increment (the time to the next frame).
    if ( m_ofmt_ctx && m_ofmt_ctx->nb_streams > 0 )
        m_pts_increment = av_rescale_q(1, m_o_codec_ctx->time_base, m_ofmt_ctx->streams[0]->time_base);
    else
       return false;
       
   return true;


    


    EDIT :

    


    As requested user llogan in comment, I provide the ffmpeg -i test_binffmpeg.mp4 -i test_apiffmpeg.mp4 output :

    


    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_binffmpeg.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.77.100
  Duration: 00:00:10.00, start: 0.000000, bitrate: 1358 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 1080x1080 [SAR 1:1 DAR 1:1], 1356 kb/s, 12 fps, 12 tbr, 12288 tbn, 24 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'test_apiffmpeg.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.77.100
  Duration: 00:00:09.92, start: 0.000000, bitrate: 3929 kb/s
    Stream #1:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 1080x1080, 3927 kb/s, 12.10 fps, 12 tbr, 90k tbn, 24 tbc (default)


    


    EDIT2 :

    


    I noticed that while using ffprobe over both video I have the following difference :

    


    Params=Bin value ; API value
codec_time_base=1/24;119/2880
avg_frame_rate=12/1;1440/119


    


    Why I have this 119 ? I know that I have 120 frames, and the ffprobe is telling me both file have nb_frames=120.

    


    EDIT3

    


    By modifying the following code :

    


    // Predefine the frame-rate to enforce that usage.
stream->time_base = AVRational{ 1, m_framerate };
stream->r_frame_rate = AVRational{ m_framerate ,1 };
stream->avg_frame_rate = AVRational{ m_framerate ,1 };

// Assign the global parameter to the context.
avcodec_parameters_to_context(m_o_codec_ctx, stream->codecpar);

// Set the framerate.
m_o_codec_ctx->time_base = AVRational{ 1, m_framerate };
m_o_codec_ctx->framerate = AVRational{ m_framerate,  1 };


    


    I was able to enforce the framerate and the above ffprobe informations are now correct, but still have problem with bitrate/filesize.

    


    After investigation, and looking into the logs, I saw that for command line, I have AVG QP around 16-22, and by using the API, I have AVG QP 7-11, which leads to big difference in quantization, and giving for sure a difference in bitrate.

    


    I tried to set -qmin -qmax in my API, and I was able to get something nearby there result, but still different. How can I explain that ?

    


  • Difference in number of channels returned by mediainfo and ffprob

    16 mars 2021, par Hai Tran

    I was examining an audio file and noticed that the numbers of channels returned by mediainfo and ffprobe were different.

    


    The mediainfo command :

    


    mediainfo audio.mp4


    


    The ffprobe command (see the channels value) :

    


    ffprobe -i audio.mp4 -show_streams


    


    Does anyone know what's happening ?
Here is the audio file for your own test.

    


  • Revision 6fb418741f : Inline xform_quant() in encode_block_intra(). Also inline some of the block cal

    11 juillet 2013, par Ronald S. Bultje

    Changed Paths :
     Modify /vp9/encoder/vp9_encodemb.c



    Inline xform_quant() in encode_block_intra().

    Also inline some of the block calculations to assist the compiler to
    not do silly things like calculating the same offset (or converting
    between raster/transform block offset or block, mi and pixel unit)
    many, many, many times.

    Cycle times :
    4x4 : 584 -> 505 cycles (16% faster)
    8x8 : 1651 -> 1560 cycles (6% faster)
    16x16 : 7897 -> 7704 cycles (2.5% faster)
    32x32 : 16096 -> 15852 cycles (1.5% faster)

    Overall, this saves about 0.5 seconds (1min49.8 -> 1min49.3) on the
    first 50 frames of bus (speed 0) @ 1500kbps, i.e. 0.5% overall.

    Change-Id : If3dd62453f8e2ab9d4ee616bc4ea956fb8874b80