[Libav-user] Mpeg2video framerates?
Andrew Randrianasulu
randrianasulu at gmail.com
Mon Jun 14 22:10:30 EEST 2021
I was trying to simplify some code i do not understand enough (framerate
calculations inside our program (*))
For some reason ffmpeg's mpeg2video encoder only one exporting.
supported_framerates..
And I was thinking it will restrict itself to fps less than 60 (looking at
table)
Yet, it seems even 144 fps encode with command-line ffmpeg works, but give
me 150 fps video!?
>From terminal:
$ ffmpeg -i ~/vid_20210526.mp4 -r 144 85_fps.mov ffmpeg version 4.4
Copyright (c) 2000-2021 the FFmpeg developers built with Android (6454773
based on r365631c2) clang version 9.0.8 (
https://android.googlesource.com/toolchain/llvm-project
98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
configuration: --arch=armeabi-v7a --as=arm-linux-androideabi-clang
--cc=arm-linux-androideabi-clang --cxx=arm-linux-androideabi-clang++
--cross-prefix=arm-linux-androideabi- --disable-indevs --disable-outdevs
--enable-indev=lavfi --disable-static --disable-symver
--enable-cross-compile --enable-gnutls --enable-gpl --enable-libass
--enable-libdav1d --enable-libmp3lame --enable-libfreetype
--enable-libvorbis --enable-libopus --enable-libx264 --enable-libx265
--enable-libxvid --enable-libvpx --enable-shared --enable-libsoxr
--enable-libvidstab --enable-libwebp
--prefix=/data/data/com.termux/files/usr --target-os=android
--extra-libs=-landroid-glob --enable-neon 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 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/data/data/com.termux/files/home/vid_20210526.mp4': Metadata: major_brand
: isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder :
Lavf58.76.100 Duration: 00:00:36.64, start: 0.000000, bitrate: 1314 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
unknown/bt470bg/unknown), 640x480 [SAR 27:64 DAR 9:16], 1217 kb/s, 29.58
fps, 29.58 tbr, 11360 tbn, 59.17 tbc (default) Metadata: handler_name :
VideoHandle vendor_id : [0][0][0][0] Stream #0:1(eng): Audio: aac (LC)
(mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 90 kb/s (default) Metadata:
handler_name : SoundHandle vendor_id : [0][0][0][0] File '85_fps.mov'
already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0
(h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (aac (native) -> aac
(native)) Press [q] to stop, [?] for help [libx264 @ 0xea3a1800] using
SAR=27/64 [libx264 @ 0xea3a1800] using cpu capabilities: ARMv6 NEON
[libx264 @ 0xea3a1800] profile High, level 3.2, 4:2:0, 8-bit [libx264 @
0xea3a1800] 264 - core 161 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 -
http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0
analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1
me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40
intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mov, to '85_fps.mov':
Metadata: major_brand : isom minor_version : 512 compatible_brands:
isomiso2avc1mp41 encoder : Lavf58.76.100 Stream #0:0(eng): Video: h264
(avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown, progressive),
640x480 [SAR 27:64 DAR 9:16], q=2-31, 144 fps, 18432 tbn (default)
Metadata: handler_name : VideoHandle vendor_id : [0][0][0][0] encoder :
Lavc58.134.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer
size: 0 vbv_delay: N/A Stream #0:1(eng): Audio: aac (LC) (mp4a /
0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata:
handler_name : SoundHandle vendor_id : [0][0][0][0] encoder :
Lavc58.134.100 aac frame= 5 fps=0.0 q=0.0 size= 0kB time=00:00:00.21
bitrate= 1frame= 88 fps=0.0 q=33.0 size= 0kB time=00:00:00.81 bitrate=
frame= 209 fps=193 q=33.0 size= 0kB time=00:00:01.04 bitrate= frame= 312
fps=196 q=33.0 size= 0kB time=00:00:01.75 bitrate= frame= 433 fps=206
q=33.0 size= 0kB time=00:00:02.59 bitrate= frame= 550 fps=210 q=33.0 size=
0kB time=00:00:03.40 bitrate= frame= 657 fps=210 q=33.0 size= 0kB
time=00:00:04.15 bitrate= frame= 774 fps=213 q=33.0 size= 0kB
time=00:00:04.96 bitrate= frame= 876 fps=211 q=33.0 size= 0kB
time=00:00:05.67 bitrate= frame= 993 fps=213 q=33.0 size= 0kB
time=00:00:06.48 bitrate= frame= 1100 fps=213 q=33.0 size= 0kB
time=00:00:07.22 bitrate= frame= 1222 fps=215 q=33.0 size= 0kB
time=00:00:08.07 bitrate= More than 1000 frames duplicated1.42x frame= 1329
fps=214 q=33.0 size= 0kB time=00:00:08.81 bitrate= frame= 1441 fps=215
q=33.0 size= 0kB time=00:00:09.59 bitrate= frame= 1548 fps=215 q=33.0 size=
0kB time=00:00:10.34 bitrate= frame= 1655 fps=214 q=33.0 size= 0kB
time=00:00:11.08 bitrate= frame= 1704 fps=207 q=33.0 size= 0kB
time=00:00:11.42 bitrate= frame= 1743 fps=199 q=33.0 size= 0kB
time=00:00:12.30 bitrate= frame= 1782 fps=192 q=33.0 size= 0kB
time=00:00:12.58 bitrate= frame= 1816 fps=186 q=33.0 size= 256kB
time=00:00:12.82 bitrate= 16frame= 1850 fps=180 q=33.0 size= 256kB
time=00:00:13.05 bitrate= 16frame= 1884 fps=174 q=33.0 size= 256kB
time=00:00:13.29 bitrate= 15frame= 1918 fps=169 q=33.0 size= 512kB
time=00:00:13.52 bitrate= 31frame= 1957 fps=163 q=33.0 size= 512kB
time=00:00:13.80 bitrate= 30frame= 1991 fps=158 q=33.0 size= 768kB
time=00:00:14.03 bitrate= 44frame= 2025 fps=154 q=33.0 size= 768kB
time=00:00:14.27 bitrate= 44frame= 2059 fps=151 q=33.0 size= 768kB
time=00:00:14.50 bitrate= 43frame= 2093 fps=147 q=33.0 size= 1024kB
time=00:00:14.74 bitrate= 56frame= 2132 fps=144 q=33.0 size= 1024kB
time=00:00:15.01 bitrate= 55frame= 2171 fps=142 q=33.0 size= 1280kB
time=00:00:15.27 bitrate= 68frame= 2205 fps=139 q=33.0 size= 1280kB
time=00:00:15.50 bitrate= 67frame= 2239 fps=137 q=33.0 size= 1280kB
time=00:00:15.74 bitrate= 66frame= 2278 fps=135 q=33.0 size= 1536kB
time=00:00:16.02 bitrate= 78frame= 2317 fps=133 q=33.0 size= 1536kB
time=00:00:16.29 bitrate= 77frame= 2351 fps=131 q=33.0 size= 1536kB
time=00:00:16.53 bitrate= 76frame= 2390 fps=129 q=33.0 size= 1792kB
time=00:00:16.81 bitrate= 87frame= 2429 fps=128 q=33.0 size= 1792kB
time=00:00:17.06 bitrate= 86frame= 2468 fps=126 q=33.0 size= 1792kB
time=00:00:17.34 bitrate= 84frame= 2502 fps=124 q=33.0 size= 2048kB
time=00:00:17.57 bitrate= 95frame= 2536 fps=123 q=33.0 size= 2048kB
time=00:00:17.81 bitrate= 94frame= 2575 fps=122 q=33.0 size= 2048kB
time=00:00:18.09 bitrate= 92frame= 2609 fps=120 q=33.0 size= 2304kB
time=00:00:18.32 bitrate=103frame= 2648 fps=119 q=33.0 size= 2304kB
time=00:00:18.60 bitrate=101frame= 2687 fps=118 q=33.0 size= 2304kB
time=00:00:18.85 bitrate=100frame= 2721 fps=116 q=30.0 size= 2560kB
time=00:00:19.09 bitrate=109frame= 2760 fps=115 q=33.0 size= 2560kB
time=00:00:19.37 bitrate=108frame= 2799 fps=114 q=33.0 size= 2816kB
time=00:00:19.64 bitrate=117frame= 2838 fps=113 q=33.0 size= 2816kB
time=00:00:19.90 bitrate=115frame= 2877 fps=112 q=33.0 size= 2816kB
time=00:00:20.18 bitrate=114frame= 2911 fps=111 q=33.0 size= 3072kB
time=00:00:20.41 bitrate=123frame= 2945 fps=110 q=33.0 size= 3072kB
time=00:00:20.65 bitrate=121frame= 2984 fps=109 q=33.0 size= 3072kB
time=00:00:20.92 bitrate=120frame= 3023 fps=108 q=33.0 size= 3328kB
time=00:00:21.20 bitrate=128frame= 3062 fps=108 q=33.0 size= 3328kB
time=00:00:21.46 bitrate=127frame= 3101 fps=107 q=33.0 size= 3328kB
time=00:00:21.73 bitrate=125frame= 3140 fps=106 q=33.0 size= 3584kB
time=00:00:22.01 bitrate=133frame= 3174 fps=106 q=33.0 size= 3584kB
time=00:00:22.25 bitrate=131frame= 3213 fps=105 q=33.0 size= 3584kB
time=00:00:22.50 bitrate=130frame= 3252 fps=104 q=33.0 size= 3840kB
time=00:00:22.78 bitrate=138frame= 3291 fps=104 q=33.0 size= 3840kB
time=00:00:23.06 bitrate=136frame= 3330 fps=103 q=33.0 size= 3840kB
time=00:00:23.31 bitrate=134frame= 3364 fps=103 q=33.0 size= 4096kB
time=00:00:23.55 bitrate=142frame= 3403 fps=103 q=33.0 size= 4096kB
time=00:00:23.82 bitrate=140frame= 3437 fps=102 q=33.0 size= 4096kB
time=00:00:24.06 bitrate=139frame= 3476 fps=102 q=33.0 size= 4096kB
time=00:00:24.32 bitrate=137frame= 3515 fps=101 q=33.0 size= 4352kB
time=00:00:24.61 bitrate=144frame= 3553 fps=101 q=33.0 size= 4352kB
time=00:00:24.87 bitrate=143frame= 3592 fps=100 q=33.0 size= 4608kB
time=00:00:25.15 bitrate=150frame= 3631 fps=100 q=33.0 size= 4608kB
time=00:00:25.42 bitrate=148frame= 3665 fps= 99 q=33.0 size= 4608kB
time=00:00:25.66 bitrate=147frame= 3709 fps= 99 q=33.0 size= 4608kB
time=00:00:25.96 bitrate=145frame= 3743 fps= 99 q=33.0 size= 4864kB
time=00:00:26.19 bitrate=152frame= 3782 fps= 98 q=33.0 size= 4864kB
time=00:00:26.47 bitrate=150frame= 3821 fps= 98 q=33.0 size= 4864kB
time=00:00:26.73 bitrate=149frame= 3860 fps= 98 q=33.0 size= 5120kB
time=00:00:27.00 bitrate=155frame= 3894 fps= 97 q=33.0 size= 5120kB
time=00:00:27.24 bitrate=153frame= 3938 fps= 97 q=33.0 size= 5120kB
time=00:00:27.54 bitrate=152frame= 3972 fps= 97 q=33.0 size= 5376kB
time=00:00:27.79 bitrate=158frame= 4011 fps= 96 q=33.0 size= 5376kB
time=00:00:28.05 bitrate=156frame= 4055 fps= 96 q=33.0 size= 5376kB
time=00:00:28.35 bitrate=155frame= 4099 fps= 96 q=33.0 size= 5632kB
time=00:00:28.67 bitrate=160frame= 4138 fps= 95 q=33.0 size= 5632kB
time=00:00:28.92 bitrate=159frame= 4181 fps= 95 q=33.0 size= 5632kB
time=00:00:29.24 bitrate=157frame= 4220 fps= 95 q=33.0 size= 5632kB
time=00:00:29.50 bitrate=156frame= 4259 fps= 94 q=33.0 size= 5888kB
time=00:00:29.78 bitrate=161frame= 4303 fps= 94 q=33.0 size= 5888kB
time=00:00:30.08 bitrate=160frame= 4342 fps= 94 q=33.0 size= 6144kB
time=00:00:30.35 bitrate=165frame= 4381 fps= 94 q=33.0 size= 6144kB
time=00:00:30.61 bitrate=164frame= 4415 fps= 94 q=33.0 size= 6144kB
time=00:00:30.86 bitrate=163frame= 4459 fps= 93 q=33.0 size= 6144kB
time=00:00:31.16 bitrate=161frame= 4498 fps= 93 q=33.0 size= 6400kB
time=00:00:31.44 bitrate=166frame= 4537 fps= 93 q=33.0 size= 6400kB
time=00:00:31.70 bitrate=165frame= 4576 fps= 93 q=33.0 size= 6400kB
time=00:00:31.97 bitrate=163frame= 4615 fps= 92 q=33.0 size= 6656kB
time=00:00:32.25 bitrate=169frame= 4654 fps= 92 q=33.0 size= 6656kB
time=00:00:32.51 bitrate=167frame= 4693 fps= 92 q=33.0 size= 6656kB
time=00:00:32.81 bitrate=166frame= 4727 fps= 92 q=33.0 size= 6912kB
time=00:00:33.02 bitrate=171frame= 4766 fps= 92 q=33.0 size= 6912kB
time=00:00:33.28 bitrate=170frame= 4795 fps= 91 q=33.0 size= 7168kB
time=00:00:33.49 bitrate=175frame= 4839 fps= 91 q=33.0 size= 7168kB
time=00:00:33.81 bitrate=173frame= 4877 fps= 91 q=33.0 size= 7168kB
time=00:00:34.06 bitrate=172frame= 4916 fps= 91 q=33.0 size= 7168kB
time=00:00:34.36 bitrate=170frame= 4950 fps= 91 q=33.0 size= 7424kB
time=00:00:34.58 bitrate=175frame= 4985 fps= 90 q=33.0 size= 7424kB
time=00:00:34.81 bitrate=174frame= 5019 fps= 90 q=33.0 size= 7680kB
time=00:00:35.05 bitrate=179frame= 5058 fps= 90 q=33.0 size= 7680kB
time=00:00:35.32 bitrate=178frame= 5097 fps= 90 q=33.0 size= 7680kB
time=00:00:35.60 bitrate=176frame= 5131 fps= 90 q=33.0 size= 7680kB
time=00:00:35.84 bitrate=175frame= 5170 fps= 89 q=33.0 size= 7936kB
time=00:00:36.09 bitrate=180frame= 5213 fps= 89 q=33.0 size= 7936kB
time=00:00:36.41 bitrate=178frame= 5252 fps= 89 q=33.0 size= 8192kB
time=00:00:36.56 bitrate=183frame= 5277 fps= 88 q=-1.0 Lsize= 8429kB
time=00:00:36.62 bitrate=1885.2kbits/s dup=4193 drop=0 speed=0.611x
video:7944kB audio:405kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.951503% [libx264 @ 0xea3a1800] frame I:24 Avg QP:23.31
size: 49779 [libx264 @ 0xea3a1800] frame P:1329 Avg QP:26.43 size: 4990
[libx264 @ 0xea3a1800] frame B:3924 Avg QP:29.47 size: 78 [libx264 @
0xea3a1800] consecutive B-frames: 0.8% 0.0% 0.1% 99.1% [libx264 @
0xea3a1800] mb I I16..4: 11.5% 73.8% 14.7% [libx264 @ 0xea3a1800] mb P
I16..4: 0.2% 0.2% 0.1% P16..4: 27.0% 7.1% 6.6% 0.0% 0.0% skip:58.8%
[libx264 @ 0xea3a1800] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 7.0% 0.0% 0.0%
direct: 0.0% skip:93.0% L0:40.2% L1:56.6% BI: 3.2% [libx264 @ 0xea3a1800]
8x8 transform intra:68.9% inter:69.8% [libx264 @ 0xea3a1800] coded
y,uvDC,uvAC intra: 58.1% 37.9% 9.3% inter: 5.3% 0.9% 0.0% [libx264 @
0xea3a1800] i16 v,h,dc,p: 19% 61% 15% 5% [libx264 @ 0xea3a1800] i8
v,h,dc,ddl,ddr,vr,hd,vl,hu: 7% 39% 23% 3% 6% 3% 11% 2% 7% [libx264 @
0xea3a1800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 5% 29% 15% 5% 10% 4% 17% 3% 12%
[libx264 @ 0xea3a1800] i8c dc,h,v,p: 63% 28% 6% 3% [libx264 @ 0xea3a1800]
Weighted P-Frames: Y:2.8% UV:0.2% [libx264 @ 0xea3a1800] ref P L0: 55.4%
17.2% 11.3% 15.9% 0.3% [libx264 @ 0xea3a1800] ref B L0: 93.6% 5.2% 1.2%
[libx264 @ 0xea3a1800] ref B L1: 96.1% 3.9% [libx264 @ 0xea3a1800]
kb/s:1775.81 [aac @ 0xea1ee400] Qavg: 1375.427
$ ffprobe 85_fps.mov ffprobe version 4.4 Copyright (c) 2007-2021 the
FFmpeg developers built with Android (6454773 based on r365631c2) clang
version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project
98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
configuration: --arch=armeabi-v7a --as=arm-linux-androideabi-clang
--cc=arm-linux-androideabi-clang --cxx=arm-linux-androideabi-clang++
--cross-prefix=arm-linux-androideabi- --disable-indevs --disable-outdevs
--enable-indev=lavfi --disable-static --disable-symver
--enable-cross-compile --enable-gnutls --enable-gpl --enable-libass
--enable-libdav1d --enable-libmp3lame --enable-libfreetype
--enable-libvorbis --enable-libopus --enable-libx264 --enable-libx265
--enable-libxvid --enable-libvpx --enable-shared --enable-libsoxr
--enable-libvidstab --enable-libwebp
--prefix=/data/data/com.termux/files/usr --target-os=android
--extra-libs=-landroid-glob --enable-neon 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 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'85_fps.mov': Metadata: major_brand : qt minor_version : 512
compatible_brands: qt encoder : Lavf58.76.100 Duration: 00:00:36.65, start:
0.000000, bitrate: 1884 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 /
0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 640x480 [SAR 27:64 DAR
9:16], 1775 kb/s, 144 fps, 144 tbr, 18432 tbn, 288 tbc (default) Metadata:
handler_name : VideoHandle vendor_id : FFMP encoder : Lavc58.134.100
libx264 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 90 kb/s (default) Metadata: handler_name : SoundHandle
vendor_id : [0][0][0][0]
$ rm 85_fps.mpg rm: cannot remove '85_fps.mpg': No such file or directory
$ rm 85_fps.mov
$ ffmpeg -i ~/vid_20210526.mp4 -c:v mpeg2video -r 144 85_fps.mpg ffmpeg
version 4.4 Copyright (c) 2000-2021 the FFmpeg developers built with
Android (6454773 based on r365631c2) clang version 9.0.8 (
https://android.googlesource.com/toolchain/llvm-project
98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
configuration: --arch=armeabi-v7a --as=arm-linux-androideabi-clang
--cc=arm-linux-androideabi-clang --cxx=arm-linux-androideabi-clang++
--cross-prefix=arm-linux-androideabi- --disable-indevs --disable-outdevs
--enable-indev=lavfi --disable-static --disable-symver
--enable-cross-compile --enable-gnutls --enable-gpl --enable-libass
--enable-libdav1d --enable-libmp3lame --enable-libfreetype
--enable-libvorbis --enable-libopus --enable-libx264 --enable-libx265
--enable-libxvid --enable-libvpx --enable-shared --enable-libsoxr
--enable-libvidstab --enable-libwebp
--prefix=/data/data/com.termux/files/usr --target-os=android
--extra-libs=-landroid-glob --enable-neon 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 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'/data/data/com.termux/files/home/vid_20210526.mp4': Metadata: major_brand
: isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder :
Lavf58.76.100 Duration: 00:00:36.64, start: 0.000000, bitrate: 1314 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
unknown/bt470bg/unknown), 640x480 [SAR 27:64 DAR 9:16], 1217 kb/s, 29.58
fps, 29.58 tbr, 11360 tbn, 59.17 tbc (default) Metadata: handler_name :
VideoHandle vendor_id : [0][0][0][0] Stream #0:1(eng): Audio: aac (LC)
(mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 90 kb/s (default) Metadata:
handler_name : SoundHandle vendor_id : [0][0][0][0] Stream mapping: Stream
#0:0 -> #0:0 (h264 (native) -> mpeg2video (native)) Stream #0:1 -> #0:1
(aac (native) -> mp2 (native)) Press [q] to stop, [?] for help [mpeg @
0xe7d06a00] VBV buffer size not set, using default size of 230KB If you
want the mpeg file to be compliant to some specification Like DVD, VCD or
others, make sure you set the correct buffer size Output #0, mpeg, to
'85_fps.mpg': Metadata: major_brand : isom minor_version : 512
compatible_brands: isomiso2avc1mp41 encoder : Lavf58.76.100 Stream
#0:0(eng): Video: mpeg2video (Main), yuv420p(tv, unknown/bt470bg/unknown,
progressive), 640x480 [SAR 27:64 DAR 9:16], q=2-31, 200 kb/s, 150 fps, 90k
tbn (default) Metadata: handler_name : VideoHandle vendor_id : [0][0][0][0]
encoder : Lavc58.134.100 mpeg2video Side data: cpb: bitrate max/min/avg:
0/0/200000 buffer size: 0 vbv_delay: N/A Stream #0:1(eng): Audio: mp2,
48000 Hz, stereo, s16, 384 kb/s (default) Metadata: handler_name :
SoundHandle vendor_id : [0][0][0][0] encoder : Lavc58.134.100 mp2 frame= 5
fps=0.0 q=2.0 size= 0kB time=00:00:00.22 bitrate= 0frame= 142 fps=0.0
q=31.0 size= 142kB time=00:00:00.99 bitrate=116frame= 304 fps=292 q=31.0
size= 154kB time=00:00:02.00 bitrate= 62frame= 446 fps=287 q=24.8 size=
154kB time=00:00:02.95 bitrate= 42frame= 583 fps=284 q=31.0 size= 154kB
time=00:00:03.86 bitrate= 32frame= 720 fps=281 q=31.0 size= 154kB
time=00:00:04.78 bitrate= 26frame= 862 fps=281 q=31.0 size= 154kB
time=00:00:05.72 bitrate= 22frame= 999 fps=279 q=31.0 size= 154kB
time=00:00:06.64 bitrate= 19frame= 1136 fps=278 q=31.0 size= 154kB
time=00:00:07.55 bitrate= 16More than 1000 frames duplicated1.85x frame=
1278 fps=279 q=31.0 size= 154kB time=00:00:08.50 bitrate= 14frame= 1415
fps=278 q=31.0 size= 154kB time=00:00:09.41 bitrate= 13frame= 1557 fps=278
q=31.0 size= 154kB time=00:00:10.36 bitrate= 12frame= 1693 fps=277 q=31.0
size= 192kB time=00:00:11.26 bitrate= 13frame= 1780 fps=236 q=31.0 size=
256kB time=00:00:12.07 bitrate= 17frame= 1846 fps=230 q=31.0 size= 1536kB
time=00:00:12.53 bitrate=100frame= 1932 fps=226 q=31.0 size= 1792kB
time=00:00:13.10 bitrate=112frame= 2023 fps=224 q=31.0 size= 2048kB
time=00:00:13.70 bitrate=122frame= 2119 fps=221 q=31.0 size= 2048kB
time=00:00:14.35 bitrate=116frame= 2211 fps=219 q=31.0 size= 2304kB
time=00:00:14.95 bitrate=126frame= 2302 fps=217 q=31.0 size= 2560kB
time=00:00:15.57 bitrate=134frame= 2393 fps=215 q=31.0 size= 2816kB
time=00:00:16.17 bitrate=142frame= 2484 fps=214 q=31.0 size= 2816kB
time=00:00:16.77 bitrate=137frame= 2576 fps=212 q=24.8 size= 3072kB
time=00:00:17.40 bitrate=144frame= 2667 fps=211 q=31.0 size= 3328kB
time=00:00:18.00 bitrate=151frame= 2763 fps=210 q=31.0 size= 3584kB
time=00:00:18.65 bitrate=157frame= 2855 fps=209 q=31.0 size= 3840kB
time=00:00:19.25 bitrate=163frame= 2946 fps=208 q=31.0 size= 3840kB
time=00:00:19.85 bitrate=158frame= 3037 fps=207 q=31.0 size= 4096kB
time=00:00:20.47 bitrate=163frame= 3128 fps=206 q=24.8 size= 4352kB
time=00:00:21.07 bitrate=169frame= 3220 fps=205 q=31.0 size= 4608kB
time=00:00:21.69 bitrate=173frame= 3311 fps=204 q=31.0 size= 4608kB
time=00:00:22.29 bitrate=169frame= 3407 fps=203 q=31.0 size= 4864kB
time=00:00:22.92 bitrate=173frame= 3504 fps=203 q=31.0 size= 5120kB
time=00:00:23.54 bitrate=178frame= 3595 fps=202 q=31.0 size= 5120kB
time=00:00:24.19 bitrate=173frame= 3686 fps=202 q=31.0 size= 5376kB
time=00:00:24.81 bitrate=177frame= 3777 fps=201 q=31.0 size= 5632kB
time=00:00:25.39 bitrate=181frame= 3869 fps=201 q=31.0 size= 5632kB
time=00:00:26.01 bitrate=177frame= 3960 fps=200 q=31.0 size= 5888kB
time=00:00:26.61 bitrate=181frame= 4051 fps=200 q=31.0 size= 6144kB
time=00:00:27.24 bitrate=184frame= 4148 fps=199 q=24.8 size= 6400kB
time=00:00:27.89 bitrate=187frame= 4239 fps=199 q=31.0 size= 6400kB
time=00:00:28.46 bitrate=184frame= 4335 fps=198 q=31.0 size= 6656kB
time=00:00:29.11 bitrate=187frame= 4426 fps=198 q=31.0 size= 6912kB
time=00:00:29.73 bitrate=190frame= 4523 fps=198 q=31.0 size= 6912kB
time=00:00:30.38 bitrate=186frame= 4619 fps=197 q=31.0 size= 7168kB
time=00:00:31.01 bitrate=189frame= 4715 fps=197 q=31.0 size= 7424kB
time=00:00:31.65 bitrate=192frame= 4812 fps=197 q=31.0 size= 7680kB
time=00:00:32.30 bitrate=194frame= 4908 fps=197 q=31.0 size= 7680kB
time=00:00:32.93 bitrate=191frame= 5010 fps=197 q=31.0 size= 7936kB
time=00:00:33.62 bitrate=193frame= 5111 fps=197 q=31.0 size= 8192kB
time=00:00:34.29 bitrate=195frame= 5207 fps=197 q=31.0 size= 8448kB
time=00:00:34.94 bitrate=198frame= 5319 fps=197 q=31.0 size= 8448kB
time=00:00:35.69 bitrate=193frame= 5425 fps=197 q=31.0 size= 8704kB
time=00:00:36.38 bitrate=195frame= 5496 fps=198 q=31.0 Lsize= 9086kB
time=00:00:36.62 bitrate=2032.2kbits/s dup=4412 drop=0 speed=1.32x
video:7810kB audio:1200kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.838
So in mov/x264 it encoded 5277 frames (4193 duplicates) and in
mpeg/mpeg2video it encoded 5496 frames (4412 duplicates) from same source
with same '-r 144' parameter!
Is this expected behavior in mpeg2 case?
* -
See
http://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/ffmpeg.C;h=df39763c3e30033db7c0d640d96d2d22a0c745f2;hb=HEAD
functions
static inline AVRational std_frame_rate(int i)
1857 {
1858 static const int m1 = 1001*12, m2 = 1000*12;
1859 static const int freqs[] = {
1860 40*m1, 48*m1, 50*m1, 60*m1, 80*m1,120*m1, 240*m1,
1861 24*m2, 30*m2, 60*m2, 12*m2, 15*m2, 48*m2, 0,
1862 };
1863 int freq = i<30*12 ? (i+1)*1001 : freqs[i-30*12];
1864 return (AVRational) { freq, 1001*12 };
1865 }
1866
1867 AVRational FFMPEG::check_frame_rate(const AVRational *p, double
frame_rate)
1868 {
1869 AVRational rate, best_rate = (AVRational) { 0, 0 };
1870 double max_err = 1.; int i = 0;
1871 while( ((p ? (rate=*p++) : (rate=std_frame_rate(i++))), rate.num) != 0
) {
1872 double framerate = (double) rate.num / rate.den;
1873 double err = fabs(frame_rate/framerate - 1.);
1874 if( err >= max_err ) continue;
1875 max_err = err;
1876 best_rate = rate;
1877 }
1878 return max_err < 0.0001 ? best_rate : (AVRational) { 0, 0 };
1879 }
And
AVRational frame_rate = check_frame_rate(codec->supported_framerates,
vid->frame_rate);
2918 if( !frame_rate.num || !frame_rate.den ) {
2919 eprintf(_("check_frame_rate failed %s\n"), filename);
2920 ret = 1;
2921 break;
2922 }
I think they can be simplified with av_find_nearest_q_idx but i am not
sure...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20210614/1cbf53a4/attachment.htm>
More information about the Libav-user
mailing list