Brandawg93 / homebridge-nest-cam_old

Use your Nest Cam as IP camera in HomeKit.
Apache License 2.0
92 stars 14 forks source link

Allow ffmpeg codec to be set via config #58

Closed brianmario closed 5 years ago

brianmario commented 5 years ago

This refectors the OMX stuff out to instead just allow passing the ffmpeg codec via config value. This means a user can use whatever hardware acceleration codec is supported on the hardware they're using. For myself, I'm running on a Mac Mini so I want to use the videotoolbox codecs.

This makes a couple of other changes like the default bitrate from 300 (bytes?) to 1,500,000 (1.5Mbit - which can be specified as "1500k" with ffmpeg). It also gets rid of the fps value since ffmpeg will automatically detect and passthrough the fps. Lastly, it cleans up some extra whitespace and adds newlines to files that were missing it. Any or all of these could be reverted if you'd like. The main thing I'm going for here is allowing the codec to be set via config.

KhaosT commented 5 years ago

Awesome :) Thanks for doing this đź‘Ť

brianmario commented 5 years ago

Sorry for the back and forth on that diff. I should have probably waited until I wasn't sick in bed to do this. Also appreciate the help (and patience!). OSS is sorely in need of more of it, so thank you.

Finch106 commented 5 years ago

I see some say to do “useOMX”: and some say “ffmpegCodec”: and I don’t know what I should use for a pi with regular ffmpeg installed. I tried the compiled OMX one and it was failing more than working. So currently useOMX is false, but then what do you recommend using for ffmpegCodec? Using libx264 sends ffmpeg into using 385% cpu on the pi3.

As an aside, I use “copy” for my Wyze cameras and they come through fine with audio and all if I set audio to true.

configuration: --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/arm-linux-gnueabihf --libdir=/usr/lib/arm-linux-gnueabihf --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/arm-linux-gnueabihf libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100