Asciinema as a first-class video format

Hi, new here

Just a thought - it’d be really cool if ffmpeg supported asciinema recordings. Easiest integration option would probably be to convert them to a subtitle format, then they can be rendered into/over video.

I haven’t looked at this in depth, but a more advanced option: make a “render buffer” type thing where actions can accumulate in a virtual tty, and have both diffs and key-frame snapshots. This would be useful in general, for when you accidentally drop 100MB of logs into your recording and want to reduce the file size by limiting the frame rate. Then implement the same filters that ffmpeg supports for video, but applied to the text buffers. Expose it with the same API as its video plugins, and a way to convert to pixel data (might need font and size in the header, with sensible defaults), and offer it up as a video option.

Hey @bitplane, welcome!

That’s an interesting idea. Feel free to reach out to ffmpeg authors, although I doubt they’ll go for it :slight_smile:

However, one thing which could be done without too much hassle and too much work is to implement raw frame output in agg or in the new convert subcommand of the upcoming asciinema CLI 3.0. It could output a raw image for each frame, sequentially as one stream, which could be piped straight into ffmpeg. Once those frames hit ffmpeg you can perform anything (ffmpeg can) on it and encode it into any type of video format.

Yeah I guess that would work, but it’d be cooler to have asciinema as a native format somewhere rather than have blobs in git.

Maybe an ASS converter would be a better option? Add a bit of JavaScript that creates a blank webm video of a given length via a web worker, and an HLS manifest to play it in whatever player works.

It’d support recordings in multiple languages, auto-select them, audio voiceover tracks, multiple recordings with video transitions between them, editing asciinema recordings in video editors, work with ffmpeg, maybe even dropping into slides?