Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'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.



This is actually really cool. Thanks for sharing this!


Where/how does ffmpeg come in? How are you connecting screen output to ffmpeg input?


ffmpeg can capture an xterm as a source, it's called x11grab.


TIL! Thanks for sharing!

Edit: X11 as a source, not xterm. At least from what I can see.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: