
Recherche avancée
Autres articles (67)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
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
Sur d’autres sites (11437)
-
Is 'Android+FFMpeg' friendship really available ?
21 février 2021, par vold_byThe question does not mean that I'm interested if ffmpeg code can be used on Andoid. I know that it can. I'm just asking if somebody has the real performance progress with that stuff.


I've created the question after several weeks of experiments with the stuff and I've had enough.


I do not want to write to branches where people even do not say what kind of video they decode (resolution, codec) and talk only about some mystical FPS. I just don't understand what they want to do. Also I'm not going to develop application only for my phone or for Android 2.2++ phones that have some extended OpenGL features. I have quite popular phone HTC Desire so if the application does not work on it, so what's next ?


Well, what do I have ?


- 

-
FFMpeg source from the latest HEAD branch. Actually I could not buld it with NDK5 so I decided to use stolen one.


-
Bambuser's build script (bash) with appropriate ffmpeg source ([web] : http://bambuser.com/r/opensource/ffmpeg-4f7d2fe-android-2011-03-07.tar.gz).
It builds well after some corrections by using NDK5.


-
Rockplayer's gelded ffmpeg source code with huge Android.mk in the capacity of build script ([web] : http://www.rockplayer.com/download/rockplayer_ffmpeg_git_20100418.zip).










It builds by NDK3 and NDK5 after some corrections. Rockplayer is probably the most cool media player for Android and I supposed that I would have some perks using it's build.


I had suitable video for a project (is not big and is not small) : 600x360 H.264.


Both libraries we got from clauses 2 and 3 provide us possibility to get frames from video (frame-by-frame, seek etc.). I did not try to get an audio track because I did not need one for the project. I'm not publishing my source here because I think that's traditional and it's easy to find.


Well, what's the results with video ?


- 

- HTC Desire, Android 2.2
- 600x360, H.264
- decoding and rendering are in different threads








- 

- Bambuser (NDK5 buld for armv5te, RGBA8888) : 33 ms/frame average.
- Rockplayer (NDK3 build for neon, RGB565) : 27 ms/frame average.






It's not bad for the first look, but just think that these are results only to decode frames.


If somebody has much better results with decoding time, let me know.


The most hard thing for a video is rendering. If we have bitmap 600x360 we should scale one somehow before painting because different phones have different screen sizes and we can not expect that our video will be the same size as screen.


What options do we have to rescale a frame to fit it to screen ?
I was able to check (the same phone and video source) those cases :


- 

- sws_scale() C function in Bambuser's build : 70 ms/frame. Unacceptable.
- Stupid bitmap rescaling in Android (Bitmap.createScaledBitmap) : 65 ms/frame. Unacceptable.
- OpenGL rendering in ortho projection on textured quad. In this case I did not need to scale frame. I just needed to prepare texture 1024x512 (in my case it was RGBA8888) containig frame pixels and than load it in GPU (gl.glTexImage2D). Result : 220 ms/frame to render. Unacceptable. I did not expect that glTexImage2D just sucked on Snapdragon CPU.








That's all. I know that there is some way to use fragment shader to convert YUV pixels using GPU, but we will have the same glTexImage2D and 200 ms just to texture loading.


But this is not the end. ...my only friend the end... :) It is not a hopeless condition.


Trying to use RockPlayer you definitely will wonder how they do that damn frame scaling so fast. I suppose that they have really good experience in ARM achitecture. They most probably use avcodec_decode_video2 and than img_convert (as I did in RP version), but then they use some tricks (depends of ARM version) for scaling.


Maybe they also have some "magic" buld configuration for ffmpeg decreasing decoding time but Android.mk that they published is not THE Android.mk they use. I don't know.


So, now it looks like you can not just buld some easy JNI bridge for ffmpeg and than have real media player for Android platform. You can do this only if you have suitable video that you do not need to scale.


Any ideas ?


-
-
Kill child process only after readFile() Node js Electron
14 mai 2021, par RadespyI'm using an imported
ffmpeg
binaryffmpeg-static-electron
in an Electron-React app (on Windows Pro 10) and want to delete a saved cropped video and then kill the child process afterwards from myMain process
.

The overall aim is to crop a video of the whole screen following capture and then send the cropped video to a renderer.


const fsPromises = require('fs').promises
const ffmpeg = require('ffmpeg-static-electron')
const { execFile } = require("child_process")


ipcMain.on("windoze_capture_screen:video_buffer", async (event, buffer) => {
 const temp_directory = await fsPromises.mkdtemp(await fsPromises.realpath(os.tmpdir()) + path.sep)
 const capture_screen_video_path = path.join(temp_directory, "screen_capture_video.mp4")

 child_object = execFile(`${ffmpeg.path}`, 

 ['-i', `${capture_screen_video_path}`, '-vf', `crop=${width}:${height}:${x_pos}:${y_pos}`, `${path.join(temp_directory,'cropped_video.mp4')}`])
 
 child_object.on("exit", async () => {

 // child_object.kill()
 console.log("?Killed -1", child_object.killed)
 
 try { 
 databasePayload.video_buffer = await fsPromises.readFile(path.join(temp_directory, "cropped_video.mp4"), {encoding: 'base64'})
 mainWindow.webContents.send("main_process:video_buffer", databasePayload.video_buffer)
 } catch (error) {
 console.log(error)
 } finally {

 // child_object.kill()
 console.log("?Killed - 2", child_object.killed)
 
 // noASAR required to be set to 'true' in order to remove temp directory in build
 process.noAsar = true 
 fs.rmdir(temp_directory, {recursive: true}, (error) => {if (error) {log(error)}})
 process.noASAR = false
 }

 // 3rd scenario
 // child_object.kill()
 console.log("?Killed -3", child_object.killed) 
 })

 // 4th scenario
 console.log("?Killed-4", child_object.killed) 
 })




When running each of these scenarios, I get the following outputs.


Scenario's 1, 2 and 3 - Successfully sends cropped video to renderer but doesn't kill process.


Output :


?Killed-4 false
?Killed -1 false
[ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.3.0 (GCC).... etc. ]
?Killed-2 false
?Killed -3 false



Scenario 4 - Doesn't crop video


?Killed-4 true
?Killed -1 true
Command failed: C:\Users\XXX\Desktop\windows-electron-forge\node_modules\ffmpeg-static-electron\bin\win\x64\ffmpeg.exe -i C:\Users\XXX\AppData\Local\Temp\4WgnUw\screen_capture_video.mp4 -vf crop=796:763:462:509 C:\Users\XXX\AppData\Local\Temp\4WgnUw\cropped_video.mp4

[Error: ENOENT: no such file or directory, open 'C:\Users\XXX\AppData\Local\Temp\4WgnUw\cropped_video.mp4'] {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Users\\XXX\\AppData\\Local\\Temp\\4WgnUw\\cropped_video.mp4'
}
?Killed - 2 true
?Killed -3 true



The last scenario has been tried out of desperation.


Question : Where am I going wrong with this ? I suspect it's something to do with ipc between child and parent process but not sure where to place the code.


Any help will be much appreciated !!!


-
child process spawn output file and directory in NodeJs
5 juin 2021, par ZeeshanI am using ffmpeg with child process to merge audio and video, but when i am trying to download the file, it is downloading in the same folder, but i want it to download it in the public folder.


following is my code for the child process spawn.


// Start the ffmpeg child process
const ffmpegProcess = cp.spawn(ffmpeg, [
 // Remove ffmpeg's console spamming
 '-loglevel', '8', '-hide_banner',
 // Redirect/Enable progress messages
 '-progress', 'pipe:3',
 // Set inputs
 '-i', 'pipe:4',
 '-i', 'pipe:5',
 // Map audio & video from streams
 '-map', '0:a',
 '-map', '1:v',
 // Keep encoding
 '-c:v', 'copy',
 // Define output file
 'title.mp4',
], {
 windowsHide: true,
 stdio: [
 /* Standard: stdin, stdout, stderr */
 'inherit', 'inherit', 'inherit',
 /* Custom: pipe:3, pipe:4, pipe:5 */
 'pipe', 'pipe', 'pipe',
 ],
});