Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get 120 fps out of 120 fps mode avfoundation camera #1087

Open
bxff opened this issue Dec 27, 2024 · 0 comments
Open

Unable to get 120 fps out of 120 fps mode avfoundation camera #1087

bxff opened this issue Dec 27, 2024 · 0 comments

Comments

@bxff
Copy link

bxff commented Dec 27, 2024

Description
When trying to get 120fps out of avfoundation native iOS camera by using -video_size 1920x1080 -framerate 120, the actual frame rate is approx ~70fps not 120fps, this is also the case with 240fps mode (-framerate 240), where the resultant fps is around ~120fps. This is not the case with 60fps mode, where I get full 60fps.

Expected behavior
Get 120fps on 120fps mode, and 240fps on 240fps mode.

Current behavior
Getting ~70fps on 120fps and ~120fps on 240fps mode.

To Reproduce
Run a simple ffmpegkit react native application a simple command similar to this: -f avfoundation -video_size 1920x1080 -framerate 120 -i "0" -fps_mode vfr -c:v hevc_videotoolbox -realtime true -profile 0 -prio_speed true -b:v 2000k f udp://192.168.1.100

Screenshots
No screenshots needed.

Logs

 LOG  ffmpeg version n5.1.2
 LOG   Copyright (c) 2000-2022 the FFmpeg developers
 LOG  
 LOG    built with Apple clang version 14.0.0 (clang-1400.0.29.102)
 LOG    configuration: --cross-prefix=arm64-ios-darwin- --sysroot=/Applications/Xcode-v13.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk --prefix=/Users/taner/Projects/ffmpeg-kit/prebuilt/apple-ios-arm64/ffmpeg --pkg-config=/opt/homebrew/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8 --target-os=darwin --enable-neon --enable-asm --ar=/Applications/Xcode-v13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar --cc=clang --cxx=clang++ --as='/Users/taner/Projects/ffmpeg-kit/.tmp/gas-preprocessor.pl -arch aarch64 -- clang -arch arm64 -target arm64-apple-ios12.1 -march=armv8-a+crc+crypto -mcpu=generic -DFFMPEG_KIT_ARM64 -Wno-unused-function -Wno-deprecated-declarations -fstrict-aliasing -fembed-bitcode -DIOS -DFFMPEG_KIT_BUILD_DATE=20220929 -isysroot /Applications/Xcode-v13.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk -Oz -miphoneos-version-min=12.1 -I/Applications/Xcode-v13.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.0.sdk/usr/include' --ranlib=/Applications/Xcode-v13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib --strip=/Applications/Xcode-v13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip --nm=/Applications/Xcode-v13.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm --extra-ldflags='-miphoneos-version-min=12.1' --disable-autodetect --enable-cross-compile --enable-pic --enable-inline-asm --enable-optimizations --enable-swscale --enable-shared --disable-static --install-name-dir='@rpath' --enable-pthreads --disable-v4l2-m2m --disable-outdev=v4l2 --disable-outdev=fbdev --disable-indev=v4l2 --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-gmp --enable-gnutls --disable-sdl2 --disable-openssl --enable-zlib --enable-audiotoolbox --disable-outdev=audiotoolbox --enable-bzlib --enable-videotoolbox --enable-avfoundation --enable-iconv --disable-coreimage --disable-appkit --disable-opencl --disable-opengl
 LOG    libavutil      57. 28.100 / 57. 28.100
 LOG    libavcodec     59. 37.100 / 59. 37.100
 LOG    libavformat    59. 27.100 / 59. 27.100
 LOG    libavdevice    59.  7.100 / 59.  7.100
 LOG    libavfilter     8. 44.100 /  8. 44.100
 LOG    libswscale      6.  7.100 /  6.  7.100
 LOG    libswresample   4.  7.100 /  4.  7.100
 LOG  [avfoundation @ 0x11c32de00] Selected pixel format (yuv420p) is not supported by the input device.
 LOG  [avfoundation @ 0x11c32de00] Supported pixel formats:
 LOG  [avfoundation @ 0x11c32de00]   nv12
 LOG  [avfoundation @ 0x11c32de00]   bgr0
 LOG  [avfoundation @ 0x11c32de00] Overriding selected pixel format to use nv12 instead.
 LOG  [avfoundation @ 0x11c32de00] Stream #0: not enough frames to estimate rate; consider increasing probesize
 LOG  Input #0, avfoundation, from '0':
 LOG    Duration:
 LOG  N/A
 LOG  , start:
 LOG  63627.813000
 LOG  , bitrate:
 LOG  N/A
 LOG  
 LOG    Stream #0:0
 LOG  : Video: rawvideo, 1 reference frame (NV12 / 0x3231564E), nv12, 1920x1080, 0/1
 LOG  ,
 LOG  1000k tbr,
 LOG  1000k tbn
 LOG  
 LOG  Please use -profile:a or -profile:v, -profile is ambiguous
 LOG  Stream mapping:
 LOG    Stream #0:0 -> #0:0
 LOG   (rawvideo (native) -> hevc (hevc_videotoolbox))
 LOG  
 LOG  Press [q] to stop, [?] for help
 LOG  Output #0, rtp, to 'udp://192.168.0.102:5000':
 LOG    Metadata:
 LOG      encoder         :
 LOG  Lavf59.27.100
 LOG  
 LOG    Stream #0:0
 LOG  : Video: hevc, 1 reference frame, nv12(progressive), 1920x1080 (0x0), 0/1, q=2-31, 200 kb/s
 LOG  ,
 LOG  120 fps,
 LOG  90k tbn
 LOG  
 LOG      Metadata:
 LOG        encoder         :
 LOG  Lavc59.37.100 hevc_videotoolbox
 LOG  
 LOG  SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 192.168.0.102
t=0 0
a=tool:libavformat LIBAVFORMAT_VERSION
m=video 0 RTP/AVP 96
b=AS:200
a=rtpmap:96 H265/90000
a=control:streamid=0
 LOG  [hevc_videotoolbox @ 0x150422c00] Color range not set for nv12. Using MPEG range.
 LOG  {}
 LOG  frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
 LOG  {}
 LOG  frame=   40 fps=0.0 q=-0.0 size=     156kB time=00:00:00.30 bitrate=4132.5kbits/s speed=0.612x
 LOG  {}
 LOG  frame=   77 fps= 76 q=-0.0 size=     273kB time=00:00:00.61 bitrate=3630.5kbits/s speed=0.609x
 LOG  {}
 LOG  frame=  110 fps= 73 q=-0.0 size=     363kB time=00:00:00.89 bitrate=3331.2kbits/s speed=0.588x
 LOG  {}
 LOG  frame=  142 fps= 70 q=-0.0 size=     473kB time=00:00:01.15 bitrate=3345.4kbits/s speed=0.574x
 LOG  {}
 LOG  frame=  176 fps= 70 q=-0.0 size=     583kB time=00:00:01.44 bitrate=3315.0kbits/s speed=0.57x
 LOG  {}
 LOG  frame=  207 fps= 68 q=-0.0 size=     691kB time=00:00:01.70 bitrate=3329.7kbits/s speed=0.56x
 LOG  {}
 LOG  frame=  243 fps= 69 q=-0.0 size=     805kB time=00:00:02.00 bitrate=3295.9kbits/s speed=0.565x
 LOG  {}
 LOG  frame=  277 fps= 68 q=-0.0 size=     983kB time=00:00:02.28 bitrate=3526.2kbits/s speed=0.564x
 LOG  {}
 LOG  frame=  310 fps= 68 q=-0.0 size=    1151kB time=00:00:02.55 bitrate=3685.9kbits/s speed=0.562x
 LOG  {}
 LOG  frame=  344 fps= 68 q=-0.0 size=    1319kB time=00:00:02.84 bitrate=3801.0kbits/s speed=0.562x
 LOG  {}
 LOG  frame=  377 fps= 68 q=-0.0 size=    1477kB time=00:00:03.11 bitrate=3882.7kbits/s speed=0.561x
 LOG  {}
 LOG  frame=  406 fps= 68 q=-0.0 Lsize=    1603kB time=00:00:03.37 bitrate=3891.4kbits/s speed=0.563x
 LOG  video:1587kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.031303%
 LOG  {}
 LOG  frame=  406 fps= 68 q=-0.0 Lsize=N/A time=00:00:03.37 bitrate=N/A speed=0.563x
 LOG  video:1587kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
 LOG  Exiting normally, received cancel request.
 LOG  Streaming was cancelled

Environment

  • Platform: iOS/ReactNative
  • Architecture: iPhone 14 Plus used.
  • Version: brew version used
  • Source branch: main
  • Xcode version: 16.2
  • Cocoapods version: 1.16.2
  • react-native info: Run on a iPhone 14 Plus.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant