How to Encode Grass Valley HQX Video with FFmpeg

This article provides a quick guide on how to transcode your video files into the professional, high-quality Grass Valley HQX (formerly Canopus HQX) intermediate codec using FFmpeg. You will learn the exact command-line syntax, the best pixel formats for 10-bit editing, and how to control quality levels to achieve optimal editing performance.

The Basic FFmpeg Command

To transcode a video to Grass Valley HQX, you must specify the hqx video encoder. Because HQX is a high-quality intermediate codec, it is most commonly wrapped in an AVI container.

Here is the standard command to convert an input video:

ffmpeg -i input.mp4 -c:v hqx -pix_fmt yuv422p10le output.avi

To get the most out of the Grass Valley HQX codec, you should customize the pixel format, quality scale, and audio settings.

1. Pixel Format (-pix_fmt)

HQX is designed for high-bit-depth video. Choose the pixel format that matches your source and workflow requirements: * yuv422p10le: 10-bit YUV 4:2:2 (Most common for professional editing). * yuv444p10le: 10-bit YUV 4:4:4 (For maximum color fidelity). * yuva444p10le: 10-bit YUV 4:4:4 with an Alpha/transparency channel. * yuv422p: 8-bit YUV 4:2:2.

2. Quality Control (-q:v)

HQX uses a variable bitrate based on a quality scale. You can set the quality level using the -q:v (or -qscale:v) option. * The scale ranges from 1 (highest quality, largest file size) to 31 (lowest quality, smallest file size). * For master-quality intermediate files, a value between 2 and 5 is highly recommended.

ffmpeg -i input.mp4 -c:v hqx -pix_fmt yuv422p10le -q:v 3 output.avi

3. Preserving High-Quality Audio

When creating intermediate files for editing, you should avoid compressing the audio. Use uncompressed PCM audio to match the high quality of the HQX video:

ffmpeg -i input.mp4 -c:v hqx -pix_fmt yuv422p10le -q:v 3 -c:a pcm_s24le output.avi

Verifying the Output File

Once the transcoding process is complete, you can verify that the file was encoded correctly with the Grass Valley HQX codec by running ffprobe:

ffprobe output.avi

Look for the video stream line in the output, which should display Video: hqx. Your new file is now ready for high-performance editing in NLEs like Grass Valley EDIUS, Adobe Premiere Pro, or DaVinci Resolve.