Recherche avancée

Médias (0)

Mot : - Tags -/optimisation

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

Autres articles (56)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Soumettre améliorations et plugins supplémentaires

    10 avril 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (5354)

  • Compiling ffmpeg with emscripten

    18 septembre 2018, par noel

    I’m trying to compile ffmpeg into javascript so that I can decode H264 video streams using node. The streams are H264 frames packed into RTP NALUs so any solution has to be able to accept H264 frames rather than a whole file name.

    I found the Broadway.js library, but I couldn’t get it working and it doesn’t handle P-frames which I need. I also found ffmpeg.js, but could get that to work and it needs a whole file not a stream. Likewise, fluent-ffmpeg doesn’t appear to support file streams ; all of the examples show a filename being passed to the constructor. So I decided to write my own API.

    I have been able to compile ffmpeg into one big js file, but I can’t use it like that. I want to write an API around ffmpeg and then expose those functions to JS. So it seems to me like I need to do the following :

    1. Compile ffmpeg components (avcodec, avutil, etc.) into llvm bitcode.
    2. Write a C wrapper that exposes the decoding functionality and uses EMSCRIPTEN_KEEPALIVE.
    3. Use emcc to compile the wrapper and link it to the bitcode created in step 1.

    I found WASM+ffmpeg, but it’s in Chinese and some of the steps aren’t clear. In particular there is this step :

    emcc web.c process.c ../lib/libavformat.bc ../lib/libavcodec.bc ../lib/libswscale.bc ../lib/libswresample.bc ../lib/libavutil.bc \

    I don’t understand how all the ffmpeg components get compiled into separate *.bc files. I followed the emmake commands in that article and I end up with one big .bc file.

    Does anyone know the steps to compile ffmpeg using emscripten so that I can expose some API to javascript ?

    Is there a better way (with decent documentation) to decode h264 video streams using node ?

  • Blu Ray pre-encoding

    29 mai 2014, par user1122069

    I am working on authoring many Blu Ray disc images. I was wondering if there was a way to pre-encode video to MPEG-2 so that this process could run unattended overnight and over many days. I have already found that by importing the movie file on a Blu Ray image causes Toast to skip the encoding step.

    Does anyone familiar with FFMPEG and Blu Ray know what command to use ? Or suggest another free application. It should be the same as would be ready to import to a disc with remuxixing or multiplexing, etc. I can fine tune it to match the VBR settings on Toast and post the result here also if it works (saves the time to encode).

    I have about 50 1 hour videos to encode.

  • FFMPEG ignores encoding level parameter

    2 juillet 2023, par jakebird451

    I need to be able to encode video to a specific profile-level-id in accordance to a negotiated session via WebRTC. I can readily change the profile via code, however, I have not been able to change the level. I am using the hardware encoder on the RaspberryPi 4, which uses a BCM2835 via Video4Linux2 drivers. By default, the driver is leaving the encoding level set to level 4, which I can verify by taking a sample I am generating with the encoder and running the command mediainfo sample.h264 | grep profile over the sample. Everything I have tried has been setting the level back to the default level 4 encoding.

    


    The code below is ffmpeg-next, an ffmpeg wrapper in rust. All the commands can be traced back to C api calls for ffmpeg.

    


    pub fn create_encoder() -> ffmpeg_next::codec::encoder::video::Video {&#xA;    let codec = ffmpeg_next::encoder::find_by_name("h264_v4l2m2m").unwrap();&#xA;    let ctx = new_context_from(codec).encoder();&#xA;    let mut ctx = ctx.video().unwrap();&#xA;    ctx.set_width(1280);&#xA;    ctx.set_height(720);&#xA;    ctx.set_format(ffmpeg_next::format::pixel::Pixel::YUV420P);&#xA;    let fps = ffmpeg_next::Rational::new(30, 1);&#xA;    let tb = fps.invert();&#xA;    ctx.set_frame_rate(Some(fps));&#xA;    ctx.set_time_base(tb);&#xA;    ctx.set_bit_rate(4_000_000);&#xA;    ctx.set_max_bit_rate(4_000_000);&#xA;    ctx.set_aspect_ratio(ffmpeg_next::util::rational::Rational(16, 9));&#xA;    ctx.set_flags(ffmpeg_next::codec::Flags::GLOBAL_HEADER);&#xA;    ctx.set_gop(0);&#xA;    ctx.set_max_b_frames(0);&#xA;&#xA;    // ----- Below here is my attempt to set profile and level -----&#xA;    // Below modifies `compression_level`, but tried it as well just in case&#xA;    ctx.set_compression(Some(9)); // Does not work (tried 9 &amp; 31)&#xA;    unsafe {&#xA;        let mut p = ctx.as_mut_ptr();&#xA;        (*p).profile = FF_PROFILE_H264_HIGH; // &lt;-- Changing this will change the profile (works)&#xA;        (*p).level = 9; // Does not work (tried 9 &amp; 31)&#xA;    }&#xA;&#xA;    // Does not work (Errors with OptionNotFound)&#xA;    if let Err(e) = video_opt_set(&amp;mut ctx, "level", "9", 0) {&#xA;        log::warn!("Could not set the level: {:?}", e);&#xA;    }&#xA;&#xA;    // Does not work (Errors with OptionNotFound)&#xA;    if let Err(e) = video_opt_set(&amp;mut ctx, "h264_level", "9", 0) {&#xA;        log::warn!("Could not set the h264_level: {:?}", e);&#xA;    }&#xA;&#xA;    // This is an attempt to make an AVDictionary for avcodec_open2&#xA;    // (tried 9, 31, &amp; 3.1)&#xA;    let settings = make_avdict("level=9,h264_level=9").unwrap();&#xA;    ctx.open_with(settings).unwrap().0&#xA;}&#xA;&#xA;/// Modified from:&#xA;/// https://github.com/zmwangx/rust-ffmpeg/blob/master/examples/transcode-x264.rs#L154&#xA;pub fn make_avdict&lt;&#x27;a, S: AsRef<str>>(s: S) -> Option> {&#xA;    let s = s.as_ref();&#xA;    let mut dict = Dictionary::new();&#xA;    for keyval in s.split_terminator(&#x27;,&#x27;) {&#xA;        let tokens: Vec&lt;&amp;str> = keyval.split(&#x27;=&#x27;).collect();&#xA;        match tokens[..] {&#xA;            [key, val] => dict.set(key, val),&#xA;            _ => return None,&#xA;        }&#xA;    }&#xA;    Some(dict)&#xA;}&#xA;&#xA;/// Helper function to wrap `av_opt_set` and properly return an exception on failures&#xA;pub fn video_opt_set(video: &amp;mut Video, key: &amp;str, value: &amp;str, search: i32) -> Result&lt;(), OptError> {&#xA;    let err = unsafe {&#xA;        av_opt_set(&#xA;            (*video.as_ptr()).priv_data,&#xA;            key.as_ptr(),&#xA;            value.as_ptr(),&#xA;            search,&#xA;        )&#xA;    };&#xA;    match err {&#xA;        0 => Ok(()),&#xA;        AVERROR_OPTION_NOT_FOUND => Err(OptError::OptionNotFound),&#xA;        -34 => Err(OptError::RangeError),&#xA;        -22 => Err(OptError::Invalid),&#xA;        _ => panic!("Not a valid error code")&#xA;    }&#xA;}&#xA;</str>

    &#xA;

    The V4L2 hardware encoder is device 11 (/dev/video11). I can use v4l-ctl to interrogate the options it has available :

    &#xA;

    $ v4l2-ctl -d 11 -l&#xA;&#xA;Codec Controls&#xA;&#xA;                 video_b_frames 0x009909ca (int)    : min=0 max=0 step=1 default=0 value=0 flags=update&#xA;                 video_gop_size 0x009909cb (int)    : min=0 max=2147483647 step=1 default=60 value=60&#xA;             video_bitrate_mode 0x009909ce (menu)   : min=0 max=1 default=0 value=0 flags=update&#xA;                  video_bitrate 0x009909cf (int)    : min=25000 max=25000000 step=25000 default=10000000 value=10000000&#xA;           sequence_header_mode 0x009909d8 (menu)   : min=0 max=1 default=1 value=1&#xA;         repeat_sequence_header 0x009909e2 (bool)   : default=0 value=0&#xA;                force_key_frame 0x009909e5 (button) : flags=write-only, execute-on-write&#xA;          h264_minimum_qp_value 0x00990a61 (int)    : min=0 max=51 step=1 default=20 value=20&#xA;          h264_maximum_qp_value 0x00990a62 (int)    : min=0 max=51 step=1 default=51 value=51&#xA;            h264_i_frame_period 0x00990a66 (int)    : min=0 max=2147483647 step=1 default=60 value=60&#xA;                     h264_level 0x00990a67 (menu)   : min=0 max=15 default=11 value=11&#xA;                   h264_profile 0x00990a6b (menu)   : min=0 max=4 default=4 value=4&#xA;

    &#xA;

    And specifically looking at profile and level I have the following options provided by V4L2 :

    &#xA;

                         h264_level 0x00990a67 (menu)   : min=0 max=15 default=11 value=11&#xA;                                0: 1&#xA;                                1: 1b&#xA;                                2: 1.1&#xA;                                3: 1.2&#xA;                                4: 1.3&#xA;                                5: 2&#xA;                                6: 2.1&#xA;                                7: 2.2&#xA;                                8: 3&#xA;                                9: 3.1&#xA;                                10: 3.2&#xA;                                11: 4&#xA;                                12: 4.1&#xA;                                13: 4.2&#xA;                                14: 5&#xA;                                15: 5.1&#xA;                   h264_profile 0x00990a6b (menu)   : min=0 max=4 default=4 value=4&#xA;                                0: Baseline&#xA;                                1: Constrained Baseline&#xA;                                2: Main&#xA;                                4: High&#xA;

    &#xA;

    I have even tried overwriting the default for V4L with the command v4l2-ctl -d 11 --set-ctrl=h264_level=9. But this does nothing. It doesn't error, which would be the case where I would enter a setting that doesn't exist such as h264_levelx. Also, if I try to change it to something like 999, the command errors out with "Numerical result out of range". So it understands the parameter I am trying to change and has a grasp on what values it can modify to. But instead of seeing any changes, the command simply executes without error and applies no lasting changes.

    &#xA;