Software⏱️ 4 min read📅 2026-06-11

How to Fix: How to get rid of ffmpeg pts has no value error

FFmpeg error: pts has no value when converting AVI to MP4

Quick Answer: Use the -metadata option with -c:v copy to include the original video timestamp metadata in the output file.

FFmpeg is a popular, open-source multimedia framework used for converting video and audio files. However, some users have reported an issue where the 'pts has no value' error occurs during the conversion process. This error affects users who are trying to convert AVI files to MP4 files using FFmpeg.

This error can be frustrating as it prevents the resulting MP4 file from being played in certain media players like QuickTime Player on a Mac, but it is playable in VLC. In this guide, we will explore the root causes of this issue and provide solutions to fix it.

🛑 Root Causes of the Error

  • The 'pts has no value' error occurs when FFmpeg fails to read or write the presentation timestamp (PTS) information for a video stream. This is typically caused by issues with the input file's metadata, such as missing or incorrect timestamps. In this case, the AVI file contains XVID video and MP3 audio, which may have different timestamp formats that cause conflicts.
  • Another possible reason is related to the output container format (MP4) not supporting all types of timestamps. This can happen when FFmpeg tries to write a timestamp for a stream that does not exist or has incorrect values.

✅ Best Solutions to Fix It

Re-encoding the video with correct timestamp information

  1. Step 1: Use the '-r' option with FFmpeg to re-encode the video with correct timestamp information. This will help ensure that the output MP4 file contains accurate timestamps for each frame.
  2. Step 2: Run the following command: `ffmpeg -i 103.avi -r 24 -c:v libx264 -crf 18 -c:a aac -b:a 128k 103.mp4`
  3. Step 3: This command re-encodes the video at 24 frames per second (FPS) with H.264 codec and AAC audio, which should provide accurate timestamps for each frame.

Using the '-v' option to display debug information

  1. Step 1: Use the `-v` option with FFmpeg to display more detailed debug information during the conversion process. This can help identify any issues related to timestamp formatting or other technical problems.
  2. Step 2: Run the following command: `ffmpeg -i 103.avi -v loglevel=warning -c:v copy -f mp4 103.mp4`
  3. Step 3: This command displays warning-level debug information, which may help diagnose any issues with timestamp formatting or other technical problems.

✨ Wrapping Up

To fix the 'pts has no value' error when converting AVI files to MP4 using FFmpeg, try re-encoding the video with correct timestamp information or use the '-v' option to display debug information. These methods should help ensure that the resulting MP4 file is playable in a variety of media players.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions