
Recherche avancée
Autres articles (37)
-
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
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 (8455)
-
Validation failed : Video Paperclip::Errors::NotIdentifiedByImageMagickError
28 mars 2017, par ACIDSTEALTHI have a model with an attached video. I want to create a scaled version of the video along with a series of thumbnails. I have the following setup :
has_attached_file :video,
styles: {
original: { format: 'mp4', processors: [:transcoder] },
large: { geometry: "720x720", format: 'jpg', processors: [:thumbnail] },
medium: { geometry: "540x540", format: 'jpg', processors: [:thumbnail] },
thumb: { geometry: "180x180", format: 'jpg', processors: [:thumbnail] }
},
default_url: ""When I test this in my development environment it works perfectly. The video and all images are correctly sized. When I deploy to Heroku however, I get the following error :
Validation failed: Video Paperclip::Errors::NotIdentifiedByImageMagickError
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/validations.rb:78:in `raise_validation_error'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/validations.rb:50:in `save!'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/attribute_methods/dirty.rb:30:in `save!'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/transactions.rb:324:in `block in save!'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/transactions.rb:395:in `block in with_transaction_returning_status'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `block in transaction'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/transaction.rb:189:in `within_new_transaction'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:232:in `transaction'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/transactions.rb:211:in `transaction'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/transactions.rb:392:in `with_transaction_returning_status'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/transactions.rb:324:in `save!'
/app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/suppressor.rb:45:in `save!'
/app/app/models/concerns/snapshot_methods.rb:37:in `copy_from_ziggeo!'
/app/app/workers/snapshot_transcoder.rb:16:in `perform'
/app/vendor/bundle/ruby/2.3.0/gems/resque-status-0.5.0/lib/resque/plugins/status.rb:161:in `safe_perform!'
/app/vendor/bundle/ruby/2.3.0/gems/resque-status-0.5.0/lib/resque/plugins/status.rb:137:in `perform'What am I missing here ? I’ve searched for
NotIdentifiedByImageMagickError
and scanned numerous other questions on this issue, but have not had any success fixing my problem.Most of the solutions I’ve seen involve setting
Paperclip.options[:command_path] = "/usr/bin/identify"
in development. Since my problem is only on production, I tried applying this to production, subbing in the correct path for my production environment, like so :Paperclip.options[:command_path] = "/app/vender/imagemagick/bin/identify"
This had no effect. Neither did
/app/vender/imagemagick/bin
. -
How to improve the performance of Audio Queue Services when playing audio ?
11 décembre 2014, par 谢小进I want to play
RTMP
’sH.264
/AAC
usingFFmpeg
for decoding and playing video,Audio Queue Services
for playing audio. I have successfully done them all, but still some tough issues, for example high memory allocation when playing audio. I have debugged and found thatAudio Queue Services
lead to high memory allocation, and then crash ! Does anybody know how to improve the memory performance ? Here is my code forAudio Queue Services
playing audio.//
// RTMPAudioPlayer.h
//
#import <foundation></foundation>Foundation.h>
#import <audiotoolbox></audiotoolbox>AudioToolbox.h>
@interface AQBuffer : NSObject
@property (nonatomic) AudioQueueBufferRef buffer;
@end
@interface RTMPAudioPlayer : NSObject {
AudioQueueRef queue;
AudioStreamBasicDescription dataFormat;
NSMutableArray *buffers;
NSMutableArray *reusableBuffers;
}
- (id)initWithSampleRate:(int)sampleRate channels:(int)channels bitsPerChannel:(int)bitsPerChannel;
- (void)start;
- (void)stop;
- (void)putData:(NSData *)data;
@end
//
// RTMPAudioPlayer.m
//
#import "RTMPAudioPlayer.h"
static const int kNumberBuffers = 3;
static const int kBufferSize = 0xA000;
@implementation AQBuffer
@end
@implementation RTMPAudioPlayer
void AQOutputCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inCompleteAQBuffer) {
RTMPAudioPlayer *THIS = (__bridge RTMPAudioPlayer *)inUserData;
[THIS handleAQOutputCallback:inAQ buffer:inCompleteAQBuffer];
}
- (void)handleAQOutputCallback:(AudioQueueRef)audioQueue buffer:(AudioQueueBufferRef)buffer {
for (int i = 0; i < [buffers count]; ++i) {
if (buffer == [buffers[i] buffer]) {
[reusableBuffers addObject:buffers[i]];
break;
}
}
}
- (id)initWithSampleRate:(int)sampleRate channels:(int)channels bitsPerChannel:(int)bitsPerChannel {
self = [super init];
if (self) {
memset(&dataFormat, 0, sizeof(dataFormat));
dataFormat.mSampleRate = sampleRate;
dataFormat.mFormatID = kAudioFormatLinearPCM;
dataFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked;
dataFormat.mBitsPerChannel = bitsPerChannel;
dataFormat.mChannelsPerFrame = channels;
dataFormat.mFramesPerPacket = 1;
dataFormat.mBytesPerFrame = (dataFormat.mBitsPerChannel / 8) * dataFormat.mChannelsPerFrame;
dataFormat.mBytesPerPacket = dataFormat.mBytesPerFrame * dataFormat.mFramesPerPacket;
}
return self;
}
- (void)start {
OSStatus status = AudioQueueNewOutput(&dataFormat, AQOutputCallback, (__bridge void *)self, NULL, NULL, 0, &queue);
if (status == noErr) {
buffers = [NSMutableArray array];
reusableBuffers = [NSMutableArray array];
for (int i = 0; i < kNumberBuffers; i++) {
AudioQueueBufferRef buffer;
status = AudioQueueAllocateBuffer(queue, kBufferSize, &buffer);
if (status == noErr) {
AQBuffer *bufferObj = [[AQBuffer alloc] init];
bufferObj.buffer = buffer;
[buffers addObject:bufferObj];
[reusableBuffers addObject:bufferObj];
} else {
AudioQueueDispose(queue, true);
queue = NULL;
break;
}
}
AudioQueueStart(queue, NULL);
} else {
queue = NULL;
}
}
- (void)stop {
if (queue) {
AudioQueueStop(queue, true);
}
}
- (void)putData:(NSData *)data {
AQBuffer *bufferObj = [reusableBuffers firstObject];
[reusableBuffers removeObject:bufferObj];
AudioQueueBufferRef buffer;
OSStatus status = AudioQueueAllocateBuffer(queue, kBufferSize, &buffer);
if (status == noErr) {
bufferObj = [[AQBuffer alloc] init];
bufferObj.buffer = buffer;
memcpy(bufferObj.buffer->mAudioData, [data bytes], [data length]);
bufferObj.buffer->mAudioDataByteSize = [data length];
AudioQueueEnqueueBuffer(queue, bufferObj.buffer, 0, NULL);
}
}
@end -
avformat/mxfdec : Don't pretend array to be bigger than it is
11 septembre 2023, par Andreas Rheinhardtavformat/mxfdec : Don't pretend array to be bigger than it is
mxf_match_uid() accepts two const UID and a len parameter.
UID is a typedef for an array of 16 uint8_t, so the const UID
parameter is actually a pointer to const uint8_t.The point of mxf_match_uid() is to check whether the initial
part of two UIDs match ; the length of said part is given
by the len parameter. Once an incomplete UID has been passed
to mxf_match_uid() (albeit with the correct len, so safe),
which makes GCC emit -Wstringop-overread warnings.Fix this by using a const uint8_t[] as type ; it is more
natural for incomplete UIDs.Reviewed-by : Tomas Härdin <git@haerdin.se>
Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>