
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)
-
Get video from webcam using FFmpeg Libav
27 mai 2022, par Hillel RosensweigI am trying to record webcam video using FFmpeg C libraries (libav), on a Mac computer. I made changes to the transcode.c example so that it opens a device instead of a file. However, for some reason the code only receives a single packet and then closes.


static int open_input_source(const char *dev_name) {
int ret;
unsigned int i;
AVDictionary *p_av_options = NULL;
AVInputFormat *p_av_input_format = av_find_input_format("avfoundation");
av_dict_set(&p_av_options, "framerate", "30", 0);

ifmt_ctx = NULL;
if ((ret = avformat_open_input(&ifmt_ctx, dev_name, p_av_input_format, &p_av_options) < 0)) {
 av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n");
 return ret;
}

if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0) {
 av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n");
 return ret;
}

stream_ctx = av_calloc(ifmt_ctx->nb_streams, sizeof(*stream_ctx));
if (!stream_ctx)
 return AVERROR(ENOMEM);

for (i = 0; i < ifmt_ctx->nb_streams; i++) {
 AVStream *stream = ifmt_ctx->streams[i];
 const AVCodec *dec = avcodec_find_decoder(stream->codecpar->codec_id);
 AVCodecContext *codec_ctx;
 if (!dec) {
 av_log(NULL, AV_LOG_ERROR, "Failed to find decoder for stream #%u\n", i);
 return AVERROR_DECODER_NOT_FOUND;
 }
 codec_ctx = avcodec_alloc_context3(dec);
 if (!codec_ctx) {
 av_log(NULL, AV_LOG_ERROR, "Failed to allocate the decoder context for stream #%u\n", i);
 return AVERROR(ENOMEM);
 }
 ret = avcodec_parameters_to_context(codec_ctx, stream->codecpar);
 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Failed to copy decoder parameters to input decoder context "
 "for stream #%u\n", i);
 return ret;
 }
 /* Reencode video & audio and remux subtitles etc. */
 if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO
 || codec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
 if (codec_ctx->codec_type == AVMEDIA_TYPE_VIDEO)
 codec_ctx->framerate = av_guess_frame_rate(ifmt_ctx, stream, NULL);
 /* Open decoder */
 ret = avcodec_open2(codec_ctx, dec, NULL);
 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Failed to open decoder for stream #%u\n", i);
 return ret;
 }
 }
 stream_ctx[i].dec_ctx = codec_ctx;

 stream_ctx[i].dec_frame = av_frame_alloc();
 if (!stream_ctx[i].dec_frame)
 return AVERROR(ENOMEM);
 }

 av_dump_format(ifmt_ctx, 0, dev_name, 0);
 return 0;
}



I have looked for other code examples but they are all deprecated and no longer compile in updated FFmpeg.


Is there some missing setting in my open_input_source function ? Alternatively, is the problem in using transcoding is my basis ? Should I try to use some other example ?


In general, is there is a C source code reference which fulfills my requirements ?


Thanks


-
fate/filter-video : Avoid duplication for fate-filter-stereo3d tests
16 mai 2022, par Andreas Rheinhardtfate/filter-video : Avoid duplication for fate-filter-stereo3d tests
Also fix the requirements of these tests : Only the anaglyph
tests need a scale filter, yet it has been inserted for all tests
without any check for its presence.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
fate/filter-video : Avoid duplication for fate-filter-overlay tests
17 mai 2022, par Andreas Rheinhardtfate/filter-video : Avoid duplication for fate-filter-overlay tests
Also add a fate-filter-overlays target containing all these tests
and fix the requirements of the tests ; furthermore, remove
unnecessary scale filters from filter-overlay-rgba ?_rgba.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>