
Recherche avancée
Autres articles (89)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
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 (...) -
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.
Sur d’autres sites (9640)
-
c++ avformat_open_input returns empty codec, width and height
27 février 2019, par Victor AkhlyninI haven’t ever used ffmpeg on my own laptop. All’s ok at work, but here I met an ugly problem : library works but helpless :)
Ubuntu 18.04, ffmpeg 4.1 (downloaded sources, ./configure, make, sudo make install), it seems to be ok.Application returns :
File /home/ahlininv/Desktop/video_example.mp4 is encodec with ’’ codec, w = 0, h = 0I ran it under debugger. If I set format to zero, pointer changes after calling avformat_open_input(&format, file, 0, &dict), so it works and maybe works correct.
Maybe it plays any role that compiler says that av_register_all, avcodec_register_all are deprecated, but I thought it’s not significant problem.
I tried to change version of ffmpeg (tried to install it with apt-get, version 3.somenumber is available), nothing changed.
I tried to run another video file (.avi), nothing changed, too.
Guys, help=) How to this file’s info correctly ?
main.cpp :
#include "filereader.h"
int main(int argc, char** argv) {
std::string filename = "/home/ahlininv/Desktop/video_example.mp4";
std::string codec;
int w, h;
bool open_ok = get_file_info(filename.c_str(), codec, w, h);
if (!open_ok) {
std::cout << "Failed to open file" << "\n";
return 1;
}
std::cout << "File " << filename << " is encoded with '" << codec << "' codec, w = " << w << ", h = " << h << "\n";
return 0;
}filereader.h :
#ifndef FILEREADER_H
#define FILEREADER_H
#include <string>
#include <iostream>
extern "C" {
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#include "libavcodec/avcodec.h"
#include <libavformat></libavformat>avformat.h>
#include <libavutil></libavutil>avutil.h>
}
bool get_file_info(const char* file, std::string& codec, int& w, int& h);
#endif // FILEREADER_H
</iostream></string>filereader.cpp
#include "filereader.h"
bool get_file_info(const char* file, std::string& codec, int& w, int& h)
{
codec = "";
w = h = 0;
av_register_all();
avcodec_register_all();
AVDictionary* dict = 0;
AVFormatContext* format = avformat_alloc_context();
char errbuf[256];
int r = avformat_open_input(&format, file, 0, &dict);
if (r!=0){
av_strerror(r, errbuf, sizeof(errbuf));
std::cout << "avformat_open_input error: " << errbuf << "\n";
}
if (r == AVERROR(EIO) || r == AVERROR(ENOEXEC) || !format)
return false;
for (size_t c = 0; c < format->nb_streams; ++c)
{
if (format->streams[c]->codecpar && format->streams[c]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
{
if (format->streams[c]->codecpar->codec_id != AV_CODEC_ID_NONE &&
format->streams[c]->codecpar->codec_id != AV_CODEC_ID_RAWVIDEO)
{
w = format->streams[c]->codecpar->width;
h = format->streams[c]->codecpar->height;
codec = avcodec_get_name(format->streams[c]->codecpar->codec_id);
}
}
}
avformat_close_input(&format);
return true;
}Compile :
g++ -o filereader main.cpp filereader.cpp -lavutil -lavformat -lavcodec -lavdevice -lz -lm -pthread -lswresample -lm -lz -I /usr/local/include/ -Wl,-rpath /usr/lib/x86_64-linux-gnu/
-
FFMpeg avformat_write_header always returns 0
24 octobre 2015, par gabe.rozeWe’ve asked a freelancer to build a video encoder with FFMPeg for iOS but there is a bug and the freelancer is no longer available. I very inexperienced in FFMpeg and video encoding and am trying to debug this error.
From what I understand, we’re attempting to create an output file and create a header for it however, avformat_write_header is always less than zero. If I comment it out, it does not work
- (BOOL) writeHeaderWithError:(NSError *__autoreleasing *)error {
AVDictionary *options = NULL;
// Write header for output file
int writeHeaderValue = avformat_write_header(self.formatContext, &options);
if (writeHeaderValue < 0) {
if (error != NULL) {
*error = [FFUtilities errorForAVError:writeHeaderValue];
}
av_dict_free(&options);
return NO;
}
av_dict_free(&options);
return YES;
}Below is some relevant code of how we instantiate a FFOutputFile
- (AVFormatContext*) formatContextForOutputPath:(NSString*)outputPath options:(NSDictionary*)options {
AVFormatContext *outputFormatContext = NULL;
NSString *outputFormatString = [options objectForKey:kFFmpegOutputFormatKey];
int openOutputValue = avformat_alloc_output_context2(&outputFormatContext, NULL, [outputFormatString UTF8String], [outputPath UTF8String]);
if (openOutputValue < 0) {
avformat_free_context(outputFormatContext);
return nil;
}
return outputFormatContext;
}
- (void) addOutputStream:(FFOutputStream*)outputStream {
[self.streams addObject:outputStream];
}
- (id) initWithPath:(NSString *)path options:(NSDictionary *)options {
if (self = [super initWithPath:path options:options]) {
self.formatContext = [self formatContextForOutputPath:path options:options];
self.streams = [NSMutableArray array];
self.bitstreamFilters = [NSMutableSet set];
}
return self;
} -
FFMpeg avformat_write_header always returns < 0
7 mai 2024, par gabe.rozeWe've asked a freelancer to build a video encoder with FFMPeg for iOS but there is a bug and the freelancer is no longer available. I very inexperienced in FFMpeg and video encoding and am trying to debug this error.



From what I understand, we're attempting to create an output file and create a header for it however, avformat_write_header is always less than zero. If I comment it out, it does not work



- (BOOL) writeHeaderWithError:(NSError *__autoreleasing *)error {
 AVDictionary *options = NULL;

 // Write header for output file
 int writeHeaderValue = avformat_write_header(self.formatContext, &options);
 if (writeHeaderValue < 0) {
 if (error != NULL) {
 *error = [FFUtilities errorForAVError:writeHeaderValue];
 }
 av_dict_free(&options);
 return NO;
 }
 av_dict_free(&options);
 return YES;
}




Below is some relevant code of how we instantiate a FFOutputFile



- (AVFormatContext*) formatContextForOutputPath:(NSString*)outputPath options:(NSDictionary*)options {
 AVFormatContext *outputFormatContext = NULL;
 NSString *outputFormatString = [options objectForKey:kFFmpegOutputFormatKey];

 int openOutputValue = avformat_alloc_output_context2(&outputFormatContext, NULL, [outputFormatString UTF8String], [outputPath UTF8String]);
 if (openOutputValue < 0) {
 avformat_free_context(outputFormatContext);
 return nil;
 }
 return outputFormatContext;
}

- (void) addOutputStream:(FFOutputStream*)outputStream {
 [self.streams addObject:outputStream];
}

- (id) initWithPath:(NSString *)path options:(NSDictionary *)options {
 if (self = [super initWithPath:path options:options]) {
 self.formatContext = [self formatContextForOutputPath:path options:options];
 self.streams = [NSMutableArray array];
 self.bitstreamFilters = [NSMutableSet set];
 }
 return self;
}