
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (25)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (4505)
-
how to improve image quality when I write c++ using ffmpeg( avcodec)
6 septembre 2021, par qycxI am writing a c++ program, using ffmpeg to encode video.
but the image quality is very bad.
can you help me to improve the video quality ?


following is my code :


pUnit->encV_var.pkt = av_packet_alloc();
 if (!pUnit->encV_var.pkt) {
 goto errLabel;
 }

 /* put sample parameters */
 pUnit->encV_var.c->bit_rate = bitrate;//400000;
 pUnit->encV_var.c->rc_max_rate=bitrate;
 pUnit->encV_var.c->rc_min_rate=bitrate;
 AVCodecContext *c=pUnit->encV_var.c;
 int br = bitrate;
 c->bit_rate_tolerance = br;
c->rc_buffer_size=br;
c->rc_initial_buffer_occupancy = c->rc_buffer_size*3/4;
//c->rc_buffer_aggressivity= (float)1.0;
//c->rc_initial_cplx= 0.5; 



 /* resolution must be a multiple of two */
 pUnit->encV_var.c->width = in_w;//352;
 pUnit->encV_var.c->height = in_h;//288;
 /* frames per second */
 AVRational t1={1,25};
 t1.den=fps;
 pUnit->encV_var.c->time_base = t1;//(AVRational){1, 25};
 AVRational t2={25,1};
 t2.num=fps;
 pUnit->encV_var.c->framerate = t2;//(AVRational){25, 1};

 /* emit one intra frame every ten frames
 * check frame pict_type before passing frame
 * to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
 * then gop_size is ignored and the output of encoder
 * will always be I frame irrespective to gop_size
 */
 pUnit->encV_var.c->gop_size = 256;//10;
 pUnit->encV_var.c->max_b_frames = 0;//1;
 pUnit->encV_var.c->pix_fmt = AV_PIX_FMT_YUV420P;

 //
 pUnit->encV_var.c->flags|=AV_CODEC_FLAG_GLOBAL_HEADER;

 //
 if (codec_id == AV_CODEC_ID_H264) {
 int ret;
 ret = av_opt_set(pUnit->encV_var.c->priv_data, "preset", "fast", 0);
 //ret = av_opt_set(pUnit->encV_var.c->priv_data, "preset", "slow", 0);
 //ret = av_opt_set(pUnit->encV_var.c->priv_data, "preset", "medium", 0);

 //
 ret = av_opt_set(pUnit->encV_var.c->priv_data, "tune","zerolatency",0);

 //
 ret = av_opt_set(pUnit->encV_var.c->priv_data, "profile","main",0);

 }

 /* open it */
 ret = avcodec_open2(pUnit->encV_var.c, pUnit->encV_var.codec, NULL);
 



please help me to improve image quality


mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm


-
how to set nVidia video bitrate in a system service ?
12 septembre 2021, par qycxI use an nvidia card for compression and decompression in a video conferencing software. The program uses ffmpeg. The program is a system service. Need to control the bit rate. But I found that I didn't control it. The setting code rate was 700k, and the actual value was 10M. What went wrong ?


/* put sample parameters */
 pUnit->encV_var.c->bit_rate = bitrate;//400000;
 /* resolution must be a multiple of two */
 pUnit->encV_var.c->width = in_w;//352;
 pUnit->encV_var.c->height = in_h;//288;
 pUnit->encV_var.c->qmin=10;
 pUnit->encV_var.c->qmax=30;
 /* frames per second */
 AVRational t1={1,25};
 t1.den=fps;
 pUnit->encV_var.c->time_base = t1;//(AVRational){1, 25};
 AVRational t2={25,1};
 t2.num=fps;
 pUnit->encV_var.c->framerate = t2;//(AVRational){25, 1};

 /* emit one intra frame every ten frames
 * check frame pict_type before passing frame
 * to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
 * then gop_size is ignored and the output of encoder
 * will always be I frame irrespective to gop_size
 */
 pUnit->encV_var.c->gop_size = 256;//10;
 pUnit->encV_var.c->max_b_frames = 0;//1;
 pUnit->encV_var.c->pix_fmt = AV_PIX_FMT_YUV420P;



-
Sync video and data with ffmpeg
31 août 2022, par pljI join a video and data where I copy the video from the vid1.ts along with the data (klv) from the vid2.ts :


ffmpeg -y -i vid1.ts -i vid2.ts -c copy -map 0:0 -map 1:2 -shortest full_exclude.ts


When I probe the resulting video I see that the packets don't line up :


ffprobe -show_packets full_exclude.ts


The 1st data packet is :


[PACKET]
codec_type=data
stream_index=1
pts=126000
pts_time=1.400000
dts=126000
dts_time=1.400000
duration=N/A
duration_time=N/A
size=324
pos=564
flags=K_
[SIDE_DATA]
side_data_type=MPEGTS Stream ID
id=252
[/SIDE_DATA]
[/PACKET]



The 1st video packet is :


[PACKET]
codec_type=video
stream_index=0
pts=341392
pts_time=3.793244
dts=341392
dts_time=3.793244
duration=N/A
duration_time=N/A
size=9270
pos=28952
flags=K_
[SIDE_DATA]
side_data_type=MPEGTS Stream ID
id=224
[/SIDE_DATA]
[/PACKET]
[PACKET]



How do I get the data and video in sync with each other ?