
Recherche avancée
Autres articles (53)
-
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 (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
Sur d’autres sites (7687)
-
FFmpeg api iOS "Resource temporarily unavailable"
8 octobre 2017, par Julius NaeumannI’ve spent hours trying to fix this :
I’m trying to use the ffmpeg api on iOS. My Xcode project is building and I can call ffmpeg api functions. I am trying to write code that decodes a video (Without outputting anything for now), and I keep getting error -35 : "Resource temporarily unavailable".
The input file is from the camera roll (.mov) and I’m using Mpeg-4 for decoding. All I’m currently doing is getting data from the file, parsing it and sending the parsed packets to the decoder. When I try to get frames, all I get is an error. Does anyone know what I’m doing wrong ?
+(void)test: (NSString*)filename outfile:(NSString*)outfilename {
/* register all the codecs */
avcodec_register_all();
AVCodec *codec;
AVCodecParserContext *parser;
AVCodecContext *c= NULL;
int frame_count;
FILE* f;
AVFrame* frame;
AVPacket* avpkt;
avpkt = av_packet_alloc();
//av_init_packet(avpkt);
char buf[1024];
uint8_t inbuf[INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
uint8_t *data;
size_t data_size;
/* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE);
printf("Decode video file %s to %s\n", [filename cStringUsingEncoding:NSUTF8StringEncoding], [outfilename cStringUsingEncoding:NSUTF8StringEncoding]);
/* find the h264 video decoder */
codec = avcodec_find_decoder(AV_CODEC_ID_MPEG4);
if (!codec) {
fprintf(stderr, "Codec not found\n");
exit(1);
}
c = avcodec_alloc_context3(codec);
if (!c) {
fprintf(stderr, "Could not allocate video codec context\n");
exit(1);
}
if (codec->capabilities & AV_CODEC_CAP_TRUNCATED)
c->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames
/* For some codecs, such as msmpeg4 and mpeg4, width and height
MUST be initialized there because this information is not
available in the bitstream. */
/* open it */
if (avcodec_open2(c, codec, NULL) < 0) {
fprintf(stderr, "Could not open codec\n");
exit(1);
}
f = fopen([filename cStringUsingEncoding:NSUTF8StringEncoding], "rb");
if (!f) {
fprintf(stderr, "Could not open %s\n", [filename cStringUsingEncoding:NSUTF8StringEncoding]);
exit(1);
}
frame = av_frame_alloc();
if (!frame) {
fprintf(stderr, "Could not allocate video frame\n");
exit(1);
}
frame_count = 0;
parser = av_parser_init(codec->id);
if (!parser) {
fprintf(stderr, "parser not found\n");
exit(1);
}
while (!feof(f)) {
/* read raw data from the input file */
data_size = fread(inbuf, 1, INBUF_SIZE, f);
if (!data_size)
break;
/* use the parser to split the data into frames */
data = inbuf;
while (data_size > 0) {
int ret = av_parser_parse2(parser, c, &avpkt->data, &avpkt->size, data, data_size, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);
if (ret < 0) {
fprintf(stderr, "Error while parsing\n");
exit(1);
}
data += ret;
data_size -= ret;
if (avpkt->size){
char buf[1024];
ret = avcodec_send_packet(c, avpkt);
if (ret < 0) {
fprintf(stderr, "Error sending a packet for decoding\n");
continue;
exit(1);
}
while (ret >= 0) {
ret = avcodec_receive_frame(c, frame);
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF){
char e [1024];
av_strerror(ret, e, 1024);
fprintf(stderr, "Fail: %s !\n", e);
// ~~~~~~~~ This is where my program exits ~~~~~~~~~~~~~~~~~~~~~~~~~~~
return;
}
else if (ret < 0) {
fprintf(stderr, "Error during decoding\n");
exit(1);
}
}
}
}
}
/* some codecs, such as MPEG, transmit the I and P frame with a
latency of one frame. You must do the following to have a
chance to get the last frame of the video */
fclose(f);
avcodec_close(c);
av_free(c);
av_frame_free(&frame);
printf("\n");}
-
How to avoid the "text relocation" error by ffmpeg library on Android x86
16 octobre 2017, par Tank2005My environment is Qt 5.9 for Android on Windows 10 64bit. NDK is r10e and SDK Level is 16(Those sdks are recommended version by Qt development team).
I built a ffmpeg 3.4 source code as .so files on Ubuntu 16.04.3 LTS. Those library has no error on ARM architecture Android. But, on x86 Emulator, "Text realocations" alart is shown like this.
I rewrite configure with "disable-asm, disable-yasm" referd from this site’s old posts.
This hereby removed some errors. But only one library has a problem.
I also tried the method of deleting "strtod.o", But it seems no effect. My current build configure is that. Does anyone know a better way ?
#!/bin/bash
NDK=/home/my/data/ndk
SYSROOT=$NDK/platforms/android-14/arch-x86/
TOOLCHAIN=$NDK/linux-x86-48
CPU=x86
PREFIX=$(pwd)/android/x86
PATH=$TOOLCHAIN/bin:$PATH
function build_one
{
./configure \
--cc="$TOOLCHAIN/bin/i686-linux-android-gcc-4.8" \
--enable-cross-compile \
--target-os=linux \
--arch=x86 \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-avdevice \
--disable-doc \
--disable-encoders \
--disable-decoders \
--enable-decoder=h264 \
--enable-decoder=aac \
--disable-protocols \
--disable-demuxers \
--disable-muxers \
--disable-filters \
--disable-network \
--disable-ffplay \
--disable-ffmpeg \
--disable-ffprobe \
--disable-ffserver \
--enable-parsers \
--cross-prefix=i686-linux-android- \
--enable-cross-compile \
--target-os=linux \
--arch=x86 \
--disable-doc \
--sysroot=$SYSROOT \
--disable-x86asm -disable-yasm --enable-pic \
--extra-cflags="-std=c99 -O3 -Wall -fpic -pipe -DANDROID -DNDEBUG -march=atom -msse3 -ffast-math -mfpmath=sse" \
--extra-ldflags='-lm -lz -Wl,--no-undefined -Wl,-z,noexecstack' \
$ADDITIONAL_CONFIGURE_FLAG
make clean
rm -f $(pwd)/compat/strtod.o
rm -f $(pwd)/compat/strtod.d
make
make install
}
build_one -
Detect if "faststart" has been applied to video
26 juin 2024, par Will AshworthWhen running "qt-faststart" on an MP4, you're essentially taking the meta data from the back and placing it at the front of the file. In my case, so Flash can properly start playing the video before it's fully done loading.



I have a large number of videos that I'm running through a shell script to encode overnight. When I upload, however, I won't necessarily know in my final folder of videos (on the server) have "qt-faststart" run on it.



My goal is to find the straggler videos and run qt-faststart on them manually, but I'll need a way to compile a list. Is there any way to check for this meta data information with PHP or something ? Wondering how I can tell if a video has already had qt-faststart run on it or not.