
Recherche avancée
Médias (91)
-
Spoon - Revenge !
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
My Morning Jacket - One Big Holiday
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Zap Mama - Wadidyusay ?
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
David Byrne - My Fair Lady
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Beastie Boys - Now Get Busy
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (90)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications 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, parCertains 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, parPré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 (10017)
-
FFMPEG ignores encoding level parameter
2 juillet 2023, par jakebird451I 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 {
 let codec = ffmpeg_next::encoder::find_by_name("h264_v4l2m2m").unwrap();
 let ctx = new_context_from(codec).encoder();
 let mut ctx = ctx.video().unwrap();
 ctx.set_width(1280);
 ctx.set_height(720);
 ctx.set_format(ffmpeg_next::format::pixel::Pixel::YUV420P);
 let fps = ffmpeg_next::Rational::new(30, 1);
 let tb = fps.invert();
 ctx.set_frame_rate(Some(fps));
 ctx.set_time_base(tb);
 ctx.set_bit_rate(4_000_000);
 ctx.set_max_bit_rate(4_000_000);
 ctx.set_aspect_ratio(ffmpeg_next::util::rational::Rational(16, 9));
 ctx.set_flags(ffmpeg_next::codec::Flags::GLOBAL_HEADER);
 ctx.set_gop(0);
 ctx.set_max_b_frames(0);

 // ----- Below here is my attempt to set profile and level -----
 // Below modifies `compression_level`, but tried it as well just in case
 ctx.set_compression(Some(9)); // Does not work (tried 9 & 31)
 unsafe {
 let mut p = ctx.as_mut_ptr();
 (*p).profile = FF_PROFILE_H264_HIGH; // <-- Changing this will change the profile (works)
 (*p).level = 9; // Does not work (tried 9 & 31)
 }

 // Does not work (Errors with OptionNotFound)
 if let Err(e) = video_opt_set(&mut ctx, "level", "9", 0) {
 log::warn!("Could not set the level: {:?}", e);
 }

 // Does not work (Errors with OptionNotFound)
 if let Err(e) = video_opt_set(&mut ctx, "h264_level", "9", 0) {
 log::warn!("Could not set the h264_level: {:?}", e);
 }

 // This is an attempt to make an AVDictionary for avcodec_open2
 // (tried 9, 31, & 3.1)
 let settings = make_avdict("level=9,h264_level=9").unwrap();
 ctx.open_with(settings).unwrap().0
}

/// Modified from:
/// https://github.com/zmwangx/rust-ffmpeg/blob/master/examples/transcode-x264.rs#L154
pub fn make_avdict<'a, S: AsRef<str>>(s: S) -> Option> {
 let s = s.as_ref();
 let mut dict = Dictionary::new();
 for keyval in s.split_terminator(',') {
 let tokens: Vec<&str> = keyval.split('=').collect();
 match tokens[..] {
 [key, val] => dict.set(key, val),
 _ => return None,
 }
 }
 Some(dict)
}

/// Helper function to wrap `av_opt_set` and properly return an exception on failures
pub fn video_opt_set(video: &mut Video, key: &str, value: &str, search: i32) -> Result<(), OptError> {
 let err = unsafe {
 av_opt_set(
 (*video.as_ptr()).priv_data,
 key.as_ptr(),
 value.as_ptr(),
 search,
 )
 };
 match err {
 0 => Ok(()),
 AVERROR_OPTION_NOT_FOUND => Err(OptError::OptionNotFound),
 -34 => Err(OptError::RangeError),
 -22 => Err(OptError::Invalid),
 _ => panic!("Not a valid error code")
 }
}
</str>


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

$ v4l2-ctl -d 11 -l

Codec Controls

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



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


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



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 ash264_levelx
. Also, if I try to change it to something like999
, 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.

-
Anomalie #3816 (Nouveau) : Compatiblité avec PHP 7.0.9 et 5.6.24 et les fonctions "expected to be ...
10 août 2016Suite à http://forum.spip.net/fr_264848.html#forum264908
Apparemment SPIP et PHP 7.0.9 génère une page blanche.
D’après Tatu, il faudrait modifier le paramètre de la fonction f_queue() à la ligne 246 du fichier "spip/ecrire/inc/pipelines.php"
Ainsi la fonction :
function f_queue(&$texte)
Devient :
function f_queue($texte)D’après Luc, cela pourrait venir de https://bugs.php.net/bug.php?id=72698
Si c’est le cas, il faudrait faire une revue du code et chercher les appels de type &$
-
Anomalie #3413 : Un script s’affiche lorsqu’on prévisualise un commentaire et que $filtrer_javascr...
29 octobre 2015, par - EquipementMerci de ce retour. Je laisse le soin à la communauté de modifier le plugin forum.