
Recherche avancée
Autres articles (104)
-
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 (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (11434)
-
Recording real-time video from images with FFmpeg
17 juillet 2015, par SolarnumI am really not sure what else I could be doing to achieve this. I’m trying to record the actions in one of the views in my Android app so that it can be played back later and show the previous actions in real time. The major problem (among others, because there is no way I’m doing this optimally) is that the video takes at least 4 times longer to make than it does to playback. If I ask FFmpeg to create a 5 second video the process will run in the background for 20 seconds and output a greatly accelerated 5 second video.
My current strategy is to use the
-loop 1
parameter on a single image file and continuously write a jpeg to that image file. (If someone has a better idea than this for feeding continuously updated image information to FFmpeg let me know)encodingThread = new Thread(new Runnable() {
private boolean running = true;
@Override
public void run() {
while (running) {
try {
Bitmap bitmap = makeBitmapFromView();
String filepath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/test.jpg";
File file = new File(filepath);
FileOutputStream fout = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fout);
fout.flush();
fout.close();
Thread.sleep(50);
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
running = false;
}
}
}
});
startVideoMaking();
encodingThread.start();The startVideoMaking method is as follows :
private void startVideoMaking(){
ffmpeg.killRunningProcesses();
File outputFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/testout.mp4");
String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/test.jpg";
String output = Environment.getExternalStorageDirectory().getAbsolutePath() + "/testout.mp4";
String command = "-loop 1 -t 5 -re -i " + path + " -c:v libx264 -loglevel verbose -vsync 0 -threads 0 -preset ultrafast -tune zerolatency -y -pix_fmt yuv420p " + output;
executeFFM(command);
}Just to make it clear, the FFmpeg command that I am executing is
ffmpeg -loop 1 -re -i /storage/emulated/0/test.jpg -t 5 -c:v libx264 -loglevel verbose -vsync 0 -threads 0 -preset ultrafast -tune zerolatency -y -pix_fmt yuv420p /storage/emulated/0/testout.mp4
The
makeBitmapFromView()
method takes about 50ms to process and writing the bitmap to the sd card takes around 200ms, which is not great.I’m pretty lost as to what other solutions there would be to creating a video of a single view in Android. I know there is the MediaCodec class, but I couldn’t get that to work and also it would raise my minimum sdk, which is not ideal. I’m also not sure that the MediaCodec class would even solve my problem.
Is there some way that I can get FFmpeg to create a 5 second video that is equivalent to 5 seconds of real time ? I have also tried converting a single image, without updating it’s content continuously and had the same results.
If my question isn’t clear enough let me know.
-
lavc : disable an obsolete hack for real video
20 février 2023, par Anton Khirnovlavc : disable an obsolete hack for real video
AVCodecContext.slice_count,offset are unneeded since 2007, commit
383b123ed37df4ff99010646f1fa5911ff1428cc and following. Deprecate those
fields. -
How can i crop part of a video while recording from desktop in real time using ffmpeg ? [on hold]
28 juillet 2017, par daniel lleeI’m using this line to record from the desktop to a video file :
ffmpeg -f gdigrab -framerate 24 -i desktop -preset ultrafast -pix_fmt yuv420p out.mp4
But this will record the whole desktop. Is there any way to record in real time only specific area/part of the desktop ?
And this is how i’m using the ffmpeg with winforms :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;
namespace Ffmpeg_App
{
class Ffmpeg
{
Process process;
public void Start(string FileName, int Framerate)
{
process = new System.Diagnostics.Process();
process.StartInfo.FileName = @"D:\ffmpegx86\ffmpeg.exe"; // Change the directory where ffmpeg.exe is.
process.EnableRaisingEvents = false;
process.StartInfo.WorkingDirectory = @"D:\ffmpegx86"; // The output directory
process.StartInfo.Arguments = @"-f gdigrab -framerate " + Framerate + " -i desktop -preset ultrafast - pix_fmt yuv420p " + FileName;
process.Start();
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = false;
Close();
}
public void Close()
{
process.Close();
}
}
}