0

I have a video that I'm processing and transcoding to another format via ffmpeg. I've come across this before where the reported fps in ffprobe seems to be half of what it is when played but don't understand why. Problem is that when ffmpeg processes this file, the output is using the seemingly misreported framerate and I have to override it and redo the file.

Here's the stream info for the video stream:

$ ffprobe -i file.mp4 -print_format json -show_streams 2>/dev/null
        {
            "index": 0,
            "codec_name": "h264",
            "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "profile": "Main",
            "codec_type": "video",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 1920,
            "height": 1080,
            "coded_width": 1920,
            "coded_height": 1080,
            "closed_captions": 0,
            "has_b_frames": 1,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "16:9",
            "pix_fmt": "yuv420p",
            "level": 40,
            "chroma_location": "left",
            "field_order": "progressive",
            "refs": 1,
            "is_avc": "true",
            "nal_length_size": "4",
            "r_frame_rate": "15/1",
            "avg_frame_rate": "15/1",
            "time_base": "1/1000",
            "start_pts": 67,
            "start_time": "0.067000",
            "bits_per_raw_sample": "8",
            "disposition": {
                "default": 1,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            }
        },

How can I tell this is the case and not actually 15fps? Looking for a programmatic way to detect this case.


$ ffprobe -version
ffprobe version 4.4.1-full_build-www.gyan.dev Copyright (c) 2007-2021 the FFmpeg developers
built with gcc 11.2.0 (Rev1, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100

Windows build

6
  • At the moment, I am blanket assuming anything reported to having 15 or 14.985 fps is actually double but I'd like to find a more reliable way to detect this. Aug 16, 2022 at 4:57
  • Execute FFprobe with show_packets argument: ffprobe -select_streams v -show_packets file.mp4. Look at pts_time and duration_time. For 15 fps the minimum delta between two pts should be 0.0667 seconds, and the duration should be 0.0667 seconds. You may look for frames counting, and divide the number of frames by video duration.
    – Rotem
    Aug 16, 2022 at 5:37
  • Hmm, yeah so sample it myself. I think I can do that as a verification if I see 15 or 14.985. Aug 16, 2022 at 5:45
  • Some fields are missing from the ffprobe output. Which version?
    – Gyan
    Aug 16, 2022 at 9:17
  • @Gyan, v4.4.1 one of your builds. :) Though out of date it seems. Aug 16, 2022 at 17:03

0

You must log in to answer this question.

Browse other questions tagged .