mifi / lossless-cut

The swiss army knife of lossless video/audio editing
https://losslesscut.app/
GNU General Public License v2.0
26.06k stars 1.25k forks source link

Bundling ffmpeg #3

Closed zeke closed 7 years ago

zeke commented 7 years ago

I have no idea what I'm doing™, but I see that the team that built Kap was able to vendor ffmpeg in their app:

https://github.com/wulkano/kap/search?utf8=%E2%9C%93&q=ffmpeg

It would be pretty nice for users not to have to set this up.

mifi commented 7 years ago

I'll look into it when i hvave the time

zeke commented 7 years ago

Cool. Supposedly there's a version of ffmpeg bundled with Electron itself, though the documentation on that is sparse. I hope to dig into this soon and produce some documentation around using it. If you get to it first, please let me know!

mifi commented 7 years ago

The included ffmpeg version might not be recent enough and have all the features needed for muxing/demuxing/cutting etc. Also it's only the lib, not the ffmpeg CLI. So node native bindings are required, which complicates things. It might also be possible to use something like node-ffi for calling the linked in ffmpeg libraries. However I'm afraid we'll have to rewrite alot of the logic that ffmpeg CLI already handles, and also risk crashing the whole node process if ffmpeg crashes.

https://github.com/node-ffi/node-ffi

http://qiita.com/kjunichi/items/8c1955c6bc2013b636a3

libavformatもnodeも64ビットな環境で動かしてみたら、 Segmentation fault: 11 😂

mifi commented 7 years ago

ffmpeg is now bundled in as of 1.2.0.

zeke commented 7 years ago

Nice! Any thoughts on the process you went through?

Did you follow the same technique the Kap team used?

I notice a bunch of different source hosts:

ffmpeg_linux_ia32=https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-32bit-static.tar.xz
ffmpeg_linux_x64=https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz
ffmpeg_darwin_x64=http://evermeet.cx/ffmpeg/ffmpeg-3.2.7z
ffmpeg_win32_ia32=https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-3.1.5-win32-static.zip
ffmpeg_win32_x64=https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-3.1.5-win64-static.zip
ffprobe_darwin_x64=http://evermeet.cx/ffmpeg/ffprobe-3.2.7z

How did you compile this list?

mifi commented 7 years ago

I used pretty much the same technique, yes. So basically when building it just copies ffmpeg/ffplay (for the corresponding platform/arch) into the package output directory. Also exclude this dir from the asar-package or I don't think it would work. I made this list from the official download links from www.ffmpeg.org