
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (46)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (4248)
-
when audioqueue play lpcm decoded from ffmpeg, the elapsed time of audio queue exceeds the duraion of the media
15 août 2012, par zhzhyWhen play the lpcm data decoded from ffmpeg with audioqueue, the elapsed time got by
AudioQueueGetCurrentTime
exceeds the duration of media. But when decode the same media with AVFoundation framework, the elapsed time equals duration of the media, and so when read media by ffmpeg with no decoded, then send the compressed media data to audioqueue, the elapsed time also equals duration of the media. The AudioStreamBasicDescription set as following :asbd.mSampleRate = 44100;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFormatFlags = kAudioFormatFlagsCanonical;
asbd.mBytesPerPacket = 4;
asbd.mFramesPerPacket = 1;
asbd.mBytesPerFrame = 4;
asbd.mChannelsPerFrame = 2;
asbd.mBitsPerChannel = 16;
asbd.mReserved = 0;When playing with data decoded from AVFoundation, the setting of AudioStreamBasicDescription is the same as above. By my test found that
AudioTimeStamp.mSampleTime
got byAudioQueueGetCurrentTime
is different between ffmpeg and AVFoundation, the value of ffmpeg is greater than AVFoundation. So I want to know how this happen, and how to fix it ?
Thanks ! -
ffmpeg stream Raspberry pi
2 décembre 2020, par Matt85I use a rasberry pI4 with usb camera to stream on our server in rtmp


we would like to use the native resolution of the cam


I use video4linux and ffmpeg


here the formats you see :


[video4linux2, v4l2 @ 0x17641c0] Compressed : mjpeg : Motion-JPEG : 1600x1200 3264x2448 2592x1944 2048x1536 1280x960 1024x768 800x600 640x480 320x240 1600x1200
[video4linux2, v4l2 @ 0x17641c0] Raw : yuyv422 : YUYV 4 : 2 : 2 : 1600x1200 3264x2448 2592x1944 2048x1536 1280x960 1024x768 800x600 640x480 320x240 1600x1200


this are the result supported by the usb cam in 2 formats (YUY and MJPEG)


our server accepts incoming RTMP


we would like to stream in RTMP at 1280x960 with output at 20fps (supported for mjpeg)


what is the correct string we need to use in ffmpeg


we tried many variations, but the frame rate is not correct it comes out very low.


the string we use is this :


# ! /bin/bash
ffmpeg

-f v4l2 -i /dev/video0

-c : v libx264 -pix_fmt yuv420p -preset ultrafast -b 3000k -g 40 -b : v 2000k

-bufsize 512k

-threads 1 -qscale 0

-r 20

-s 1280x960

-f flv rtmp ://login:password@xxx.xxx.xxx.xxx:1935/xxxx/xxxx

comes out at 10 / 12fps


and gives us this :


Please use -b : a or -b : v, -b is ambiguous
Please use -q : a or -q : v, -qscale is ambiguous


Help from the most experienced of ffmpeg, thanks


-
How to read a text file in c++ ?
16 mai 2017, par Sanduni WickramasingheI want to detect a predefined specific content in a video. For this I use an already identified piece of video separately and another input video. I have read the data in the identified video and bite array was saved in a text file. Now I want to compare the content of saved text file with the input video content.
This is my code
void CFfmpegmethods::VideoRead(){
av_register_all();
avformat_network_init();
ifstream inFile;
inFile.open("H:\\Sanduni_projects\\sample_ad.txt");
const char *url = "H:\\Sanduni_projects\\ad_1.mp4";
AVDictionary *options = NULL;
AVFormatContext *s = avformat_alloc_context();
AVPacket *pkt = new AVPacket(); //this structure stores compressed data
//open an input stream and read the header
int ret = avformat_open_input(&s, url, NULL,NULL);
//avformat_find_stream_info(s, &options); //finding the missing information
if (ret < 0)
abort();
if (!inFile) {
cerr << "Unable to open file datafile.txt";
exit(1); // call system to stop
}
av_dict_set(&options, "video_size", "640x480", 0);
av_dict_set(&options, "pixel_format", "rgb24", 0);
if (avformat_open_input(&s, url, NULL, &options) < 0){
abort();
}
av_dict_free(&options);
AVDictionaryEntry *e;
if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
abort();
}
int i = 1;
int64_t duration = 0;
int size = 0;
uint8_t *data; //Unsigned integer type with a width of exactly 8 bits.
int sum = 0;
int total_size = 0;
int64_t total_duration = 0;
int packet_size = 0;
int64_t stream_index = 0;
int64_t bit_rate = 0;
AVBufferRef *buf;
//writing data to a file
outdata.open("H:\\Sanduni_projects\\sample_ad.txt");
//outdata.open("H:\\Sanduni_projects\\log.txt");
if (!outdata){
cerr << "Error: file could not be opened" << endl;
exit(1);
}
//Split what is stored in the file into frames and return one for each call
//returns the next frame of the stream
while(1){
int frame = av_read_frame(s, pkt); //one frame is readed.
if (frame < 0) break;
size = pkt->size;
data = pkt->data;
for (int j = 0; j < size; j++){
for (int k = 0; k < 12; k++){
while (!inFile.eof){
}
//if (data[j] != ) break;
}
}
//int decode = avcodec_send_packet(avctx, pkt);
}
//make the packet free
av_packet_unref(pkt);
delete pkt;
cout << "total size: " << total_size << endl;
cout << "total duration:" << total_duration << endl;
outdata.close();
//Close the file after reading
avformat_close_input(&s);
}
void CFfmpegmethods::SampleAdCreation(){
av_register_all();
const char *url_ref = "H:\\Sanduni_projects\\sample_ad.mp4";
AVDictionary *options = NULL;
AVDictionary *options_ref = NULL;
AVFormatContext *s = avformat_alloc_context();
AVPacket *pkt = new AVPacket(); //this structure stores compressed data
//open an input stream and read the header
int ret = avformat_open_input(&s, url_ref, NULL, NULL);
if (ret < 0)
abort();
av_dict_set(&options, "video_size", "640x480", 0);
av_dict_set(&options, "pixel_format", "rgb24", 0);
if (avformat_open_input(&s, url_ref, NULL, &options) < 0){
abort();
}
av_dict_free(&options);
AVDictionaryEntry *e;
if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
abort();
}
uint8_t *data;
//writing data to a file
outdata.open("H:\\Sanduni_projects\\sample_ad.txt");
if (!outdata){
cerr << "Error: file could not be opened" << endl;
exit(1);
}
for (int m = 0; m < 12; m++){
int size = pkt->size;
int frame = av_read_frame(s, pkt);
if (frame < 0) break;
data = pkt->data;
for (int j = 0; j < size; j++){
outdata << data[j];
} outdata</make the packet free
av_packet_unref(pkt);
delete pkt;
outdata.close();
//Close the file after reading
avformat_close_input(&s);
}