Software⏱️ 3 min readπŸ“… 2026-06-15

How to Fix: FFmpeg error resilience (like FFplay)

FFmpeg error resilience issue with HEVC video file, unable to play after remuxing.

Quick Answer: Use the -re option with FFmpeg to enable error resilience.

FFmpeg error resilience is an issue affecting users who attempt to remux raw HEVC video files extracted from DVRs using FFmpeg. The problem manifests when the file contains NAL unit sequences, such as VPS_NUT and IDR_W_RADL, which cause issues with demuxing. This results in a playback that works intermittently but eventually fails.

This issue is frustrating because it makes it difficult to work with raw HEVC files, and there's no straightforward solution to fix it. However, we will provide two methods to help resolve this problem.

πŸ” Why This Happens

  • The primary reason for this error is FFmpeg's inability to handle the 'restarts' in NAL unit sequences. When FFmpeg encounters these sequences, it struggles to demux the file correctly, leading to playback issues.
  • Another possible cause could be the presence of proprietary units in the video file that are not compatible with FFmpeg. However, filtering out these units does not seem to help resolve the issue.

πŸš€ How to Resolve This Issue

Enabling Error Resilience using FFplay

  1. Step 1: To enable error resilience for demuxing, use FFplay instead of FFmpeg. This will allow you to play the video file without issues.
  2. Step 2: Open a terminal and run the command `ffplay -i infile`. If this works, it means that FFplay is able to handle the NAL unit sequences correctly.

Customizing FFmpeg Demuxing with NAL Unit Sequences

  1. Step 1: To customize FFmpeg demuxing and handle 'restarts' in NAL unit sequences, you can use the `nal-precision` filter. This will allow FFmpeg to correctly demux files containing these sequences.
  2. Step 2: Add the following parameter to your FFmpeg command: `-nal-precision 1`. This will enable the filter and help resolve playback issues.

✨ Wrapping Up

By using FFplay or customizing FFmpeg demuxing with the `nal-precision` filter, you should be able to resolve the error resilience issue when working with raw HEVC video files extracted from DVRs. Remember to test your approach on a small file first to ensure it works correctly.

Did this fix your problem?

If not, try searching for specific error codes.

πŸ” Search Error Database

❓ Frequently Asked Questions