
Recherche avancée
Médias (1)
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (82)
-
List of compatible distributions
26 avril 2011, parThe 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 (...) -
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 (9777)
-
avcodec/apedec : Fix 48khz 24bit below insane level
25 août 2023, par Michael Niedermayer -
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.

-
Need to get level of audio signal in dbfs/lufs during playback with libmpv
12 avril 2023, par NullUserExploring the possibility of moving the video player from libvlc to libmpv, I came across a problem - I can not find a way to get the value of the audio signal level for each video frame (in dbfs / lufs). This is necessary to display the volume level during video playback. But libvlc and ffme have similar mechanisms.


For example, ffme has the ability to get raw audio data for further processing before outputting to an audio device. You can bind to this event (Unosquare.FFME.MediaElement.RenderingAudio http://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.MediaElement.html#Unosquare_FFME_MediaElement_RenderingAudio) which carries RenderingAudioEventArgs, which has a method that allows get to this data (GetBufferData() http://unosquare.github.io/ffmediaelement/api/Unosquare.FFME.Common.RenderingAudioEventArgs.html#Unosquare_FFME_Common_RenderingAudioEventArgs_GetBufferData) which we can read and process. Libvlc can perform similar operations.


But I cannot find such functionality in libmpv. Does anyone have any ideas how to solve this issue ?


P.S. It is planned to use mpv.net (https://github.com/hudec117/Mpv.NET-lib-/blob/master/src/Mpv.NET) for the move. This SDK has the ability to call ffmpeg for video and audio processing, maybe anyone have any idea how to use ffmpeg to solve this problem ?