
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 (16)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)
Sur d’autres sites (3973)
-
ffmpeg error loading shared OpenCV libraries
19 septembre 2017, par chronosynclasticI installed FFmpeg 3.3 from a PPA repository following the guide here. I already have OpenCV 3.3 installed on my Ubuntu 16.04 system with all the necessary libraries under
/usr/local/lib
. However, when I try to run ffmpeg, I get the error :ffmpeg: error while loading shared libraries:
libopencv_core.so.2.4: cannot open shared object file: No such file or directoryDoes FFmpeg only work with OpenCV 2.4 libraries ? I have the corresponding library for OpenCV under
/usr/local/lib/libopencv_core.so.3.3
but somehow FFmpeg looks for the version 2.4. -
Noise when decoding mp3 using libavcodec on iOS
11 janvier 2014, par TrenskowI have this methods. It first sets up an audio input if necessary. Then it reads a frame, and returns the frame converted using an AudioConverterRef (wrapped in an KFInlineConverterUnit class) to my Core Audio graph. At the end of the method it tears down the input, if audio output has stopped.
- (NSData *)readNextChunk {
/* Setup audio input */
if (_formatContext == NULL && self.runLoopActive) {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
av_register_all();
});
avformat_network_init();
av_init_packet(&_packet);
_formatContext = avformat_alloc_context();
[self handleError:avformat_open_input(&_formatContext, [[_url absoluteString] cStringUsingEncoding:NSUTF8StringEncoding], NULL, NULL)];
[self handleError:avformat_find_stream_info(_formatContext, NULL)];
_audioStreamIndex = -1;
for (NSInteger index = 0 ; index < _formatContext->nb_streams ; index++)
if (_formatContext->streams[index]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
_audioStreamIndex = index;
break;
}
if (_audioStreamIndex > -1) {
_codec = avcodec_find_decoder(_formatContext->streams[_audioStreamIndex]->codec->codec_id);
_codecContext = _formatContext->streams[_audioStreamIndex]->codec;
[self handleError:avcodec_open2(_codecContext, _codec, NULL)];
}
if (self.timeOffset > .0) {
int64_t timestamp = AV_TIME_BASE * self.timeOffset;
av_seek_frame(_formatContext, -1, timestamp, AVSEEK_FLAG_ANY);
}
}
/* Read and decode next frame */
NSData *chunk = nil;
AVFrame *frame = avcodec_alloc_frame();
while (self.runLoopActive && _formatContext != NULL && av_read_frame(_formatContext, &_packet) >= 0) {
if (_packet.stream_index == _audioStreamIndex) {
int gotFrame = 0;
int len = avcodec_decode_audio4(_codecContext, frame, &gotFrame, &_packet);
[self handleError:len];
if (gotFrame) {
/* Setup a converter for my Audio Graph */
AudioStreamBasicDescription inputAudioDescription = [self audioDescriptionForCodecContext];
if (!_converter || memcmp(&inputAudioDescription, _converter.inputAudioDescription, sizeof(AudioStreamBasicDescription)) != 0)
_converter = [KFInlineConverterUnit newWithInputAudioDescription:inputAudioDescription
outputAudioDescription:self.audioDescription];
/* Convert frames */
if (inputAudioDescription.mFormatFlags & kAudioFormatFlagIsNonInterleaved) {
NSMutableArray *buffers = [@[] mutableCopy];
for (NSInteger i = 0 ; i < frame->channels ; i++) {
[buffers addObject:[NSData dataWithBytes:frame->data[i] length:frame->nb_samples * inputAudioDescription.mBytesPerFrame]];
}
chunk = [_converter convertBuffer:buffers];
} else
chunk = [_converter convertBuffer:@[[NSData dataWithBytes:frame->data[0] length:frame->nb_samples * inputAudioDescription.mBytesPerFrame]]];
if (_packet.data != NULL)
av_free_packet(&_packet);
break;
}
}
}
avcodec_free_frame(&frame);
/* Tear down if output has stopped */
if (!self.runLoopActive) {
avformat_free_context(_formatContext);
_formatContext = NULL;
avformat_network_deinit();
}
return chunk;
}Basically everything is fine. I am developing this for iOS, and when I test it in the iOS Simulator everything works smoothly. It plays all audio formats with no problems.
The problem arises, when I run the code on an actual device. Then mp3 files are audible - but VERY distorted. I have tried everything in my mind to make this work, but I cannot figure what's going wrong.
I can say that the problem does NOT lay in the converter. I've extracted the audio before it hits the decoder, and it sounds the same. So the converter just converts the distorted audio. So I think it might be an MP3 decoder issue.
Anyone experienced this before ?
-
Streaming converted movie with mp4 container in NodeJS, movie playing very fast
20 septembre 2016, par MustafaI have used stream-transcoder module to convert a file make it a stream. So the file is not stored, it is on the fly.
app.get("/video", function(req,res){
res.writeHead(200, {'Content-Type': 'video/mp4'});
var src = "movie.avi";
var Transcoder = require('stream-transcoder');
var stream = fs.createReadStream(src);
new Transcoder(stream)
.maxSize(1280, 720)
.videoCodec('h264')
.videoBitrate(800 * 1000)
.fps(25)
.sampleRate(44100)
.channels(2)
.audioBitrate(128 * 1000)
.format('mp4')
.on('finish', function() {
console.log("finished");
})
.stream().pipe(res);
});It works nicely, it is fast, but too fast, the audio is played at the same speed, however the video does not respect the frame rate, whatever is recieved from ffmpeg is immeidately shown, fastly. Additionally, it does not show the total time, I believe it is the problem. I need to somehow specify the length, framerate, but I could not find enough information on that. I thought the stream recieved from ffmpeg should contain that. And I could not find respective headers for that in HTTP.
Here are the flags that this stream-transcoder module uses for MP4 :
[ '-i',
'-',
'-vf',
'scale=min(trunc(1280/hsub)*hsub\\,trunc(a*720/hsub)*hsub):min(trunc(720/vsub)*vsub\\,trunc(1280/a/vsub)*vsub)',
'-vcodec',
'h264',
'-b:v',
800000,
'-r',
25,
'-ar',
44100,
'-ac',
2,
'-ab',
128000,
'-f',
'mp4',
'-movflags',
'frag_keyframe+faststart',
'pipe:1' ]When I use VP8 encoder and WebM, it works nicely, the time is displayed, video plays normal speed.