4 ms·
So, this seems to just download chrome and run some sort of terminal emulator in it (then converts it to video). Do I have that right? Seems like massive overki
by ndegruchy 4y ago
So, this seems to just download chrome and run some sort of terminal emulator in it (then converts it to video). Do I have that right? Seems like massive overkill for something you could do with just ffmpeg and a terminal emulator...
- taviso 4y agoI've actually used ffmpeg + GNU screen to do something very similar in the past. The benefit of using GNU screen is that the "tape" can be a shell script. I suppose if you don't like shell scripts that's not a benefit, but I do like them. For example, instead of: Type "echo 'Welcome to VHS!'" # Pause for dramatic effect... Sleep 500ms Enter With GNU screen, you would write: #!/bin/sh screen -d -m -S whatever -- bash screen -S whatever -X stuff "echo Welcome to screen" sleep 0.5 screen -S whatever -X stuff $'\n' If you want to start interacting with the session, just do screen -r whatever You can also read what is in the screen with -X hardcopy, then do something with the output, like verify the output is correct or adjust the input.
- maaslalani 4y agoThis is actually really cool. Thanks for sharing this!
- ComputerGuru 4y agoWhere/how does ffmpeg come in? How are you connecting screen output to ffmpeg input?
- taviso 4y agoffmpeg can capture an xterm as a source, it's called x11grab.
- ComputerGuru 4y agoTIL! Thanks for sharing! Edit: X11 as a source, not xterm. At least from what I can see.
- mdaniel 4y agoI think that may just be copy-paste in the Dockerfile, as it doesn't seem to use chromium (nor chrome) anywhere else in the repo: https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/charmbracelet/vhs%24+chromium&patternType=standard https://sourcegraph.com/search?q=context:global+repo:%5Egith... which for sure matches my mental model of using ttyd and ffmpeg -- what in the world would anyone need chromium for?
- taviso 4y ago> what in the world would anyone need chromium for? Perhaps rendering an xterm.js canvas? (I don't know, it's just a guess)
- nvrspyx 4y agoOne of the dependencies is `rod`[0], which is a web scraping/automation library, and I believe requires a browser to work. I don't know what they're using it for though as I haven't looked at the code (and I'm not familiar with Go anyways). There's a feature of the library that finds and installs a browser, but they may just be preemptively including chromium in the dockerfile and assuming that non-docker users will already have a supported browser on their machine. 0: https://github.com/go-rod/rod https://github.com/go-rod/rod