g_timebase.den out of range [1..1000000000] ffmpeg
by TheJooomes from LinuxQuestions.org on (#6H3HQ)
Hey I've been successfully transcoding all sorts of video files the past couple days until I came across this video which ffmpeg throws a tizzy over. This is the command and full output of ffmpeg. What's wrong? How can I transcode this video with ffmpeg?
Code:$ ffmpeg -i VID20220716003551.mp4 -c:v vp9 -crf 40 -vf "scale=iw/2:ih/2" -c:a libopus output.webm
ffmpeg version 5.1.4-0+deb12u1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID20220716003551.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2022-07-16T05:45:32.000000Z
location : +00.0000+000.0000/
location-eng : +00.0000+000.0000/
com.android.version: 12
Duration: 00:09:40.87, start: 0.000000, bitrate: 20162 kb/s
Stream #0:0[0x1](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 156 kb/s (default)
Metadata:
creation_time : 2022-07-16T05:45:32.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
Stream #0:1[0x2](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt470bg/smpte170m, progressive), 1080x1920, 20002 kb/s, 29.79 fps, 90k tbr, 90k tbn (default)
Metadata:
creation_time : 2022-07-16T05:45:32.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of 90.00 degrees
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
Stream #0:0 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libvpx-vp9 @ 0x55dcdc443200] v1.12.0
[libvpx-vp9 @ 0x55dcdc443200] vpx_codec_enc_cfg
[libvpx-vp9 @ 0x55dcdc443200] generic settings
g_usage: 0
g_threads: 6
g_profile: 0
g_w: 960
g_h: 540
g_bit_depth: 8
g_input_bit_depth: 8
g_timebase: {52277477/1557450000}
g_error_resilient: 0
g_pass: 0
g_lag_in_frames: 25
[libvpx-vp9 @ 0x55dcdc443200] rate control settings
rc_dropframe_thresh: 0
rc_resize_allowed: 0
rc_resize_up_thresh: 60
rc_resize_down_thresh: 30
rc_end_usage: 3
rc_twopass_stats_in: (nil)(0)
rc_target_bitrate: 256
[libvpx-vp9 @ 0x55dcdc443200] quantizer settings
rc_min_quantizer: 0
rc_max_quantizer: 63
[libvpx-vp9 @ 0x55dcdc443200] bitrate tolerance
rc_undershoot_pct: 25
rc_overshoot_pct: 25
[libvpx-vp9 @ 0x55dcdc443200] temporal layering settings
ts_number_layers: 1
[libvpx-vp9 @ 0x55dcdc443200]
layer_target_bitrate: 0 0 0 0 0
[libvpx-vp9 @ 0x55dcdc443200]
ts_rate_decimator: 0 0 0 0 0
[libvpx-vp9 @ 0x55dcdc443200]
ts_periodicity: 0
[libvpx-vp9 @ 0x55dcdc443200]
ts_layer_id: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[libvpx-vp9 @ 0x55dcdc443200] decoder buffer model
rc_buf_sz: 6000
rc_buf_initial_sz: 4000
rc_buf_optimal_sz: 5000
[libvpx-vp9 @ 0x55dcdc443200] 2 pass rate control settings
rc_2pass_vbr_bias_pct: 50
rc_2pass_vbr_minsection_pct: 0
rc_2pass_vbr_maxsection_pct: 2000
[libvpx-vp9 @ 0x55dcdc443200] rc_2pass_vbr_corpus_complexity:0
[libvpx-vp9 @ 0x55dcdc443200] keyframing settings
kf_mode: 1
kf_min_dist: 0
kf_max_dist: 128
[libvpx-vp9 @ 0x55dcdc443200]
[libvpx-vp9 @ 0x55dcdc443200] Failed to initialize encoder: Invalid parameter
[libvpx-vp9 @ 0x55dcdc443200] Additional information: g_timebase.den out of range [1..1000000000]
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
Code:$ ffmpeg -i VID20220716003551.mp4 -c:v vp9 -crf 40 -vf "scale=iw/2:ih/2" -c:a libopus output.webm
ffmpeg version 5.1.4-0+deb12u1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'VID20220716003551.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2022-07-16T05:45:32.000000Z
location : +00.0000+000.0000/
location-eng : +00.0000+000.0000/
com.android.version: 12
Duration: 00:09:40.87, start: 0.000000, bitrate: 20162 kb/s
Stream #0:0[0x1](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 156 kb/s (default)
Metadata:
creation_time : 2022-07-16T05:45:32.000000Z
handler_name : SoundHandle
vendor_id : [0][0][0][0]
Stream #0:1[0x2](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt470bg/bt470bg/smpte170m, progressive), 1080x1920, 20002 kb/s, 29.79 fps, 90k tbr, 90k tbn (default)
Metadata:
creation_time : 2022-07-16T05:45:32.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of 90.00 degrees
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> vp9 (libvpx-vp9))
Stream #0:0 -> #0:1 (aac (native) -> opus (libopus))
Press [q] to stop, [?] for help
[libvpx-vp9 @ 0x55dcdc443200] v1.12.0
[libvpx-vp9 @ 0x55dcdc443200] vpx_codec_enc_cfg
[libvpx-vp9 @ 0x55dcdc443200] generic settings
g_usage: 0
g_threads: 6
g_profile: 0
g_w: 960
g_h: 540
g_bit_depth: 8
g_input_bit_depth: 8
g_timebase: {52277477/1557450000}
g_error_resilient: 0
g_pass: 0
g_lag_in_frames: 25
[libvpx-vp9 @ 0x55dcdc443200] rate control settings
rc_dropframe_thresh: 0
rc_resize_allowed: 0
rc_resize_up_thresh: 60
rc_resize_down_thresh: 30
rc_end_usage: 3
rc_twopass_stats_in: (nil)(0)
rc_target_bitrate: 256
[libvpx-vp9 @ 0x55dcdc443200] quantizer settings
rc_min_quantizer: 0
rc_max_quantizer: 63
[libvpx-vp9 @ 0x55dcdc443200] bitrate tolerance
rc_undershoot_pct: 25
rc_overshoot_pct: 25
[libvpx-vp9 @ 0x55dcdc443200] temporal layering settings
ts_number_layers: 1
[libvpx-vp9 @ 0x55dcdc443200]
layer_target_bitrate: 0 0 0 0 0
[libvpx-vp9 @ 0x55dcdc443200]
ts_rate_decimator: 0 0 0 0 0
[libvpx-vp9 @ 0x55dcdc443200]
ts_periodicity: 0
[libvpx-vp9 @ 0x55dcdc443200]
ts_layer_id: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[libvpx-vp9 @ 0x55dcdc443200] decoder buffer model
rc_buf_sz: 6000
rc_buf_initial_sz: 4000
rc_buf_optimal_sz: 5000
[libvpx-vp9 @ 0x55dcdc443200] 2 pass rate control settings
rc_2pass_vbr_bias_pct: 50
rc_2pass_vbr_minsection_pct: 0
rc_2pass_vbr_maxsection_pct: 2000
[libvpx-vp9 @ 0x55dcdc443200] rc_2pass_vbr_corpus_complexity:0
[libvpx-vp9 @ 0x55dcdc443200] keyframing settings
kf_mode: 1
kf_min_dist: 0
kf_max_dist: 128
[libvpx-vp9 @ 0x55dcdc443200]
[libvpx-vp9 @ 0x55dcdc443200] Failed to initialize encoder: Invalid parameter
[libvpx-vp9 @ 0x55dcdc443200] Additional information: g_timebase.den out of range [1..1000000000]
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!