16 ms·
Ffmpeg Buddy
- dontbenebby 4y agoI wanted to make something like this (minus the gui) for a long time... thank you very much OP, I am bookmarking this.
- alex_duf 4y agoSo if you remove the GUI you'll only have the CLI, so what you want is the ffmpeg CLI?
- nvrspyx 4y agoI'm not the parent, but not necessarily. You can have this same exact "GUI" implemented as a TUI, using something like Bubble Tea[0], Textual[1], or by hand. You'd get a similar experience without having to go back and forth between the terminal and a browser. [0]: https://github.com/charmbracelet/bubbletea https://github.com/charmbracelet/bubbletea [1]: https://github.com/Textualize/textual https://github.com/Textualize/textual
- dontbenebby 4y agoThank you! Sorry, I have a lot of projects going at once and I'm working on a new system to organize "TODOS" - I'll bookmark your comment to return to, thank you for your thoughts, sincerely.
- dontbenebby 4y agoYes, often what would happen is by the time I figured out the flags, I'd lost the creative idea of what I wanted to make a gif for. Usually I was using them as replies on Twitter, but they banned me from there and Reddit so I have less need to make GIFs. I knew how to in Photoshop etc, before they moved to the cloud so they can be paid in perperuity even though a lot of the advanced/useful features like layers or cropping etc are in more basic tools like Preview or GIMP now. (GIMP needs to get a macOS friendly rewrite similar to how folks did KeePassXC imho, but I'm not a strong enough coder and no large open source friendly companies seems to want to pay me a salary to direct projects like that, so all I can do is halfway troll here on HN, but it comes from a place of love.)
- m-p-3 4y agoSo a TUI?
- kortex 4y agoA TUI FFMPEG builder would be delicious. Just a terminal powered graphical interface that lets me manipulate options, and feedback validation, would make it so much easier to work with complex graphs.
- phailhaus 4y agoOoh, if this also used ffmpeg-wasm [1], you could then run the command itself in the browser! [1] https://github.com/ffmpegwasm/ffmpeg.wasm https://github.com/ffmpegwasm/ffmpeg.wasm
- OzzyB 4y agoHmmm... not really, irrc you will be bound by memory limits of your browser/wasm context. Small videos would be fine, large ones, not so much...
- 0x62 4y agoFWIW we’ve been using ffmpeg-wasm on one of our products [0] for a couple months and the main issue is garbage collection. You’re limited to 4GB memory, but if you don’t kill and restart the workers every N operations it crashes the browser tab (even with proper unlinking of files in the virtual FS). I suspect you could still make it work with clever usage of the File System Access API as a cache, and process larger files in chunks. Then you’d mostly be limited by the Blob storage limits [1], and memory required to merge processed chunks together. [0] https://nft-inator.com/app https://nft-inator.com/app [1] https://chromium.googlesource.com/chromium/src/+/224e43ce1ca4f6ca6f2cd8d677b8684f4b7c2351/storage/browser/blob/README.md https://chromium.googlesource.com/chromium/src/+/224e43ce1ca...
- marclundgren 4y agoIt works great for audio. Here's a wasm-ffmpeg solution I created trim audio. https://wasm-audio-clipper.netlify.app/ https://wasm-audio-clipper.netlify.app/ Check the repo: https://github.com/marclundgren/wasm-audio-clipper https://github.com/marclundgren/wasm-audio-clipper. I ended up lazily registering the context. The memory footprint stays lower even after trimming multiple clips on the same session.
- nabakin 4y agoYou could! I've done it before but ffmpeg-wasm is also very slow and there are memory limitations that come with WASM as well. At least on Chrome.
- donbronson 4y agoThis is excellent. Is there something like this for ImageMagick as well?
- paulmd 4y agoI say this with the best of intentions: I wish this went a little farther. A lot of the complexity comes from transcoding options, filters/transformations applied to the video/audio streams, and control of how the file gets put back together. (And sometimes there are oddities about how they interact, or there is one option that seems very deprecated. It's like Eclipse, it's an engineer's tool, it's extremely powerful but god had no hand in the creation of the UX whatsoever, it is the unholy amalgamation of hundreds of modules that usually work, usually, mostly.) Give me checkboxes for "resize this video", "convert framerate", "decomb filter", "burn hardsubs filter", a reasonable set of x264 or x265 transcoding options, audio transcoding and downmux, and options for controlling how it all gets reassembled. It might help to list out some simple use-cases and then look at the ffmpeg features that would be required to get there, and then support those. But again, it's sort of hard to capture everyone's use-cases, ffmpeg is such a swiss-army knife. Personally I use it for: * to direct-stream cut (no re-encoding) slices of videos for memes * to handle game replay captures (sometimes with re-encoding, sometimes not) and combine separate audio tracks into a file for youtube * to handle game replay captures (always with re-encoding) but with separate audio tracks preserved * to cut out audio tracks/subs that I don't want from a given movie/show when it becomes annoying * to transcode a movie/show for archival at the minimum size/maximum quality etc In particular I'm not sure how to really tell ffmpeg to handle multiple audio/sub streams without programmatic interaction - you kinda need to know there are 2 audio streams and 4 sub streams, because you need to tell it what to do with each stream you want included in the output file, even if you do the exact same thing to every stream. If you have one show that's a little weird, fine, but without some kind of front-end it gets difficult to handle arbitrary content that is similar but not quite.
- dylan604 4y agoWhat's crazy is that there are so so many variations of GUI options for FFMPEG. Typically, the GUI is limited by what the creator's use of FFMPEG tends to be. Which by all means is not a knock against it. It serves a purpose, and if it serves a purpose for them it probably is useful to others in the same way. Then there are those that want a more generic version that allows all the bells & whistles to become available in the GUI. However, now you need to have a much better understanding of FFMPEG which the vast majority of FFMPEG users don't know (I myself learn new things everytime a new task is given). At the end of the day, give it a go yourself to build a UI on top of FFMPEG to expose all of the things you just requested and see how painful it can be. I've done it multiple times for multiple jobs and not one of them was the same. It gets even more fun when you have sources with a combination of discrete and interleaved audio streams with high channel counts. Now, you have to probe the source and provide that info to the user to allow for output audio considerations. Based on those, you then need to potentially merge/join/split/map the audio. It's maddingly fun to those with those sense of perversions like me.
- kosolam 4y agoVery cool. I would love to see something like that with more ffmoeg options
- Hello71 4y agoSelecting both scale and rotate options results in: Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v transpose=1' will be used. -vn, -an, -ss, and -to are specified as output rather than input options, which are much more efficient.
- dylan604 4y agojust from this comment, using -filter_complex seems like a much better option. in fact, on past experience, I couldn't see myself building an FFMPEG command builder and not use filter_complex.
- fareesh 4y agoThese are the easy ones. What would be amazing is the arcane incantations that mere mortals don't remember. Another tool that this is nice for is imagemagick. Is there something newer than imagemagick for image generation these days? I'm having trouble with some non English scripts and draw text
- NegativeLatency 4y agoHave you tried/considered trying it in an svg and then converting to a raster format?
- ehsankia 4y agoIndeed, these are very basic stuff, which may be useful for some people's workflow, but then by the time I started remember this website, I'll probably have already memorized the few flags the website profiles anyways. In my experience, you're just better off searching for what you need, in my experience you'll always find a bunch of results with the exact ffmpeg incantation you need for your specific rare usecase.
- HellsMaddy 4y agoFor a long time, I've wanted an interactive Imagemagick interface that allows you to add/tweak flags and shows an immediate preview. The Imagemagick site has something sorta like this[0] but it's not very good. My current workflow is to open the image in a viewer that automatically reloads on change, like feh or sxiv, and then in my terminal use <M-a> to run the command without clearing the command line. [0]: https://magickstudio.imagemagick.org/scripts/MagickStudio.cgi https://magickstudio.imagemagick.org/scripts/MagickStudio.cg...
- eevilspock 4y agoIsn't the better solution for most users a GUI tool like Avidemux?[1] The point being that those who want to use the command line are precisely the people who need to understand all its complexity. --- [1] https://avidemux.org https://avidemux.org. Avidemux has a "built-in libavcodec library from FFmpeg (i.e. Avidemux contains its own copy of libavcodec, external FFmpeg is not used)"
- bigdict 4y agoLooks great, now do the other million available options.
- dusted 4y agoNeat tool and a fine introduction to doing very basic things with ffmpeg. A tool I'd find interesting and useful is one that lets me graphically do everything with the advanced filter graph that can be done with the commandline, in an easy and intuitive way (spoiler alert: extremely hard to impossible task)
- gubneor 4y agohttps://github.com/topics/ffmpeg-gui https://github.com/topics/ffmpeg-gui https://github.com/MattMcManis/Axiom https://github.com/MattMcManis/Axiom
- radicality 4y agoKinda related, here's a few ffmpeg commands i've probably spent many hours getting to work just right recently (and they might not even the right way to do these things), perhaps someone will find it helpful. All of these are on a macbook. - play facetime camera (or any avfoundation camera, like a capture card) to mpv ffmpeg -f avfoundation -video_size 1920x1080 -framerate 30 -drop_late_frames true -i "FaceTime HD Camera" -c:v rawvideo -f matroska -r 30 - | mpv -profile=low-latency -untimed - - play raw video stream from the usb camlink capture card ffmpeg -f avfoundation -video_size 3840x2160 -framerate 23.98 -pixel_format uyvy422 -drop_late_frames true -i "Cam Link 4K" -c:v rawvideo -f matroska - | mpv -profile=low-latency -untimed - - Capture video, and do live HVEC hardware encoding on apple hardware and save result. Control quality with q variable. q=85 is around 250Mb/s: ffmpeg -f avfoundation -video_size 3840x2160 -framerate 23.98 -i "Cam Link 4K" -c:v hevc_videotoolbox -q:v 85 -r 23.98 -tag:v hvc1 <filename>_x265.mp4 - Use named pipe with mkfifo to play a stream. Sometimes this produces less input lag than other methods. mkfifo /tmp/fifo1 cat /tmp/fifo1 | mpv -profile=low-latency -untimed - ffmpeg -f avfoundation -video_size 1920x1080 -framerate 30 -drop_late_frames true -i "FaceTime HD Camera" -c:v rawvideo -f matroska -r 30 - > /tmp/fifo1
- Tijdreiziger 4y agoThe first two might be possible with just MPV. Relevant thread on /r/GenkiLab: https://www.reddit.com/r/GenkiLab/comments/mzw9a2/lower_latency_option_for_windows_mpvio/ https://www.reddit.com/r/GenkiLab/comments/mzw9a2/lower_late...
- radicality 4y agoI think I vaguely remembering trying it and eventually gave up as it wasn't working. I believe I arrived at this bug report which still seems open - https://github.com/mpv-player/mpv/issues/8818 https://github.com/mpv-player/mpv/issues/8818 Overall I just found it better to leave pretty much everything to the more battle-tested `ffmpeg` and then use mpv to play the content (or can also use ffplay, but I do have have some customizations in mpv which I like).
- aqfamnzc 4y ago
- Nathanael_M 4y agoThe first time I heard about ffmpeg was last night when I had to concatenate a few hundred thousand videos. So slick, so quick, but it took a bit to figure out the command structure. Guess I found this 12 hours too late, haha!
- cedricd 4y agoA few hundred thousand videos? I'm super curious what your use case was. I really can't imagine the scenario for this :)
- geraldwhen 4y agoI'm guessing security camera motion detection footage for archive.
- victorwestmann 4y agoThis is as simple as revolutionary. Thank you so much for putting this together!
- butz 4y agoWhat about a decoder, to parse ffmpeg command from my old bash file to tell exactly what it is doing, maybe even suggesting some optimizations?
- pt_PT_guy 4y agoall of these I know by head. the difficult part is to combine vaapi, codecs, re-encode audio without re-encode video (and vice versa), codec lists, etc
- clone1018 4y agoI ended up making something similar (except in reverse) for the x264 options you can pass in: http://axxim.net/~clone1018/tools/x264.html http://axxim.net/~clone1018/tools/x264.html
- btbuildem 4y agoLast time I went down the ffmpeg man page rabbit hole was when I needed to vertically stack (and temporally align) feeds from multiple timelapse cameras to make videos for IG stories. As soon as the carefully curated string of option configurations went into a script, it also evaporated from my brain. Oh well.. til next time.
- runlevel1 4y agoSome codecs, like h264, require the width and height be divisible by 2. Scaling with -1 will sometimes fail because of that. If you use -2 instead it will adjust so that it is even.[^1] For example: ffmpeg -i input.mp4 -vf scale=720:-2 output.mp4 [1]: https://trac.ffmpeg.org/wiki/Scaling#KeepingtheAspectRatio https://trac.ffmpeg.org/wiki/Scaling#KeepingtheAspectRatio
- hombre_fatal 4y agoIt reminds me of a similar quirk where scaling by a single pixel extra in either dimension can introduce disproportional blurriness, so one solution is to pad by a 1px wide border on the would-be odd dimension. This has saved me a lot: https://stackoverflow.com/a/53024964/511200 https://stackoverflow.com/a/53024964/511200
- chungy 4y agoffmpeg is a really powerful tool that's well worth learning. It's become my go to for almost every video, audio, and still image task. One thing that might help: ffmpeg is, in fact, the Unix philosophy of "do one thing and do it well", it just so happens that all the commands are prefixed by the ffmpeg command, but you can break things down really easily after that. Each codec is independent, mappings are independent, filters, etc.
- wingworks 4y agoSomething I don't think many talk about, the fact that ffmpeg can input and output images, and does it really quick. Recently I was working on processing large images (100-200MB per jpg) which needed a crop, some added text and "progress bar" for a timelapse. I started with imagemagick, it was super slow, so tried graphicsmagick, also slow, just somehow I thought, why not try ffmpeg. Man, it's night and day difference. It processed my images super quick (from ~30 seconds down to ~1 second), and had surprisingly good documentation (compared to IM/GM), and allot of support on stackoverflow etc.
- hardwaregeek 4y agoIt's interesting. I've heard apocryphally that FFmpeg is used in many production video systems (https://twitter.com/id_aa_carmack/status/1258531455220609025 https://twitter.com/id_aa_carmack/status/1258531455220609025). However, as far as I can tell, you can either use the quite low level libraries like libavfilter, or you can rely on the CLI tool. The former seems rather tedious; you have to set up the scaffolding yourself, chain all the demuxer to the filters to the muxer, etc. The latter is a very weird interface; you have to shell out to this CLI tool. Is that really the case?
- the_cat_kittles 4y agowhats the problem with using the cli in production?
- bityard 4y agoYeah, I don't really see the difference between asking a database administrator to be fluent in SQL and asking a video processing expert to be fluent in ffmpeg (or similar tools).
- make3 4y agorequires creating a separate process? requires passing the memory from one process to the other.. requires a filesystem & requires the security analysis for having production software interact with the file-system?
- chrisseaton 4y ago> requires a filesystem Unix has something called pipes that lets you send data as 'files' but they're really supplied as a stream by another process.
- barrkel 4y agoOne of the nicer things about using a separate process is that resource isolation is much better than in-process. You can kill the process without worrying about mutexes, OS scheduling applies priority consistently, the entire heap is freed once a job completes, there's no worry about leaking resources, and so on. Even if you could do less I/O by keeping stuff in-process - and I'm not sure that's true if you build your graph in ffmpeg, it's just the source and sink of data which are external, and they'll almost always be external.
- doersino 4y agoI see that we're sharing our lists of magical FFmpeg incantations – here's mine: https://github.com/doersino/ffmpeg-koraktor https://github.com/doersino/ffmpeg-koraktor
- m-p-3 4y agoRegarding scaling while maintaining ratio, some codecs will give an error if you try to put a size that isn't a multiple of n, for example if you put -2 you'll actually have it calculate the appropriate multiple of 2.
- linesinthesand 4y agoA nice start, but definitely needs some complex_filter options
- gosub 4y agoCan I have magit for ffmpeg and openssl, please?
- 01100011 4y agoSeems like this would be nice to have an an interactive shell script(or compiled, for cross platform support) that ships alongside ffmpeg...
- spinaltap 4y agoQuestion: this tool offered start-time and end-time, but no toggle about "accurate seek"? I've always been confused about the `-noaccurate_seek` flag (when cutting clips with `-c copy`). I use this flag because I don't need accurate seek, but sometimes it works, sometimes it doesn't. When it doesn't work, there will be a few seconds of frozen image at the beginning of the cut. Don't know how to solve it.
- ThatPlayer 4y agoIsn't that only relevant because you're using -c copy? Without transcoding, ffmpeg will just copy the stream from that start-time. But because video codecs store data as incremental updates to a keyframe, without transcoding, those first few seconds will be useless data. -noaccurate_seek looks for the keyframe so you do not have that useless data. Proper terms are i-frame and p-frame. https://en.wikipedia.org/wiki/Video_compression_picture_types https://en.wikipedia.org/wiki/Video_compression_picture_type... Though according to the ffmpeg docs on -ss, it should be doing noaccurate_seeks if you're doing stream copy. Also I'm unsure about this, but I think the audio stream can be cut at a different location than the video stream, leading to the frozen frame, and different video players seem to handle it differently. I've got a clip I've made, with transcoded video stream but copied audio stream, that is 1:06 on Firefox with the extra audio at the beginning, but 1:03 on VLC, MPC, Chrome, and desynced in Edge. Extracting the audio with ffmpeg again gives a time of 1:04.02 compared to a video stream of 1:03.
- 1970-01-01 4y agoSee also https://github.com/FHPythonUtils/Cli2Gui/ https://github.com/FHPythonUtils/Cli2Gui/ It's 2022, shouldn't CLI to GUI conversion be an automatic and core feature of every OS by now?
- soheil 4y agoWould also love to see a vlc buddy.
- kortex 4y agoQuestion for the peanut gallery, because it's vaguely topical and I've spent hours researching problem to no avail. How can I mux arbitrary data streams into a container? Let's say I have a drone and I want to stream audio, video, and some avionics telemetry. I know FFMPEG can pass through data encoded, and it lists a few binary stream formats: ffmpeg -codecs | grep '^ ..D' # shows all -c=d codecs ..D... bin_data binary data ..D... dvd_nav_packet DVD Nav packet ..D... epg Electronic Program Guide ..D... klv SMPTE 336M Key-Length-Value (KLV) metadata ..D... mpegts raw MPEG-TS stream ..D... otf OpenType font ..D... scte_35 SCTE 35 Message Queue ..D... timed_id3 timed ID3 metadata ..D... ttf TrueType font But I have no idea how to pack some new data stream into the filtergraph.
- gyan 4y agoIs the data packetized and with timestamps?
- kortex 4y agoThe data has temporal component, yes. But how would I packetize it in the first place? I have the high-level concept that I need to take each of my data chunks and put them into some kind of timestamped container/page/atom and feed them into the stream, but I have no idea how to actually emit those packets. Like let's say each time step I emit a binary blob of msgpack-encoded data. How do I wrap that with a timestamp/sequence number container?
- nl 4y agoSomething like https://github.com/buma/GPSOverlay https://github.com/buma/GPSOverlay might give you some pointers. Although it's not clear if you want to display your additional data as an overlay (like this example) or keep it as some kind of metadata stream. I'm not sure if the second option is even a thing.
- 4y ago
- aasasd 4y agoPfah, if my wishes were so simple I'd barely need the man page.
- xigency 4y agoI would use this tool if it had these options: - x264 settings as well as copy video codec - aac re-encoding settings - mixing 5.1 to 2.1 audio - adding multiple subtitles - rendering hard subtitles I was just using ffmpeg to convert videos to watch on the TV and I needed all of those.
- VyseofArcadia 4y agoWhy is this a webpage? It would be a little more useful as a local program that actually just runs the command for you instead of having to copy-paste everything to your terminal.
- hbn 4y agoA webapp is automatically cross-platform, and also installing a program requires more buy-in from a user. I wouldn't have played around with this if I had to vet whether it was from a trustworthy source and install it to my machine.
- stefantalpalaru 4y ago> It would be a little more useful as a local program that actually just runs the command for you instead of having to copy-paste everything to your terminal. That's already available: https://handbrake.fr/ https://handbrake.fr/
- misil 4y agoI think I once read a comment on here that the command-line parsing logic of ffmpeg is Turing-complete. It's probably telling that I can't remember if that was meant as a joke or to be taken seriously. And I say this with nothing but admiration for the tool.
- Ansil849 4y agoThe concept of this would be incredibly useful...I use FFmpeg every few weeks, which is not often enough to remember all the commands I need. But the execution here is a bit lacking. This only lets you input basically 10 parameters. If this were to be expanded to include all FFmpeg params, it would be INCREDIBLY useful.
- mihaitodor 4y agoYou might find this tool useful: https://handbrake.fr/ https://handbrake.fr/
- Ansil849 4y agoI don't use FFmpeg for transcoding, more for stream manipulation and frame/stream/subtitle extraction and related tasks, so unfortunately Handbrake isn't really a viable solution.
- RealStickman_ 4y agoMaybe https://mkvtoolnix.download/ https://mkvtoolnix.download/ fits your usecase then. It allows you to select enabled streams, edit metadata and a lot of other things I haven't tried yet for mkv and other container formats.
- webmobdev 4y agoIf you have macOS, check out https://subler.org/ https://subler.org/ (free, open source).
- smcnally 4y agohttps://github.com/mifi/lossless-cut https://github.com/mifi/lossless-cut exposes more ffmpeg params.
- flemhans 4y agoWould be nice, but also a big task to make a user interface for everything. The filter chain system, for instance, is quite complicated. But of course there could be some compromise.
- cosmiccatnap 4y agoI love when a website does something simple, practical, and does it with a clean interface. Excellent
- alfg 4y agoAlso made something similar to this, inspired by HandBrake: https://alfg.github.io/ffmpeg-commander/ https://alfg.github.io/ffmpeg-commander/
- granneman 4y agoThat is really nice! Thank you — that will definitely help me learn how to build ffmpeg commands.
- MaikaDiHaika 4y agoOh neat. Thanks!
- vatotemking 4y agoMake video streamable (start playing when usable bits are available). Recently needed this for an auto-playing video background [1]: "ffmpeg.exe" -i "in.mp4" -c copy -movflags faststart "out.mp4" [1]https://beta.gsc.edu.ph https://beta.gsc.edu.ph
- NonNefarious 4y agoEh, thanks, but I don't want a Web-based solution.
- kwatsonafter 4y agoI have been looking for something like this for years without realizing it. Top form! Top form!
- ycombinete 4y agoThis will definitely come in handy! Something like this for PANDOC would be great as well