Results 1 to 8 of 8

Thread: convertCAMV.py: Convert your videos to/from .ca_vp8.

  1. #1

    Default convertCAMV.py: Convert your videos to/from .ca_vp8.

    Hi, everyone.. new to the TW modding community, but I'm coming in hot with something I've been assured is much requested.

    I have reverse-engineered the .ca_vp8 movie file format used by ATW and later TW games, and made a small converter tool to decode and create .ca_vp8 videos.

    The .ca_vp8 or ('CAMV') movie file appears to be a modified version of VP8 IVF (https://wiki.multimedia.cx/index.php/IVF). You can make an IVF file with FFmpeg using the '-c:v libvpx' and '-f ivf' options, or by using the reference 'vpxenc.exe' encoder from the WebM project (https://www.webmproject.org/). This small script will then convert your .ivf file to a .ca_vp8 file. Such files have been tested in ATW, but might work for TWH/TWH2/ToB/TW3K as well.

    Note that .ca_vp8 files only encode video; the accompanying audio is handled seperately by the game, likely through Wwise.

    The script can be downloaded here, as well as a few tenuous notes on the structure of the CAMV file format:
    https://gitlab.com/johnsirett/ca_vp8-reverse.

    Encoding video:

    Videos must be 30fps, or converted to 30fps.

    Code:
    ffmpeg -i 'example.mkv' -c:v libvpx -crf 4 -b:v 10M -r 30 'front_end_background.ivf'
    python convertCAMV.py 'front_end_background.ivf' 'front_end_background.ca_vp8'
    Decoding video:

    Code:
    python convertCAMV.py 'intro.ca_vp8' 'intro.ivf'
    ffmpeg -i 'intro.ivf' -c:v libx264 -preset slow -crf 22 'intro.mkv'
    A technical description of the .ca_vp8 format is incoming...


  2. #2
    Benjin's Avatar Artifex
    Join Date
    May 2015
    Location
    London, UK
    Posts
    377

    Default Re: convertCAMV.py: Convert your videos to/from .ca_vp8.

    Excellent work man, thanks again for this!
    3D ARTIST (MODELS/TEXTURES), ANIMATOR, RIGGER

  3. #3
    Frodo45127's Avatar Artifex
    Patrician

    Join Date
    Dec 2011
    Location
    Lost In Translation
    Posts
    440

    Default Re: convertCAMV.py: Convert your videos to/from .ca_vp8.

    Good work man, really good work but... one question: There is no problem with me integrating this into RPFM isn't? Other than the license thing I mean (RPFM uses MIT license), but that can be easily solved. Of course, credits should be given, as always someone helps with something in RPFM.

  4. #4

    Default Re: convertCAMV.py: Convert your videos to/from .ca_vp8.

    Hi Jsirett.

    You are a genius!! It is working in WH2 as well. But, It doesn't work in TW3k.. I guess because 3k ca_vp8 file is over 3 mega bytes.

    This is error message.

    Traceback (most recent call last):
    File "C:\ffmpeg\bin\convertCAMV.py", line 165, in <module>
    camv_to_ivf(args.inFile, args.outFile)
    File "C:\ffmpeg\bin\convertCAMV.py", line 59, in camv_to_ivf
    frameData = inFile.read(frameEntry.frameSize)
    OverflowError: cannot fit 'int' into an index-sized integer

    Could you work it out?

    Thanks in advance.

    I respect you!

    Stay safe.

  5. #5

    Default Re: convertCAMV.py: Convert your videos to/from .ca_vp8.

    Hi jsirett.

    I have managed it anyhow. It doesn't need to convert ca_vp8 to mkv. However, TW3K using transparent background video files.
    And ffmpeg doesn't recognize alpha mov file or alpha avi.

    I think webp needs to be convert to ivf file. Is it possible to convert webp to ivf?

    Thank you in advance.

    Stay safe.

  6. #6

    Default Re: convertCAMV.py: Convert your videos to/from .ca_vp8.

    Hello, this is great! Amazing that you got it to work, unfortunately the link is no longer working https://gitlab.com/johnsirett/ca_vp8-reverse* shows page not found and I appear to be stuck using your guide, I have converted my file to .ivf and the scripts provided work up until I get to
    [NULL @ 000002916e86a1c0] Unable to find a suitable output format for 'pythonconvertCAMV.py'pythonconvertCAMV.py: Invalid argument
    so I assume it has something it has something to do with the missing files?

  7. #7

    Default Re: convertCAMV.py: Convert your videos to/from .ca_vp8.

    Great stuff, exactly what I was looking for!!!

    I am using it to clean and upscale WHII movies to 4k with https://www.topazlabs.com/video-enhance-ai


  8. #8
    Biggus Splenus's Avatar Primicerius
    Join Date
    Mar 2012
    Location
    South Australia
    Posts
    3,547

    Default Re: convertCAMV.py: Convert your videos to/from .ca_vp8.

    TL;DR: works fine, here's a link to the new python script and stuff
    https://gitlab.com/johnsirett-public/ca_vp8-reverse
    Now does anyone know how audio works? Wth is wwise?

    Has anyone got this file sitting around in their downloads? Would be great to get a hold of it, currently can't find another way around this.

    edit: found it, but it appears to be broken for me. still trying though

    edit2: noticed rpfm picked up that the exported videos have a framerate of 30.000002 rather than vanilla's 30.0003. I wasn't sure if it was worth trying, but I reprocessed the video files specifically at 30.0003 fps, which rpfm did verify for me. Still results in a crash when the game attempt to play the video...

    Before I hit save of this edit, I realised I'm a moron and didn't add a db entry for the video. Works perfectly fine. Fun times.
    Last edited by Biggus Splenus; May 25, 2021 at 02:32 AM.
    | R5 3600, RTX 2060, MSI B450I, 32GB 3200MHz CL16 DDR4, AX760i, NH-U12S |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •