Can't reuse ffmpeg
See original GitHub issueDescribe the bug GIVEN I load ffmpeg AND I run any command AND I run another command THEN an error is thrown
[info] run ffmpeg command: -L
Uncaught (in promise)
{
"name": "ExitStatus",
"message": "Program terminated with exit(0)",
"status": 0
}
To Reproduce
const fs = require('fs');
const { createFFmpeg, fetchFile } = require('@ffmpeg/ffmpeg');
const ffmpeg = createFFmpeg({ log: true });
(async () => {
await ffmpeg.load();
await ffmpeg.run('-L');
await ffmpeg.run('-L');
})();
Expected behavior It should run both commands
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
ffmpeg Documentation
If the selected pixel format can not be selected, ffmpeg will print a warning and ... Re-use existing streams when a PMT's version...
Read more >FFmpeg and how to use it wrong - VideoBlerg - WordPress.com
It is not uncommon for FFmpeg to duplicate the first frame. ... Never reuse your first pass analysis when creating Adaptive Bitrate (ABR) ......
Read more >When recording MP4 using ffmpeg suddenly power off
The main cause of MP4 file damage is due to header or trailer not written properly on the file , then , whole...
Read more >A quick guide to using FFmpeg to convert media files
FFmpeg is a great tool for quickly changing an AV file's format or quality ... frame rates, and container metadata; and can't support...
Read more >FFmpeg won't encode at Main10@L5.1 - Super User
ffmpeg -y -r 23.97602 -i %6d.png -vcodec libx265 -profile:v main10 -x265-params ... analysis-reuse-level=0 / analysis-save-reuse-level=0 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m experiencing similar issues.
I use both the single-threaded and the multi-threaded version in my app, and dynamically switch between the two when available, and I noticed that, when using the multithreaded one (
proxy_main
), I can successfully run two commandsawait ffmpeg.run
.However, when using the single-threaded version, the first command succeeds, but the second one just hangs forever. The last message from FFMPEG’s logging is
and then eternal hanging.
My solution was to: read the files from the first command into memory using
ffmpeg.FS("readFile"
, then,await ffmpeg.exit()
, thenawait ffmpeg.load()
, then copy back the file from the previous run, plus all my other required files, and then run my second command.This did the trick in single-threaded mode, but it’s a shame I can’t resuse the files I wrote the first time around.
Tested on ffmpeg-core version 11.4, compiled on commit 1f3461d.