
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (101)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
L’agrémenter visuellement
10 avril 2011MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté. -
Possibilité de déploiement en ferme
12 avril 2011, parMediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)
Sur d’autres sites (8110)
-
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
 }
}



-
ffmpeg regenerate m3u8 from multi ts file
17 juin 2021, par Mulham AryanI have generated hls videos using FFmpeg with output m3u8.
m3u8 file content


#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:2
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:2.400000,
ffmpegmovie1.ts
#EXTINF:2.400000,
ffmpegmovie2.ts
#EXTINF:2.400000,
ffmpegmovie3.ts
#EXTINF:2.400000,
ffmpegmovie4.ts
#EXTINF:2.400000,
ffmpegmovie5.ts
#EXTINF:2.400000,
ffmpegmovie6.ts
#EXTINF:2.400000,
ffmpegmovie7.ts
#EXTINF:2.400000,
ffmpegmovie8.ts
#EXTINF:2.400000,
ffmpegmovie9.ts
#EXTINF:2.400000,
ffmpegmovie10.ts



so let suppose that I'm going to take only files from 1 to 5
the m3u8 file should be like this


#EXTM3U
 #EXT-X-VERSION:3
 #EXT-X-TARGETDURATION:2
 #EXT-X-MEDIA-SEQUENCE:1
 #EXTINF:2.400000,
 ffmpegmovie1.ts
 #EXTINF:2.400000,
 ffmpegmovie2.ts
 #EXTINF:2.400000,
 ffmpegmovie3.ts
 #EXTINF:2.400000,
 ffmpegmovie4.ts
 #EXTINF:2.400000,
 ffmpegmovie5.ts



so the question is : is there any command from FFmpeg lets me input multiple ts files and get an output in m3u8 ?
example


ffmpeg -i ffmpegmovie1.ts, ffmpegmovie2.ts, ffmpegmovie3.ts, .... >> output.m3u8