HandBrake icon indicating copy to clipboard operation
HandBrake copied to clipboard

Frame Rate Problem Importing Type 1 DV Files (60,000 fps)

Open wdelaughter opened this issue 1 year ago • 11 comments

Problem Description

This is identical to the closed issue #6305. Somewhere in the past 12 months one of the updates to Handbrake broke importing Type 1 DV files so they all show 60,000 fps on import.

If I convert the file to Type 2 DV the problem goes away. If I convert the type 2 DV file back to type 1 the problem reappears.

Workaround for anyone else that runs into this is to convert your DV file to type 2.

Activity Log, Crash Log or any other details

**** Type 1 DV File ****
[11:25:59] CPU: AMD Ryzen 9 5900X 12-Core Processor
[11:25:59]  - logical processor count: 24
[11:25:59] Intel Quick Sync Video support: no
[11:25:59] hb_scan: path=R:\DV\Tape02\Tape2'20001224 19.15.08.avi, title_index=1
Input #0, avi, from 'R:\DV\Tape02\Tape2'20001224 19.15.08.avi':
  Duration: 00:01:46.57, start: 0.000000, bitrate: 28857 kb/s
  Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 60k fps, 29.97 tbr, 60k tbn
  Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[11:25:59] scan: decoding previews for title 1
[11:25:59] scan: audio 0x1: pcm_s16le, rate=48000Hz, bitrate=1536000 Unknown (pcm_s16le, 2.0 ch, 1536 kbps)
[11:25:59] using bitstream PAR 8:9
[11:25:59] scan: 10 previews, 720x480, 60000.000 fps, autocrop = 0/0/0/0, aspect 4:3, PAR 8:9, color profile: 6-1-6, chroma location: topleft

**** Type 2 DV File ****
[11:53:25] CPU: AMD Ryzen 9 5900X 12-Core Processor
[11:53:25]  - logical processor count: 24
[11:53:25] Intel Quick Sync Video support: no
[11:53:25] hb_scan: path=R:\DV\Tape02\Tape2'20001224 19.15.08_type2.avi, title_index=1
Input #0, avi, from 'R:\DV\Tape02\Tape2'20001224 19.15.08_type2.avi':
  Duration: 00:01:46.57, start: 0.000000, bitrate: 31443 kb/s
  Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn
  Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2 channels, s16, 1536 kb/s
[11:53:25] scan: decoding previews for title 1
[11:53:25] scan: audio 0x1: pcm_s16le, rate=48000Hz, bitrate=1536000 Unknown (pcm_s16le, 2.0 ch, 1536 kbps)
[11:53:25] using bitstream PAR 8:9
[11:53:25] scan: 10 previews, 720x480, 29.970 fps, autocrop = 0/0/0/0, aspect 4:3, PAR 8:9, color profile: 6-1-6, chroma location: topleft

What Operating System are you running?

Windows 11

What version of HandBrake are you running?

1.9.0

Where did you download HandBrake from?

Internal Updater

wdelaughter avatar Dec 09 '24 18:12 wdelaughter

Hello,

Welcome to the HandBrake repository.

[!WARNING] Please be cautious of any non-members suggesting that you download a "DLL" or any other files from 3rd party websites. These are likely malicious! Members of the HandBrake team can be identified by the "(Member)" label in the top right of any response from them.

[!TIP] For HandBrake documentation, please see https://handbrake.fr/docs

Thank You, The HandBrake Bot

github-actions[bot] avatar Dec 09 '24 18:12 github-actions[bot]

Do you have a sample file you can share that reproduces this?

sr55 avatar Dec 09 '24 19:12 sr55

I might can do that. What's the best way to share a sample file and size limitations?

wdelaughter avatar Dec 09 '24 20:12 wdelaughter

Any safe filesharing site. Dropbox, google drive, one drive etc. Would just need a very short clip. don't need anything large.

sr55 avatar Dec 09 '24 20:12 sr55

Let me know if this works.

https://www.dropbox.com/scl/fo/365so0xl909nivna7smeq/AOk0SoerXUpeADhpFjI5mjc?rlkey=4lrxajogetn4qu457qzdeftmm&st=a0xhg5gm&dl=0

wdelaughter avatar Dec 09 '24 20:12 wdelaughter

problem with source, remuxing using ffmpeg took out the problem

ffmpeg -i /home/solomoncyj/Downloads/01-Floorcraft.avi -c:a copy -c:v copy out.avi
ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 14 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-lcms2 --enable-libaom --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcodec2 --enable-libcdio --enable-libdrm --enable-libjack --enable-libjxl --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libplacebo --enable-librsvg --enable-librav1e --enable-librubberband --enable-libqrencode --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libshaderc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libvpl --enable-runtime-cpudetect
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[avi @ 0x55ecbf360280] Switching to NI mode, due to poor interleaving
Input #0, avi, from '/home/solomoncyj/Downloads/01-Floorcraft.avi':
  Duration: 00:00:31.83, start: 0.000000, bitrate: 28869 kb/s
  Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 60k fps, 29.97 tbr, 60k tbn
  Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf61.1.100
  Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv411p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 28771 kb/s, 60k fps, 29.97 tbr, 59.94 tbn
  Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Press [q] to stop, [?] for help
[out#0/avi @ 0x55ecbf3f09c0] video:111797KiB audio:5968KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.065243%
size=  117842KiB time=00:00:31.83 bitrate=30327.0kbits/s speed= 278x    

solomoncyj  ~/   10:03  ffprobe /home/solomoncyj/Downloads/01-Floorcraft.avi
ffprobe version 7.0.2 Copyright (c) 2007-2024 the FFmpeg developers
  built with gcc 14 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-lcms2 --enable-libaom --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcodec2 --enable-libcdio --enable-libdrm --enable-libjack --enable-libjxl --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libplacebo --enable-librsvg --enable-librav1e --enable-librubberband --enable-libqrencode --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libshaderc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libvpl --enable-runtime-cpudetect
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[avi @ 0x55c2804e4100] Switching to NI mode, due to poor interleaving
Input #0, avi, from '/home/solomoncyj/Downloads/01-Floorcraft.avi':
  Duration: 00:00:31.83, start: 0.000000, bitrate: 28869 kb/s
  Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 60k fps, 29.97 tbr, 60k tbn
  Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s

solomoncyj  ~/   10:04  ffprobe ./out.avi 
ffprobe version 7.0.2 Copyright (c) 2007-2024 the FFmpeg developers
  built with gcc 14 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --enable-chromaprint --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-lcms2 --enable-libaom --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libass --enable-libbluray --enable-libbs2b --enable-libcodec2 --enable-libcdio --enable-libdrm --enable-libjack --enable-libjxl --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libilbc --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libplacebo --enable-librsvg --enable-librav1e --enable-librubberband --enable-libqrencode --enable-libsmbclient --enable-version3 --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libshaderc --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-avfilter --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libvpl --enable-runtime-cpudetect
  libavutil      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
Input #0, avi, from './out.avi':
  Metadata:
    software        : Lavf61.1.100
  Duration: 00:00:31.83, start: 0.000000, bitrate: 30327 kb/s
  Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 59.94 fps, 29.97 tbr, 59.94 tbn
  Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 2 channels, s16, 1536 kb/s

Ps: the out.avi fiule grew by 6 mb aftyer remuxing. idk why

solomoncyj avatar Dec 10 '24 02:12 solomoncyj

Because ffmpeg converted it to a DV Type 2 file which is what I said works in my problem description. That's also why it grew in size because Type 2 is less efficient than Type 1.

FWIW, ffmpeg also detects the DV Type 1 file as having 60,000 fps and the output ended up at 59.94 instead of 29.97.

wdelaughter avatar Dec 10 '24 02:12 wdelaughter

the 60 fps is before deinterleving. vlc manages to detect to fps to be 60 is the DV type 1, tho

solomoncyj avatar Dec 10 '24 02:12 solomoncyj

the 60 fps is before deinterleving. vlc manages to detect to fps to be 60 is the DV type 1, tho

Yeah, virtualdub 2 also detects the original file properly at 29.97. I'd have to uninstall and reinstall a bunch of versions to see when it actually broke in Handbrake because I know it used to work fine. I don't mess with captured MiniDV video very often so I haven't tried in a long while. I can't rule out that the program I used to capture it wrote it out malformed but I'm pretty sure I have a mix of Scenalyzer captured content and I used DVDate today to do some type1 -> type 2 -> type 1 conversions and that is detected wrong as well though the type 2 works perfectly. Also the fact that ffmpeg is detecting the type one at 60,000 fps isn't promising even if it manages to correct the output. The issue seems to be cosmetic as the output from Handbrake looks fine from both Type 1 and Type 2. Workaround is to convert it to Type 2. If Handbrake is using ffmpeg on the back end, then the problem likely originates on that end and not with Handbrake.

wdelaughter avatar Dec 10 '24 03:12 wdelaughter

HandBrake uses FFmpeg libavformat library to demux AVI files, so it would need to be fixed in libavformat. Can you open an issue on https://trac.ffmpeg.org with the ffmpeg output and the sample?

galad87 avatar Dec 10 '24 06:12 galad87

This seems to be reported already several times to FFmpeg: https://trac.ffmpeg.org/ticket/11339 There is also a bisect in this bug report.

Nomis101 avatar Dec 13 '24 23:12 Nomis101