
Recherche avancée
Autres articles (67)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
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 (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.
Sur d’autres sites (4640)
-
Android javacv FFMpeg overlay animated gif over video
5 avril 2019, par Diego PerezI’m developing an Android app that creates a video (from an image plus an mp3 file) with javacv and FFMpeg and the video generation part is working fine, but my problem comes now that I would like to overlap a transparent background animated gif over the video, and I’m really stuck with it and I have no success on every attempt so far.
To be honest it is being my first experience with javacv and FFMpeg, so I have little knowledge on how to work with filters.
I’ll paste my complete video creation method below and let’s see if anyone can help me. Again, my problem is overlapping the animated gif, the video (removing the filter part) is being created just fine. The most I was able to achieve is overlapping a static (one frame) small gif (with no transparency) on the top left corner of video, but what I’d like to achieve is a transparent gif with the same dimensions of video over it.
Maybe you will see nonsense code, but remember this is due to my lack of knowledge with javacv and FFMpeg filters.
I hope anyone can help me.
Thanks.
PS. I have read this post : javaCV Android, Strange colors on overlay while streaming to rtmp server
of @schw4ndi but I wasn’t able to do anything with it.
static String recordVideo(JSONObject objJSON) {
try {
fileName = objJSON.has("file_name") ? String.valueOf(objJSON.getString("file_name")) : "";
videoPath = objJSON.has("video_path") ? String.valueOf(objJSON.getString("video_path")) : "";
} catch (JSONException e) {
ExceptionHandler.logException(e);
}
String strReturn = Enum.Result.OK;
if (!fileName.equals("") && !videoPath.equals("")) {
try {
String outputFilename = videoPath + "/" + fileName;
//video grabber
FrameGrabber grabber1 = new FFmpegFrameGrabber(outputFilename + ".jpg");
//audio grabber
FrameGrabber grabber2 = new FFmpegFrameGrabber(outputFilename + ".mp3");
grabber1.start();
grabber2.start();
FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(outputFilename + ".mp4", 1080, 1920,2);
//video
recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
recorder.setVideoOption("tune", "zerolatency");
recorder.setFrameRate(30);
recorder.setVideoBitrate(128000);
recorder.setVideoOption("crf", "28");
recorder.setVideoQuality(0); //highest quality
recorder.setVideoOption("preset", "fast");
recorder.setFormat("mp4");
//audio
recorder.setAudioCodec(avcodec.AV_CODEC_ID_AAC);
recorder.setSampleRate(44100);
recorder.setAudioBitrate(128000);
recorder.setAudioOption("crf", "0"); //no variable bitrate audio (constant rate factor)
recorder.setAudioQuality(0); //highest quality
FFmpegFrameFilter filter = null;
try{
filter = new FFmpegFrameFilter("movie=" + videoPath + "/anim01.gif [logo];[in][logo]overlay=0:0:format=yuv420 [out]",1080, 1920);
filter.start();
}catch (FrameFilter.Exception e){
e.printStackTrace();
}
recorder.start();
Frame frame1, frame2 = null, frame3 = null;
while ((frame1 = grabber1.grabFrame()) != null ||
(frame2 = grabber2.grabFrame()) != null) {
if (frame1 != null) filter.push(frame1);
frame3 = filter.pull();
//recorder.record(frame1);
recorder.record(frame3, avutil.AV_PIX_FMT_YUV420P);
recorder.record(frame2, avutil.AV_PIX_FMT_YUV420P);
}
recorder.stop();
grabber1.stop();
grabber2.stop();
filter.stop();
} catch (Exception e) {
strReturn = Enum.Result.KO;
ExceptionHandler.logException(e);
}
}
return strReturn;
} -
How to encode jpeg images to H264 very fast (transform images to video)
26 février, par PaulI have 30 JPEG images (.jpg) at a resolution of 480 x 640.
Each image takes aboout 20KB (all of them takes about 600KB).



I am using FFmpeg command to encode these images into a video in H264 format.



I need this to be done very fast - about 1 second.



Using the classic command :



ffmpeg -y -f image2 -r 1/5 -i image_%d.jpg -c:v libx264 -r 30 video.mp4




takes about 90 seconds.



After adding
-preset ultrafast
:


ffmpeg -y -f image2 -r 1/5 -i image_%d.jpg -c:v libx264 -preset ultrafast -r 30 video.mp4




the encoding takes about 15 seconds which is much better, but still not enough



I've tried others parameters also, like :



-profile:v baseline

-qscale:v

-b:v 1000k

-crf 24




but the encoding time does not fall below 10 seconds.



I'm not familiar with FFmpeg commands nor with the parameters I need to use, and this is the reason I post here this question.



The video quality needs to be ok, doesn't need to be perfect.



As a note : I am running these commands in an Android application where I have the ffmpeg executable, using an ProcessBuilder.



Reply1 (to Robert Rowntree) :



ArrayList<string> l2 = new ArrayList<string>();

 //l2.add("ffmpeg");
 l2.add("/data/data/" + packageName + "/ffmpeg");
 l2.add("-y");
 l2.add("-loop");
 l2.add("1");

 l2.add("-i");
 l2.add("frame_%d.jpg");

// l2.add("-t");
// l2.add(strngs[3]);

 l2.add("-r");
 l2.add("1/2");
 l2.add("-preset");
 l2.add("superfast");
 l2.add("-tune");
 l2.add("zerolatency");

// l2.add("-pass");
// l2.add(Integer.valueOf(pass).toString());

 l2.add("-vcodec");
 l2.add("libx264");
 l2.add("-b:v");
 l2.add("200k");
 l2.add("-bt");
 l2.add("50k");
 l2.add("-threads");
 l2.add("0");
 l2.add("-b_strategy");
 l2.add("1");

// if(pass ==1){
// l2.add("-an");
// } else {
// l2.add("-acodec");
// l2.add("copy");
// }

 l2.add("-f");
 l2.add("mp4");
 l2.add("-strict");
 l2.add("-2");
// l2.add("-passlogfile");
// l2.add(strngs[4]);

// if(pass ==1){
// l2.add("/dev/null");
// } else {
// l2.add(strngs[5]);
// }

 l2.add("video.mp4");
 //return l2;
</string></string>


-
FFmpeg auto rotates video when only copying stream
8 mars 2019, par TahlilI am facing this issue while converting mp4 (portrait) file to mkv. The command I’m using
ffmpeg -y -i test.mp4 -vcodec copy -acodec copy test.mkv
The output video is 90 degree counter clockwise rotated. Its because I think the side data is being removed.
Side data:
displaymatrix: rotation of -90.00 degreesInput file
test.mp4
infoInput #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2019-02-23T11:18:50.000000Z
com.android.version: 8.0.0
Duration: 00:00:25.86, start: 0.000000, bitrate: 12270 kb/s
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 12005 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 90
creation_time : 2019-02-23T11:18:50.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)
Metadata:
creation_time : 2019-02-23T11:18:50.000000Z
handler_name : SoundHandleRotated output file
test.mkv
infoInput #0, matroska,webm, from 'test.mkv':
Metadata:
MAJOR_BRAND : mp42
MINOR_VERSION : 0
COMPATIBLE_BRANDS: isommp42
COM.ANDROID.VERSION: 8.0.0
ENCODER : Lavf58.12.100
Duration: 00:00:25.87, start: 0.000000, bitrate: 12265 kb/s
Stream #0:0(eng): Video: h264, yuv420p(tv, bt709, progressive), 1280x720, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn, 2k tbc (default)
Metadata:
ROTATE : 90
HANDLER_NAME : VideoHandle
DURATION : 00:00:25.866000000
Stream #0:1(eng): Audio: aac, 48000 Hz, stereo, fltp (default)
Metadata:
HANDLER_NAME : SoundHandle
DURATION : 00:00:25.813000000Converting the rotated mkv to mp4 again works fine and I get the portrait file. The displaymatrix side data appears again in the file info.
Also converting the same mp4 file to m4v by copying the stream works fine.
In this post they solved it for c++. I am working on android and using ffmpeg android wrapper to use the ffmpeg library. Is there any ffmpeg flag to handle this situation ?