
Recherche avancée
Médias (16)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (98)
-
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. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (8582)
-
[FFmpeg]how to make codes for converting jpg files to avi(motion jpeg)
13 avril 2016, par YJJI want to make the code so that I can embed the code to a machine with cameras.
I have one I have worked on.
It generates a output avi file, but it doesn’t work.
I think I didn’t make a logic to input raw images and I don’t know how.
I want to input 100 jpg images from street_01.jpg to street_99.jpg
int main(int argc, char* argv[])
{
AVFormatContext* pFormatCtx;
AVOutputFormat* fmt;
AVStream* video_st;
AVCodecContext* pCodecCtx;
AVCodec* pCodec;
AVPacket pkt;
uint8_t* picture_buf;
AVFrame* pFrame;
int picture_size;
int y_size;
int framecnt = 0;
//FILE *in_file = fopen("src01_480x272.yuv", "rb"); //Input raw YUV data
FILE *in_file = fopen("street_01.jpg", "rb"); //Input raw YUV data
int in_w = 2456, in_h = 2058; //Input data's width and height
int framenum = 100; //Frames to encode
//const char* out_file = "src01.h264"; //Output Filepath
//const char* out_file = "src01.ts";
//const char* out_file = "src01.hevc";
const char* out_file = "output.avi";
av_register_all();
/*
//Method1.
pFormatCtx = avformat_alloc_context();
//Guess Format
fmt = av_guess_format(NULL, out_file, NULL);
pFormatCtx->oformat = fmt;
*/
//Method 2.
avformat_alloc_output_context2(&pFormatCtx, NULL, "avi", out_file);
fmt = pFormatCtx->oformat;
//Open output URL
if (avio_open(&pFormatCtx->pb, out_file, AVIO_FLAG_READ_WRITE) < 0){
printf("Failed to open output file! \n");
return -1;
}
video_st = avformat_new_stream(pFormatCtx, 0);
video_st->time_base.num = 1;
video_st->time_base.den = 25;
if (video_st == NULL){
return -1;
}
//Param that must set
pCodecCtx = video_st->codec;
//pCodecCtx->codec_id =AV_CODEC_ID_HEVC;
pCodecCtx->codec_id = AV_CODEC_ID_MJPEG;
//pCodecCtx->codec_id = fmt->video_codec;
pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO;
pCodecCtx->pix_fmt = AV_PIX_FMT_YUV444P;
pCodecCtx->width = in_w;
pCodecCtx->height = in_h;
pCodecCtx->time_base.num = 1;
pCodecCtx->time_base.den = 25;
pCodecCtx->bit_rate = 400000;
pCodecCtx->gop_size = 250;
//H264
//pCodecCtx->me_range = 16;
//pCodecCtx->max_qdiff = 4;
//pCodecCtx->qcompress = 0.6;
pCodecCtx->qmin = 10;
pCodecCtx->qmax = 51;
//Optional Param
pCodecCtx->max_b_frames = 3;
// Set Option
AVDictionary *param = 0;
//H264
if (pCodecCtx->codec_id == AV_CODEC_ID_H264) {
av_dict_set(&param, "preset", "slow", 0);
av_dict_set(&param, "tune", "zerolatency", 0);
//av_dict_set(&param, "profile", "main", 0);
}
//H265
if (pCodecCtx->codec_id == AV_CODEC_ID_H265){
av_dict_set(&param, "preset", "ultrafast", 0);
av_dict_set(&param, "tune", "zero-latency", 0);
}
//Show some Information
av_dump_format(pFormatCtx, 0, out_file, 1);
pCodec = avcodec_find_encoder(pCodecCtx->codec_id);
if (!pCodec){
printf("Can not find encoder! \n");
return -1;
}
if (avcodec_open2(pCodecCtx, pCodec, &param) < 0){
printf("Failed to open encoder! \n");
return -1;
}
pFrame = av_frame_alloc();
//picture_size = av_image_get_buffer_size(pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height, 1);
picture_size = avpicture_get_size(pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
picture_buf = (uint8_t *)av_malloc(picture_size);
avpicture_fill((AVPicture *)pFrame, picture_buf, pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height);
//Write File Header
avformat_write_header(pFormatCtx, NULL);
av_new_packet(&pkt, picture_size);
y_size = pCodecCtx->width * pCodecCtx->height;
for (int i = 0; i/Read raw YUV data
if (fread(picture_buf, 1, y_size * 3 / 2, in_file) <= 0){
printf("Failed to read raw data! \n");
return -1;
}
else if (feof(in_file)){
break;
}
pFrame->data[0] = picture_buf; // Y
pFrame->data[1] = picture_buf + y_size; // U
pFrame->data[2] = picture_buf + y_size * 5 / 4; // V
//PTS
pFrame->pts = i;
int got_picture = 0;
//Encode
int ret = avcodec_encode_video2(pCodecCtx, &pkt, pFrame, &got_picture);
if (ret < 0){
printf("Failed to encode! \n");
return -1;
}
if (got_picture == 1){
printf("Succeed to encode frame: %5d\tsize:%5d\n", framecnt, pkt.size);
framecnt++;
pkt.stream_index = video_st->index;
ret = av_write_frame(pFormatCtx, &pkt);
av_free_packet(&pkt);
}
}
//Flush Encoder
int ret = flush_encoder(pFormatCtx, 0);
if (ret < 0) {
printf("Flushing encoder failed\n");
return -1;
}
//Write file trailer
av_write_trailer(pFormatCtx);
//Clean
if (video_st){
avcodec_close(video_st->codec);
av_free(pFrame);
av_free(picture_buf);
}
avio_close(pFormatCtx->pb);
avformat_free_context(pFormatCtx);
fclose(in_file);
return 0;
} -
ffmpeg : avcodec_open2 returns invalid argument
12 mai 2016, par roarii’m reusing the sample code from the developer 64bit release of ffmpeg in my application to encode a video :
AVCodec* pCodec_{nullptr};
AVCodecContext* pContext_{nullptr};
avcodec_register_all();
pCodec_ = avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO);
if (!pCodec_) {}
pContext_ = avcodec_alloc_context3(pCodec_);
if (!pContext_) {}
pContext_->bit_rate = 400000;
pContext_->width = size.width();
pContext_->height = size.height();
pContext_->time_base.den = 1;
pContext_->time_base.num = fps;
pContext_->gop_size = 10;
pContext_->max_b_frames = 1;
pContext_->pix_fmt = AV_PIX_FMT_BGR0;
if (codec_id == AV_CODEC_ID_H264) {
av_opt_set(pContext_->priv_data, "preset", "slow", 0);
}
int err = avcodec_open2(pContext_, pCodec_, nullptr);
if (err < 0) {}AVCodec* and AVCodecContext* look like they are allocated correctly. avcodec_open2 then returns invalid argument (-22).
I use : Windows 10 64, VS2013 Compiler, Qt Creator IDE, ffmpeg(2016-05-12) 64bit.
The sample i took the code from is "decoding_encoding.c".
Any ideas ?
-
Wrong second count for blackdetect filter in ffprobe
10 avril 2016, par JabbI issue this command on a 8 minutes 20 seconds video in order to detect blackframes.
root@ubuntu:/home/hts# ffprobe -f lavfi -i "movie=test.ts,blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1
I am expecting to get proper seconds back from ffprobe indicating where the blackframes are.
Instead I receive very very high numbers.
I need to mention that I cut this video from the end of a larger stream using tail. The stream is configured to add a keyframe every 0.5 seconds. Could this be the reason ? And how could I cope with this ?
ffprobe version git-2016-03-31-54ccaae Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-libmfx
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 33.100 / 57. 33.100
libavformat 57. 29.101 / 57. 29.101
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 40.102 / 6. 40.102
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
[h264 @ 0x3222100] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x3222100] decode_slice_header error
[h264 @ 0x3222100] no frame!
Input #0, lavfi, from 'movie=test.ts,blackdetect[out0]':
Duration: N/A, start: 78576.400000, bitrate: N/A
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x256 [SAR 1:1 DAR 5:4], 25 fps, 25 tbr, 90k tbn, 90k tbc
TAG:lavfi.black_start=78681.9
TAG:lavfi.black_end=78682
TAG:lavfi.black_start=78720.5
TAG:lavfi.black_end=78721.1
TAG:lavfi.black_start=78761.4
TAG:lavfi.black_end=78762.6
TAG:lavfi.black_start=78770.9
TAG:lavfi.black_end=78771
TAG:lavfi.black_start=78781
TAG:lavfi.black_end=78781.2
TAG:lavfi.black_start=78801.2
TAG:lavfi.black_end=78801.4
TAG:lavfi.black_start=78821.4
TAG:lavfi.black_end=78821.5
TAG:lavfi.black_start=78851.5
TAG:lavfi.black_end=78851.7
TAG:lavfi.black_start=78871.7
TAG:lavfi.black_end=78871.8
TAG:lavfi.black_start=78891.8
TAG:lavfi.black_end=78892
TAG:lavfi.black_start=78919
TAG:lavfi.black_end=78919.2
TAG:lavfi.black_start=78949.2
TAG:lavfi.black_end=78949.3
TAG:lavfi.black_start=78979.3
TAG:lavfi.black_end=78979.5
TAG:lavfi.black_start=78999.5
TAG:lavfi.black_end=78999.6
TAG:lavfi.black_start=79022.6
TAG:lavfi.black_end=79022.8
TAG:lavfi.black_start=79042.8
TAG:lavfi.black_end=79043
TAG:lavfi.black_start=79063
TAG:lavfi.black_end=79063.1
[h264 @ 0x3260360] concealing 284 DC, 284 AC, 284 MV errors in P frame