Earlier quoted context omitted.
Amy advice for someone trying to write code against the ffmpeg api for the first time? It's...esoteric and the "correct" way seems to be reading a bunch of ten year old blog posts by random uncertain people. Even the python binding devs have a disclaimer they aren't confident they understand everything they document, despite doing their best to read the source.
Oh, no, I have nothing there, sorry! haha I'm using ffmpeg.wasm, it's basically ffmpeg compiled for the browser, and it's a simple layer where you basically treat it like the ffmpeg command, eg: ffmpeg.run(['-i', 'input.gif', ..., 'output.gif').then(() => { // handle output file })
Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
41–50 of 51 posts
Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#42Earlier quoted context omitted.
Oh, no, I have nothing there, sorry! haha I'm using ffmpeg.wasm, it's basically ffmpeg compiled for the browser, and it's a simple layer where you basically treat it like the ffmpeg command, eg: ffmpeg.run(['-i', 'input.gif', ..., 'output.gif').then(() => { // handle output file })
Don't sell yourself short, the cli args aren't easier either.
And I'm still learning a ton :)
Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#43This is awesome - nice job! Adding the ability to loop the gif back and forth would be great!
Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#44Earlier quoted context omitted.
I record little screencasts/demos regularly for embedding them on webpages and currently always convert them with the ffmpeg CLI to WEBM, but it's really cumbersome and hard to remember all the command line flags you need to use (especially with 2 passes). I don't really like online cloud converters though because each video needs to both be uploaded and downloaded again and I'm worried they do a lossy compression on…
That's awesome! Do you have an example ffmpeg command you run? We're trying to keep this tool super simple for our end users, but I think we might be able to add a webm preset. If you'd like me to look into it, drop me an email: andrew@ and show me a sample command :)
ffmpeg -i input.mp4 -b:v 0 -crf 30 -pass 1 -an -f webm /dev/null
ffmpeg -i input.mp4 -b:v 0 -crf 30 -pass 2 output.webm
Making it two passes seems to be important for WEBM according to the post. It has worked well for me so far, but I need to look it up every time.Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#45Earlier quoted context omitted.
Yeah, that's definitely an issue! We had to "optimize" loading it twice. The first time, I moved it from auto-loading to when the user clicks convert to save on bandwidth. The second time, I moved it to after a file is selected. That gives it time to load while users are presented with options before converting. It's definitely a trade-off. For us, the choice was easy-ish because we want to keep the budget down as In…
Have you tried running this as a fastly worker?
If the tool is popular long term, we might do a serverless option to make it accessible to Safari users or something though.
Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#46* VM is upgraded - we're back :) * Hi HN, I love new web tech, and was excited to see ffmpeg ported to WebAssembly so decided to build a free tool that uses it to: - Clip/trim videos - Overlay text and images - Resize - Create GIFs or convert to a web-friendly MP4 All of this done in your browser, without ever uploading a file to a web server! (* Except Safari, it doesn't support SharedArrayBuffers) A little more: I'…
The main reason why I use ffmpeg/edit videos is to take my 3440x1440 screen recordings and crop+resize them in a format friendly for twitter, otherwise twitter will do its own (additional?) resizing and compression which just destroys videos
That sounds like a great use case for us to handle! Although I think ffmpeg in the browser loses some efficiency over the command line.
I think we added cropping as a possible future feature. I'll bet ffmpeg makes that really easy to do.
I think we should also work on optimizing the output size. I think we use a pretty high (err, low) -crf, which can result in ridiculous file sizes.
Thanks for the comment! Appreciate hearing use cases :)
Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#47Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#48I remembered that WASM application cannot use any kind of hardware acceleration. So have anyone tested the website for large videos?
I haven't checked the exact hit, but that's mostly because our focus for this tool was on people who would never touch ffmpeg or a command line.
Also, the alternative for us would've been to upload remotely and run on Lambda or similar, which I think would lack hardware acceleration as well.
Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#49Re: Show HN: WebAssembly and ffmpeg = Quick clip, overlay, resize and GIF-ize videos
#50Earlier quoted context omitted.
Have you tried running this as a fastly worker?
Nope! It's all running client-side, so it uses a bit more bandwidth, but there's no way a serverless platform can compete with the cost :) If the tool is popular long term, we might do a serverless option to make it accessible to Safari users or something though.