Overview
The FLAC re-encoding feature uses FFmpeg to convert FLAC files to 24-bit/48kHz format with compression level 5, ensuring consistent audio quality across your library.Requirements
FFmpeg Installation
The re-encoding feature requires FFmpeg to be installed on your system:TagQt automatically detects if FFmpeg is installed. If not available, you’ll see an error message with installation instructions.
Encoding Specifications
The re-encoding process converts FLAC files to the following specifications:| Parameter | Value | Description |
|---|---|---|
| Sample Format | 32-bit signed integer (s32) | Provides 24-bit depth |
| Sample Rate | 48000 Hz | Professional audio standard |
| Compression Level | 5 | Balance between size and speed |
| Metadata | Preserved | All tags retained |
| Cover Art | Preserved | Album artwork maintained |
FFmpeg Command
The actual FFmpeg command used (fromflac.py:62-71):
Command Breakdown
-y- Overwrite output file without asking-i filepath- Input file-map_metadata 0- Copy all metadata from input-c:a flac- Use FLAC codec for audio-compression_level 5- Medium compression-sample_fmt s32- 32-bit signed integer samples (24-bit depth)-ar 48000- 48kHz sample rate-c:v copy- Copy video streams (cover art) as-is
Metadata Preservation
The re-encoding process carefully preserves all metadata:Tags Preserved
All standard and extended tags are preserved during re-encoding:Cover Art Preservation
Cover art is extracted before encoding and restored afterward:Using FLAC Re-encoding
From the Menu
- Navigate to Tools → File Actions → Re-encode FLAC
- Choose Selected or All Visible
- Wait for the encoding process to complete
- Review the results in the batch status dialog
From the Context Menu
- Right-click on selected FLAC files
- Choose Re-encode FLAC (Selected)
From the Sidebar
When viewing a FLAC file:- Click the Re-encode FLAC button in the sidebar
- The current file will be re-encoded
From the Command Palette
- Press
Ctrl+K - Search for “Re-encode FLAC”
- Select the command
File Processing
The re-encoding process follows these steps:- Validation - Confirms file is a FLAC file
- Metadata Backup - Extracts all tags and cover art
- Temporary Encoding - Creates encoded file in temp location
- Metadata Restoration - Restores all tags to new file
- File Replacement - Replaces original with re-encoded file
- Cleanup - Removes temporary files
Error Handling
Common Errors
FFmpeg not installed
FFmpeg not installed
Error: “Neither flac nor ffmpeg is installed”Solution: Install FFmpeg using your system’s package manager (see Requirements section)
Not a FLAC file
Not a FLAC file
Error: “Not a FLAC file”Solution: The re-encoding feature only works with
.flac files. Other formats are automatically skipped.Encoding failed
Encoding failed
Error: “Encoding failed: [stderr output]”Solution: Check the error message for details. Common causes include:
- Corrupted input file
- Insufficient disk space
- File permissions issues
Batch Operations
When re-encoding multiple files:- Progress is displayed in real-time
- Each file is processed sequentially
- Failed files don’t stop the batch operation
- Detailed results are available in the batch status dialog
- Click the progress bar to view detailed status
Performance Considerations
Processing Time
Re-encoding time depends on:- Original file size and length
- CPU performance
- Compression level (fixed at 5)
Disk Space
Temporary disk space required:- At least 2x the size of the largest file being processed
- Temporary files are automatically cleaned up after processing
Best Practices
Recommendations
- Test first: Re-encode a single file and verify the output before batch processing
- Check metadata: Verify that all tags and cover art are preserved after encoding
- Listen test: Compare audio quality before and after encoding
- Backup: Always maintain backups of your original FLAC files
- Free space: Ensure adequate disk space before starting large batch operations
Technical Details
Source Code Reference
- Source:
tagqt/core/flac.py - Class:
FlacEncoder - Main Method:
reencode_flac(filepath) - Worker:
FlacReencodeWorker(intagqt/ui/workers.py)
Encoder Detection
flac command-line tool, then falls back to FFmpeg. Both can be used for re-encoding.