
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (38)
-
MediaSPIP : Modification des droits de création d’objets et de publication définitive
11 novembre 2010, parPar défaut, MediaSPIP permet de créer 5 types d’objets.
Toujours par défaut les droits de création et de publication définitive de ces objets sont réservés aux administrateurs, mais ils sont bien entendu configurables par les webmestres.
Ces droits sont ainsi bloqués pour plusieurs raisons : parce que le fait d’autoriser à publier doit être la volonté du webmestre pas de l’ensemble de la plateforme et donc ne pas être un choix par défaut ; parce qu’avoir un compte peut servir à autre choses également, (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (3932)
-
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;



-
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


-
FFMPEG/C++ How to simply write out/passthrough h264 stream ?
11 août 2021, par SchuertaIm trying to learn the basics of ffmpeg writing (reading already works), so im just trying to take in an input .ts file and write out/passthrough the exact same h264 stream to a new output file. I dont get any compilation errors, but for some reason i cant figure out why my output file's framerate is very wrong. Also when i read in my output file, i get printouts saying "Packet corrupt (stream = 0, dts = #)"


I followed the instructions in the ffmpeg library comments so im not sure what im missing. I call initOutStream(), then initH264encoder(), then during the reading/decoding readH264Packet() is called repeatedly. (Removed code for readability sake, left relevant sections below) ;


Edit : If i put my output file through the actuall ffmpeg cmd app, the framerate issue seems to get fixed. Wonder where im messing up


void test::initOutStream() {

//create muxing context
outstreamContext = avformat_alloc_context();

//oformat
AVOutputFormat *guessFormat; //Populate oformat
guessFormat = av_guess_format(NULL, inputVideoUrl.c_str(), NULL);
outstreamContext->oformat = guessFormat; 
outstreamContext->oformat->video_codec = AV_CODEC_ID_H264; 
//outstreamContext->bit_rate = 400000; //No affect; 

//pb
AVIOContext *outAVIOContext = nullptr;
//int result = avio_open(&outAVIOContext, outputVideoUrl.c_str(), AVIO_FLAG_WRITE);
int result = avio_open2(&outAVIOContext, outputVideoUrl.c_str(), AVIO_FLAG_WRITE, NULL, NULL); //Documentain said to use this method
outstreamContext->pb = outAVIOContext;
}



.


void test::initH264encoder() { //Frame -> packet
int result;

h264OutCodec = avcodec_find_encoder(AV_CODEC_ID_H264);

h264OutStream = avformat_new_stream(outstreamContext, h264OutCodec);
h264OutStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
h264OutStream->codecpar->codec_id = AV_CODEC_ID_H264;
h264OutStream->codecpar->width = 640;
h264OutStream->codecpar->height = 480;
h264OutStream->id = H264_STREAM_ID;
h264OutStream->codecpar->color_range = AVCOL_RANGE_MPEG;
//h264OutStream->codecpar->bit_rate = 400000;

h264OutContext = avcodec_alloc_context3(h264OutCodec);

h264OutContext->width = 640;
h264OutContext->height = 480;
h264OutContext->time_base = (AVRational){1,static_cast<int>(29.97)};
h264OutContext->pix_fmt = AV_PIX_FMT_YUV420P;

result = avcodec_open2(h264OutContext, h264OutCodec, nullptr);

//Alloc packet + finish
outPacket = av_packet_alloc();

//Write header
result = avformat_write_header(outstreamContext, NULL);
}
</int>


Assume that reading was set up correctly


void test::readH264Packet(__unused uint64_t tick) {
//...av_read_frame(streamContext, inPacket);
//...avcodec_send_packet(h264Context, inPacket);
//...avcodec_receive_frame(h264Context, yuvFrame)
//My passthrough:
if(shouldOutputH264Stream){
 result = avcodec_send_frame(h264OutContext, yuvFrame); //1. Encode frame to packet
 result = avcodec_receive_packet(h264OutContext, outPacket2); //2. get encoded packet
 result = av_interleaved_write_frame(outstreamContext, outPacket2); //3. write packet
 //Write trailer and free happens later
 }
}