
Recherche avancée
Autres articles (78)
-
Amélioration de la version de base
13 septembre 2013Jolie 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 (...) -
Qu’est ce qu’un masque de formulaire
13 juin 2013, parUn masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
Chaque formulaire de publication d’objet peut donc être personnalisé.
Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...) -
Le profil des utilisateurs
12 avril 2011, parChaque 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 (...)
Sur d’autres sites (14126)
-
gstreamer records
13 octobre 2012, par EricI use the following command to record audio and video from my webcam
gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! \
tee name=t_vid ! queue ! videoflip method=horizontal-flip ! \
xvimagesink sync=false t_vid. ! queue ! \
videorate ! video/x-raw-yuv,framerate=30/1 ! queue ! mux. \
autoaudiosrc ! audiorate ! audio/x-raw-int,rate=48000,channels=1,depth=16 ! queue ! \
audioconvert ! queue ! mux. avimux name=mux ! \
filesink location=video.aviAnd the result is correct in term of synchronicity between the flows. However the avi file is very big since that's uncompressed data...
Could you advice me howto reduce the size of the records. Note that I after recording I split audio and video in separate files for processing. It is crucial to keep the synchronicity.* Edit *
I tried to use ffmpeg to compress the avi files using this command :
ffmpeg -i video.avi -vcodec msmpeg4v2 output.avi
But it seems that bitrate is invalid (N/A since its raw data ?)
Here is the output :Input #0, avi, from 'video.avi':
Duration: 00:00:00.00, start: 0.000000, bitrate: -2147483 kb/s
Stream #0.0: Video: rawvideo, yuv420p, 640x480, 30 tbr, 30 tbn, 30 tbc
Stream #0.1: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
[buffer @ 0xef57e0] w:640 h:480 pixfmt:yuv420p
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[ac3 @ 0xedece0] channel_layout not specified
[ac3 @ 0xedece0] No channel layout specified. The encoder will guess the layout, but it might be incorrect.
[ac3 @ 0xedece0] invalid bit rate
Output #0, avi, to 'output.avi':
Stream #0.0: Video: msmpeg4v2, yuv420p, 640x480, q=2-31, 200 kb/s, 90k tbn, 30 tbc
Stream #0.1: Audio: ac3, 48000 Hz, mono, flt, 200 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or heightThanks for helping.
-
ffmpeg - preserve time base and pts of all frames during transcode
18 mars 2021, par jdizzleContext :


I have an application that produces mp4s with HEVC encoding. I want to convert them to AVC for use in browser-based displaying. A very crucial part of how I want to use this is to preserve exact PTS times, as this is how we correlate the frames to other data streams not included in the video.


Question :


How do I make ffmpeg preserve this information across the transcode ? All the obvious flags seem to have no effect and ffmpeg just does whatever it wants.


$ ffprobe -show_streams original.mp4 2>/dev/null | grep time_base
codec_time_base=16666667/500000000
time_base=1/1000



Here is my convert command :


$ ffmpeg -i original.mp4 -copyts -copytb 0 test.mp4



And its result :


$ ffprobe -show_streams test.mp4 2>/dev/null | grep time_base
codec_time_base=1/60
time_base=1/15360



I would expect the time_bases to match. The PTS of the frames also don't match when doing
ffprobe -show_frames


EDIT :
@Gyan suggested using -video_track_timescale, but that didn't get the exact behavior I was looking for :


$ sdiff <(ffprobe -show_frames test.mp4 | grep pkt_pts_time) <(ffprobe -show_frames original.mp4 | grep pkt_pts_time)
pkt_pts_time=0.000000 pkt_pts_time=0.000000
pkt_pts_time=0.033000 pkt_pts_time=0.033000
pkt_pts_time=0.067000 | pkt_pts_time=0.066000
pkt_pts_time=0.100000 pkt_pts_time=0.100000
pkt_pts_time=0.133000 pkt_pts_time=0.133000
pkt_pts_time=0.167000 | pkt_pts_time=0.166000
pkt_pts_time=0.200000 pkt_pts_time=0.200000
pkt_pts_time=0.233000 pkt_pts_time=0.233000
pkt_pts_time=0.267000 | pkt_pts_time=0.266000
pkt_pts_time=0.300000 pkt_pts_time=0.300000
pkt_pts_time=0.333000 pkt_pts_time=0.333000
pkt_pts_time=0.367000 | pkt_pts_time=0.366000
pkt_pts_time=0.400000 pkt_pts_time=0.400000
pkt_pts_time=0.433000 pkt_pts_time=0.433000
pkt_pts_time=0.467000 pkt_pts_time=0.467000
pkt_pts_time=0.500000 pkt_pts_time=0.500000
pkt_pts_time=0.533000 | pkt_pts_time=0.532000
pkt_pts_time=0.567000 | pkt_pts_time=0.565000
pkt_pts_time=0.600000 | pkt_pts_time=0.598000
pkt_pts_time=0.633000 | pkt_pts_time=0.631000
pkt_pts_time=0.667000 | pkt_pts_time=0.665000
pkt_pts_time=0.700000 | pkt_pts_time=0.698000
...



-
Best Settings for H264_Nvenc To Minimize Latency ? (FFMPEG)
1er novembre 2022, par M. YingI'm currently using Libavcodec to encode video frames using H.264. Because I'm streaming this video frames after they're encoded, minimizing latency is crucial to me. My current settings are :



avcodec_register_all();
codec = avcodec_find_encoder(AV_CODEC_ID_H264);

// allocate and set ffmpeg context
context = avcodec_alloc_context3(encoder->codec);
context->bit_rate = bitrate;
context->width = out_width;
context->height = out_height;
context->time_base.num = 1;
context->time_base.den = 30;
context->gop_size = 1; // send SPS/PPS headers every packet
context->max_b_frames = 0;
context->pix_fmt = AV_PIX_FMT_YUV420P;

// set encoder parameters to max performance
av_opt_set(context->priv_data, "preset", "ultrafast", 0);
av_opt_set(context->priv_data, "tune", "zerolatency", 0);

// open capture encoder
avcodec_open2(context, codec, NULL);




These settings work well, but I am trying to switch to hardware-based encoding to take the workload off my CPU. I currently have an NVIDIA GPU, so I tried using the following settings with
h264_nvenc
:


codec = avcodec_find_encoder_by_name("h264_nvenc");

// allocate and set ffmpeg context
context = avcodec_alloc_context3(encoder->codec);
context->dct_algo = FF_DCT_FASTINT;
context->bit_rate = bitrate;
context->width = out_width;
context->height = out_height;
context->time_base.num = 1;
context->time_base.den = 30;
context->gop_size = 1; // send SPS/PPS headers every packet
context->max_b_frames = 0;
context->pix_fmt = AV_PIX_FMT_YUV420P;

// set encoder parameters to max performancen
av_opt_set(context->priv_data, "preset", "llhq", 0);
av_opt_set(context->priv_data, "tune", "zerolatency", 0);




The issue is, I noticed that the latency with
h264_nvenc
is significantly more than the latency withAV_CODEC_ID_H264
(the software-based version). I think that my settings or setup ofh264_nvenc
must be wrong, since GPU-based encoding should be faster than software-based encoding. Could anyone point me in the right direction ? Thanks so much !