
Recherche avancée
Médias (2)
-
Core Media Video
4 avril 2013, par
Mis à jour : Juin 2013
Langue : français
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (106)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (12346)
-
avcodec/hevcdec : Add pointers to logctx and parent ctx to HEVCLocalCtx
29 juin 2022, par Andreas Rheinhardtavcodec/hevcdec : Add pointers to logctx and parent ctx to HEVCLocalCtx
It is safe for a slice thread to read the main context
and therefore it is safe to add a pointer to const HEVCContext
(namely the parent context) to each HEVCLocalContext.
It is also safe (and actually redundant) to add a pointer
to a logcontext to HEVCLocalContext.Doing so allows to pass the HEVCLocalContext as context in
the parts of the code that is run slice-threaded when slice-threading
is in use (currently these parts of the code use ordinary
HEVCContext*). This way one is not tempted to modify
the main context from the slice contexts.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
A process' child doesn't get killed from killing the parent process
2 avril 2022, par ImpasseI am developing an Electron application. In this application, I am spawning a Python process with a file's path as an argument, and the file itself is then passed to ffmpeg (through the ffmpeg-python module) and then goes through some Tensorflow functions.


I am trying to handle the case in which the user closes the Electron app while the whole background process is going. From my tests though, it seems like ffmpeg's process stays up no matter what. I'm on Windows and I'm looking at the task manager and I'm not sure what's going on : when closing the Electron app's window, sometimes ffmpeg.exe will be a single process, some other times it will stay in an Electron processes group.


I have noticed that if I kill Electron's process through closing the window, the python process will also close once ffmpeg has done its work, so I guess this is half-working. The problem is, ffmpeg is doing intensive stuff and if the user needs to close the window, then the ffmpeg process also NEEDS to be killed. But I can't achieve that in any way.


I have tried a couple things, so I'll paste some code :


main.js


// retrieve video data
ipcMain.handle('get-games', async (event, arg) => {
 const spawn = require('child_process').spawn;
 const pythonProcess = spawn('python', ["./backend/predict_games.py", arg]);

 // sets pythonProcess as a global variable to be accessed when quitting the app
 global.childProcess = pythonProcess;

 return new Promise((resolve, reject) => {
 let result = "";

 pythonProcess.stdout.on('data', async (data) => {
 data = String(data);

 if (data.startsWith("{"))
 result = JSON.parse(data);
 });

 pythonProcess.on('close', () => {
 resolve(result);
 })

 pythonProcess.on('error', (err) => {
 reject(err);
 });
 })
});

app.on('before-quit', function () {
 global.childProcess.kill('SIGINT');
});



predict_games.py
(the ffmpeg part)

def convert_video_to_frames(fps, input_file):
 # a few useful directories
 local_dir = os.path.dirname(os.path.abspath(__file__))
 snapshots_dir = fr"{local_dir}/snapshots/{input_file.stem}"

 # creates snapshots folder if it doesn't exist
 Path(snapshots_dir).mkdir(parents=True, exist_ok=True)

print(f"Processing: {Path(fr'{input_file}')}")
try:
 (
 ffmpeg.input(Path(input_file))
 .filter("fps", fps=fps)
 .output(f"{snapshots_dir}/%d.jpg", s="426x240", start_number=0)
 .run(capture_stdout=True, capture_stderr=True)
 )
except ffmpeg.Error as e:
 print("stdout:", e.stdout.decode("utf8"))
 print("stderr:", e.stderr.decode("utf8"))



Does anyone have any clue ?


-
avcodec/h264dec : Constify slices' pointer to the parent context
24 mars 2022, par Andreas Rheinhardtavcodec/h264dec : Constify slices' pointer to the parent context
Modifying the main context by a slice thread is racy ;
so constify the pointer to it in H264SliceContext.
The code itself was already compatible with this change.Reviewed-by : Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>