Skip to main content

Video encoding and codecs

Terminology spotlight: A codec compresses (during export) and decompresses (during playback) video files. Different codecs can affect the quality and size of the video. A balance must be found to maintain quality while keeping the file manageable.

Video upload guidelines:

  • Max size: 999 MB (required)

    • TESTING NEEDED: max size may be per upload and not per file (eg, if you upload multiple videos at once, a single upload cannot exceed 999MB. This is unconfirmed.)

  • Allowed formats: MP4, MOV, M4V, FLV (required)

  • Video codec: MP4 (H.264) (recommended)

  • Audio codec: AAC or MP3 (recommended)


Video upload error corrupted or incompatible codecs

Video upload error: It seems like we cannot upload your file FILE.TYPE. This could happen because it is corrupted or it has incompatible codecs. Please try with another file.

To troubleshoot the "invalid codecs" error, let's break down the information and see how it connects to your situation.

Key Information

  • Kartra video system uses Video.js and the HTML5 video playback API, which supports certain video file formats like MP4 and WebM, as well as adaptive streaming formats like HLS and DASH.

  • Kartra supports file extensions like MP4, MOV, M4V, FLV, but converts them to MP4 (H.264) during upload.

Troubleshooting Steps

  1. Check the video file format and codecs:

    • The error about invalid codecs suggests that your file may be in a format or codec that Kartra does not support, even if it is one of the allowed file extensions.

    • If your video was created on an iPhone in the HDR format, it may be incompatible with Kartra video.

  2. Verify the codecs in your video file:

    • MP4 (H.264) is the most widely supported format across all browsers and devices. Make sure your video codec is H.264 and your audio codec is either AAC or MP3. This is the expected configuration for MP4 files.

    • If you're using a file format other than MP4 (e.g., MOV, M4V, FLV), ensure that it uses H.264 for video and AAC/MP3 for audio. If it uses a different codec (e.g., VP8, VP9, or Theora), Kartra might not be able to convert it properly.

    • You can check the codec information of your video using tools like MediaInfo or VLC Media Player to confirm the codec. Depending on your device and operating system, you may also be able to find these information by right-clicking the file and selecting an option from the menu that shows you file details.

  3. Re-encode the video if necessary:

    • If your video file contains unsupported codecs (e.g., VP8, VP9, or Theora), you'll need to re-encode the video to H.264 (video codec) and AAC (audio codec).

    • You can use a video tool like CapCut, HandBrake or FFmpeg to re-encode your video. Set the output format to MP4 and select H.264 for video and AAC for audio.

    • If your video was created in HDR,

  4. File Size:

    • While not directly related to codecs, ensure your video file size is not too large for Kartra’s upload limits.

Conclusion (TL,DR)

To resolve the "invalid codecs" error, check that your video is encoded with the correct H.264 video codec and AAC or MP3 audio codec. If the video is using incompatible codecs (like VP8, VP9, or Theora), re-encode it to meet Kartra’s supported specifications. If needed, use tools like MediaInfo, CapCut, HandBrake, or FFmpeg to re-encode the video to the proper format.

Notes on iPhone HDR

HDR (High Dynamic Range) is enabled by default on iPhones when recording video. This feature improves video quality by providing a greater range of brightness and color, and it uses the HEVC (H.265) codec for encoding. As a result, HDR video files tend to be larger and more complex than standard SDR videos, and they may include metadata indicating the content is HDR (e.g., Dolby Vision or HLG).

However, while HDR enhances the video quality, it can cause issues when uploading to certain platforms or systems that don't support HDR or HEVC encoding. In fact, after testing since the iPhone 12, we've found that enabling HDR often triggers errors during uploads, likely due to incompatibility with the platform’s video processing or the encoding format.

The simplest workaround currently is to use the InShot app to convert the HDR video to a standard SDR format. We also recommend advising users to turn off HDR in their iPhone settings when recording videos, especially if they encounter upload errors.


Video.js technical details

The following technical details were provided by the Kartra dev team in KARS-8181. This context is ONLY relevant if a user specifically asks why some formats are supported by Video.js but not in the context of Kartra video. The following details explain the default function of Video.js and the HTML5 video playback API.

Kartra video uses Video.js as the underlying library to generate the video player.

Video.js uses the HTML5 video playback API, which means that it supports “traditional” file formats such as MP4 and WebM, as well as adaptive streaming formats such as HLS and DASH.

However, although Kartra uses Video.js to generate the Kartra Video player, the Kartra player does NOT support all formats natively present in Video.js.

  1. MP4 (H.264)

    • Container: .mp4

    • Video Codec: H.264

    • Audio Codec: AAC or MP3

    • Widely supported across all modern browsers.

  2. WebM

    • Container: .webm

    • Video Codec: VP8, VP9

    • Audio Codec: Vorbis, Opus

    • Supported in modern versions of Chrome, Firefox, Edge, and Opera.

  3. Ogg

    • Container: .ogg, .ogv

    • Video Codec: Theora

    • Audio Codec: Vorbis

    • Supported in Firefox and some other browsers, but not as widely used.

Advanced Browser-Specific Support

  1. HLS (HTTP Live Streaming)

    • Container: .m3u8

    • Supported in Safari natively.

    • Requires the Video.js HLS plugin or similar for other browsers.

  2. DASH (Dynamic Adaptive Streaming over HTTP)

    • Container: .mpd

    • Requires a plugin like Dash.js or a custom player integration.

However, when uploading a video to Kartra, the file extensions are limited to MP4, MOV, M4V, FLV - which are then converted on Amazon ECS to MP4 (H.264). WebM, OGG, HLS, and DASH files cannot be uploaded to Kartra without conversion to a supported file type.

Did this answer your question?