Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
FFMPEG : How to stream to multiple outputs with the same encoding independently
8 février 2017, par Lucas SchochHow my stream is working right now:
Input: Switcher program that captures the camera and screen shots and make a different layouts. One of the windows from the software is the one used as Input in the ffmpeg command line.
Output: - Facebook (example) - Youtube (example)
At the beginning, i thought that maybe could be better create two different ffmpeg processes to stream independently to each output. The problem was it uses too much CPU. The answer for it, was to encode one time and copy it to different outputs. Ok, great, it solves the problem, but what if one of the output fails? Both fail.
I'm trying to make one encoding to two outputs and if one of these outputs is not available, the other keep going well.
Anybody have any idea to solve it?
Thanks!
-
Use ffmpeg from an electron app
8 février 2017, par Sharath HuddarI intend to build a basic video editor desktop app. I have built a working prototype in python ( using kivy ). In this prototype I directly call the command line ffmpeg tool.
How can I incorporate ffmpeg into my electron app?
-
Working Directory : null Environment : null
8 février 2017, par MertI am trying to use ffmpeg.so on Android I am getting Working Directory: null Environment: null error.
try { Process p = Runtime.getRuntime().exec("/data/data/com.example.foo/files/ffmpeg -f image2 -i " + Environment.getExternalStorageDirectory().getAbsolutePath() + "/img/b%d.jpg " + Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/a444.mp4"); } catch (IOException e) { e.printStackTrace(); }
ERROR LOG
04-09 01:50:45.683: I/Adreno-EGL(18393): : EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13 04-09 01:50:45.713: D/OpenGLRenderer(18393): Enabling debug mode 0 04-09 01:53:56.487: D/dalvikvm(18551): Trying to load lib /data/app-lib/com.example.sodeneme-1/libffmpeg.so 0x423d7d00 04-09 01:53:56.487: D/dalvikvm(18551): Added shared lib /data/app-lib/com.example.sodeneme-1/libffmpeg.so 0x423d7d00 04-09 01:53:56.487: D/dalvikvm(18551): No JNI_OnLoad found in /data/app-lib/com.example.sodeneme-1/libffmpeg.so 0x423d7d00, skipping init 04-09 01:53:56.537: W/System.err(18551): java.io.IOException: Error running exec(). Command: [/data/data/com.example.sodeneme/files/ffmpeg, -f, image2, -i, /storage/emulated/0/img/b%d.jpg, /storage/emulated/0/DCIM/Camera/a444.mp4] Working Directory: null Environment: null 04-09 01:53:56.537: W/System.err(18551): at java.lang.ProcessManager.exec(ProcessManager.java:211) 04-09 01:53:56.537: W/System.err(18551): at java.lang.Runtime.exec(Runtime.java:173) 04-09 01:53:56.537: W/System.err(18551): at java.lang.Runtime.exec(Runtime.java:246) 04-09 01:53:56.537: W/System.err(18551): at java.lang.Runtime.exec(Runtime.java:189) 04-09 01:53:56.537: W/System.err(18551): at com.example.sodeneme.MainActivity.onCreate(MainActivity.java:40) 04-09 01:53:56.537: W/System.err(18551): at android.app.Activity.performCreate(Activity.java:5231) 04-09 01:53:56.537: W/System.err(18551): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread.access$800(ActivityThread.java:135) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 04-09 01:53:56.537: W/System.err(18551): at android.os.Handler.dispatchMessage(Handler.java:102) 04-09 01:53:56.537: W/System.err(18551): at android.os.Looper.loop(Looper.java:136) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread.main(ActivityThread.java:5017) 04-09 01:53:56.537: W/System.err(18551): at java.lang.reflect.Method.invokeNative(Native Method) 04-09 01:53:56.537: W/System.err(18551): at java.lang.reflect.Method.invoke(Method.java:515) 04-09 01:53:56.537: W/System.err(18551): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 04-09 01:53:56.537: W/System.err(18551): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 04-09 01:53:56.537: W/System.err(18551): at dalvik.system.NativeStart.main(Native Method) 04-09 01:53:56.547: W/System.err(18551): Caused by: java.io.IOException: No such file or directory 04-09 01:53:56.547: W/System.err(18551): at java.lang.ProcessManager.exec(Native Method) 04-09 01:53:56.547: W/System.err(18551): at java.lang.ProcessManager.exec(ProcessManager.java:209) 04-09 01:53:56.547: W/System.err(18551): ... 18 more 04-09 01:53:56.577: I/Adreno-EGL(18551): : EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13 04-09 01:53:56.607: D/OpenGLRenderer(18551): Enabling debug mode 0
PERMISSIONS
-
Live streaming with ffmpeg is gittery
8 février 2017, par chubakaI started playing around with live streaming with ffmpeg to my rtmp server and was wondering what's the best approach to it if my approach is sending a chunk of data every 5 or so seconds, because right now it's kind of gittery and stuttery every time the server gets data. Would appreciate any advice or books/articles about this topic in general so I could get the basic idea.
-
How to Kill ffmpeg process in node.js
8 février 2017, par SanjayI am using node.js code that convert Axis Ipcamera live stream into mp4 using FFMPEG
var childProcess=require('child_process'); var childArguments = []; var child=[]; var cmd='ffmpeg -i rtsp://172.24.22.117:554/axis-media/media.amp -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -preset slower -crf 18 -vf "scale=trunc(in_w/2)*2:trunc(in_h/2)*2"'+' '+__dirname+'/uploads/ouput.mp4'; child=childProcess.exec( cmd, childArguments, { env: process.env, silent:true }, function (err, stdout, stderr) { if (err) { throw err; } console.log(stdout); }); // here generate events for listen child process (works properly) // Listen for incoming(stdout) data child.stdout.on('data', function (data) { console.log("Got data from child: " + data); }); // Listen for any errors: child.stderr.on('data', function (data) { console.log('There was an error: ' + data); }); // Listen for exit event child.on('exit', function(code) { console.log('Child process exited with exit code ' + code); child.stdout.pause(); child.kill(); });
my above code works perfectly. It gives the output as I want, but I am not able to kill(stop) the ffmpeg command. I am using the code below for stopping the process, but in background it still continues.
child.kill("SIGTERM");
I also used following commands : child.kill('SIGUSR1'); child.kill("SIGHUP"); child.kill("SIGINT");child.kill('SIGUSR2'); for killing this process but it not works.
Currently I forcefully kill the node application to stop ffmpeg command and generate mp4 file. I do not want this. But I want commands that stop ffmpeg process and generate mp4 file, without killing the node application.