
Recherche avancée
Autres articles (60)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
Sélection de projets utilisant MediaSPIP
29 avril 2011, parLes exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
Ferme MediaSPIP @ Infini
L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)
Sur d’autres sites (5673)
-
I am trying add text and image over video using FFmpeg lib in androoid studio
21 juin 2019, par vikramI am using FFmpeg lib for add text over video and add image over video but could not get successful. I am testing this one in a real device.
I am have already tried 2 commands for add text and add image over video but could not get proper output
String command[]={"ffmpeg","-i",inputpath,"-vf", "drawtext="+"\""+"fontfile=/sdcard/retro.ttf: text='Test Text'"+"\"",outputpath};
String addimg[]={"ffmpeg","-i", inputpath,"-i", imagepath ,"-filter_complex", "[0:v][1:v] overlay=25:25:enable='between(t,0,10)'" ,"-pix_fmt", "yuv420p", "-c:a copy",outputpath};
public void LoadFFmpegLibrary()
{
if(ffmpeg==null)
{
ffmpeg = FFmpeg.getInstance(MainActivity.this);
try {
ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
@Override
public void onStart() {
Log.e("ffmpeg","Start to load");
}
@Override
public void onFailure() {
Log.e("ffmpeg","failed to load");
}
@Override
public void onSuccess() {
Log.e("ffmpeg","load Successfully");
ExcuteFfmpefLibrabry(command);
// Toast.makeText(MainActivity.this,"Success",Toast.LENGTH_LONG).show();
}
@Override
public void onFinish() {
Log.e("ffmpeg","failed to load");
}
});
} catch (FFmpegNotSupportedException e) {
// Handle if FFmpeg is not supported by device
Log.e("ffmpeg",e.toString());
}
}
}
public void ExcuteFfmpefLibrabry(String command[])
{
ffmpeg = FFmpeg.getInstance(MainActivity.this);
try {
// to execute "ffmpeg -version" command you just need to pass "-version"
ffmpeg.execute(command, new ExecuteBinaryResponseHandler() {
@Override
public void onStart() {
Log.e("ffmpeg","Exaction Start");
}
@Override
public void onProgress(String message) {}
@Override
public void onFailure(String message) {
Log.e("ffmpeg","failed to Excute Command");
Log.e("ok",message);
}
@Override
public void onSuccess(String message) {
Log.e("ffmpeg","Video Edited Successfully");
Log.e("ok",message);
// ExcuteFfmpefLibrabry(tetxcommand);
Toast.makeText(MainActivity.this,"Success",Toast.LENGTH_LONG).show();
}
@Override
public void onFinish() {
}
});
} catch (FFmpegCommandAlreadyRunningException e) {
Log.e("ffmpeg",e.toString());
}
}Unable to find a suitable output format for ’ffmpeg’
ffmpeg : Invalid argumentI am getting an error --->
Unable to find a suitable output format for 'ffmpeg' ffmpeg: Invalid argument
-
ffprobe can not read a file generated by node JS createWriteStream() on AWS
30 septembre 2016, par matthiasdvI have a setup running on AWS that triggers an AWS Lambda function when a video file is uploaded to an S3 bucket. The Lambda function is written in node and downloads the file, streams it to a temp working file and then executes ffprobe on it followed by an ffmpeg command.
ffprobe throws the following error :
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x4ea8e20] error reading header download: Invalid data found when processing input
The bug is hard to reproduce and occurs only half the time, which I believe to be because of the async nature of the program.
My main function is as follows
downloadFile(library.getDownloadStream, logger, sourceLocation, localFilePath)
.then(() => ffprobe(logger))
.then(() => ffmpeg(logger, keyPrefix))
.then(() => removeDownload(logger, localFilePath))
.then(() => uploadFiles(library.uploadToBucket, logger, keyPrefix))
.then(data => invocation.callback())
.catch(error => invocation.callback(error));The ffprobe Function :
function downloadFile(downloadFunc, logger, sourceLocation, download) {
return new Promise((resolve, reject) => {
logger.log(`Starting download: ${sourceLocation.bucket} / ${sourceLocation.key}`);
var downloadFile = createWriteStream(download);
downloadFunc(sourceLocation.bucket, sourceLocation.key)
.on('end', () => {
logger.log("closing writing stream");
downloadFile.end();
logger.log('Download finished');
resolve();
})
.on('error', reject)
.pipe(downloadFile);
});
}Each build/update uploads the latest ffmpeg version to AWS. I can not reproduce this error locally.
Why is ffprobe throwing this error regarding the header ?
Update
Logging the downloaded file’s filesize prints exactly the same amount of bytes, regardless of wether ffprobe is successful or not.
However, when I set a timeOut before resolving the promise, the bug no longer occurs and ffprobe runs successfully each time :
downloadFunc(sourceLocation.bucket, sourceLocation.key)
.on('end', () => {
logger.log('Download finished');
// Filesize
var meta = fs.statSync(download);
var fileSizeInBytes = meta["size"];
logger.log(fileSizeInBytes);
// resolve();
setTimeout(resolve, 1000);
})
.on('error', reject)
.pipe(downloadFile);Why is this happening ?
-
mp4 video file generated using ffmpeg, works on desktop but doesn't work on android emulator
8 mai 2014, par NikeshI am generating a video that converts images into .mp4 video file. Every thing works fine. File is also generated as mp4 but the file doesn’t run on android device, says cannot play video.
Please find the attached sample code which convert single jpeg file into video (.mp4)
Please help me to resolve this issue. Thanks.
JNIEXPORT void JNICALL Java_roman10_ffmpegtst_VideoBrowser_videoExample(JNIEnv *pEnv, jobject pObj, char* imagefile,char* videoFile)
{
avcodec_init();
av_register_all();
avcodec_register_all();
AVCodecContext *pOCtx= NULL;
AVCodec *pOCodex = NULL;
LOGE(10,"Start videoExample");
pOCodex = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);
if (!pOCodex) {
LOGE(10,"Cannot find encoder %s", pOCodex);
exit(1);
}
pOCtx= avcodec_alloc_context3(pOCodex);
uint8_t *outbuf;
int i, out_size;
pOCtx->bit_rate = 400000;
pOCtx->width = 640;
pOCtx->height = 480;
AVRational rational = {1,25};
pOCtx->time_base= rational;
pOCtx->gop_size = 10; /* emit one intra frame every ten frames */
pOCtx->max_b_frames=1;
pOCtx->pix_fmt = AV_PIX_FMT_YUV420P;
LOGE(10,"Start avcodec_open2");
int ret = avcodec_open2(pOCtx,pOCodex,NULL);
if(ret < 0)
{
return;
}
LOGE(10,"End avcodec_open2");
AVFormatContext *pIFormatCtx = NULL;
ret = avformat_open_input(&pIFormatCtx, imagefile, NULL, NULL);
if(ret < 0)
{
//Cant't open jpg file
return;
}
av_dump_format(pIFormatCtx, 0, imagefile, 0);
AVCodecContext *pICodecCtx; //output codec context
pICodecCtx = pIFormatCtx->streams[0]->codec;
/*pICodecCtx->width = 640;
pICodecCtx->height = 480;
pICodecCtx->pix_fmt = PIX_FMT_YUV420P;*/
AVCodec *pICodec = avcodec_find_decoder(pICodecCtx->codec_id); //output codec
// Open codec
ret = avcodec_open2(pICodecCtx, pICodec,NULL);
if(ret < 0)
{
//Can't find the decoder
return;
}
AVFrame *pIFrame = avcodec_alloc_frame();
if (!pIFrame)
{
//Can't alloc the input frame
return ;
}
int bufSize = avpicture_get_size(AV_PIX_FMT_YUVJ420P, pICodecCtx->width, pICodecCtx->height);
uint8_t *buffer = (uint8_t *) av_malloc(bufSize * sizeof(uint8_t));
avpicture_fill((AVPicture *) pIFrame, buffer, AV_PIX_FMT_YUVJ420P, pICodecCtx->width, pICodecCtx->height);
FILE *outputFile;
outputFile = fopen(videoFile, "w+");
if (!outputFile) {
LOGE(10,"could not open ");
exit(1);
}
int outbuf_size = 100000;
outbuf = (uint8_t*)malloc(outbuf_size);
AVPacket packet;
int frameFinished;
int framesNumber = 0;
while (av_read_frame(pIFormatCtx, &packet) >= 0)
{
if(packet.stream_index != 0)
continue;
ret = avcodec_decode_video2(pICodecCtx, pIFrame, &frameFinished, &packet);
if (ret > 0)
{
pIFrame->quality = 4;
for(i=0;i<25;i++) {
fflush(stdout);
/* encode the image */
out_size = avcodec_encode_video(pOCtx, outbuf, outbuf_size, pIFrame);
fwrite(outbuf, 1, out_size, outputFile);
}
}
}
/* get the delayed frames */
for(; out_size; i++) {
fflush(stdout);
out_size = avcodec_encode_video(pOCtx, outbuf, outbuf_size, NULL);
fwrite(outbuf, 1, out_size, outputFile);
}
/* add sequence end code to have a real mpeg file */
outbuf[0] = 0x00;
outbuf[1] = 0x00;
outbuf[2] = 0x01;
outbuf[3] = 0xb7;
fwrite(outbuf, 1, 4, outputFile);
fclose(outputFile);
free(outbuf);
avcodec_close(pOCtx);
av_free(pOCtx);
av_free(pIFrame);
}