Extract audio / video streams from TeamViewer recording (TVS file)?

3.3k views Asked by At

TeamViewer allows to record sessions in a proprietary format with the file extension .tvs. It can be converted to AVI with any codec installed on the local computer (using TeamViewer), but not MP4 or other container formats.

The encoding to AVI is really slow (not multi-threaded apparently, using x264 vfw; XviD would had taken even longer), the resulting file did not play well in VLC and wasn't editable at all in Avidemux on Windows.

Therefore, I'd like to know if it's possible to extract the audio and video stream inside the TVS file for further processing with ffmpeg (otherwise, I need to encode twice, which means 4 hours per 60min footage). I hope it's similar to other formats, just with a custom codec - which I hope is not built-in in TeamViewer, but available to other applications as well.

2

There are 2 answers

4
mwfearnley On

TVS is a proprietary format. There doesn't seem to be a lot of information about it online. A small amount of analysis can be found at http://www.jerrysguide.com/tips/demystify-tvs-file-format.html.

I looked at one with a hex editor. It contains a text-based header, a Base64 text footer, and a lot of binary data. For example:

TVS
Version 5
TVVersion   13.0.6447 
Date    2018-03-03 15.24
TVServer    
ClientID    314159265
ServerID    MY_HOME_PC (123 456 789)
LocalParticipantID  1234567890123456789
GUID    {01234567-89AB-CDEF-0123-456789012345}
StreamTypes 2
ScreenFeatures  127
MetadataPosition    0000000000169e98
BEGIN
[Lots and lots of binary data]
END
[320 bytes of Base64]

(The MetadataPosition marks the position after the END where the Base64 starts.)

The binary data seems to contain several DEFLATE-compressed chunks. They seem to contain meaningful data in them, including a list of screen resolutions, a mouse cursor, and some 32-bit RGB image data, but the structure is not easy to discern.

There may be hope for decoding the format, but I couldn't see any efforts towards it.

It might be just a recording of a TeamViewer session. If that uses something like the RFB protocol, then it might be similar to the VMware Video format.

EDIT: In case it helps anyone, I've written a quick program in C to extract/dump the contents of the KEY chunks from the file: (gist)

EDIT: I've found that TeamViewer will happily play at least simple files consisting of just TVS\r\nBEGIN\r\nKEY...\r\nEND, stripping any other data. Although I suppose it may well break if things like the Version or StreamTypes can affect the decoding.

0
KungPhoo On

It seems, that you can install VFW (Video For Windows) video codec encoders, and TeamViewer will accept and use them. There is a project: https://sourceforge.net/projects/x264vfw/ that allows to encode to x264, thus you get an AVI container with an MP4 video.