Commit Graph

336 Commits

Author SHA1 Message Date
Isaac Connor
5c5cce12fa Fix spacing 2025-07-26 11:52:21 -04:00
Isaac Connor
fbd2dd6c58 Allow setting of decoder threads using opts 2025-06-21 21:37:10 -04:00
Isaac Connor
66adcab8ea Merge pull request #4131 from SteveGilvarry/ffmpeg7-avcodec_close
Removing avcodec_close, avcodec_free_context is replacement and been …
2025-02-12 15:07:56 -05:00
Isaac Connor
f2e8741984 Choose altnernate video stream if it matches the specified resolution. Don't return packets that don't match our stream. discard unmatched streams. 2025-01-24 12:37:36 -05:00
Isaac Connor
10b3619a66 clear probesize so ffmpeg doesn't complain abou it 2024-10-28 13:59:21 -04:00
Isaac Connor
e600472625 If using WallClockTimestamps, don't sweat a big jump in time. 2024-10-22 18:22:50 -04:00
Isaac Connor
e7d4fa334d Initialize lastPTS and only set lastAudioPTS if the stream is audio. 2024-09-25 10:53:47 -04:00
Isaac Connor
07d221569d Let higher ups deal with non-video non-audio packets. Might fix a memleak 2024-09-24 19:30:30 -04:00
Steve Gilvarry
88227105b8 Removing avcodec_close, avcodec_free_context is replacement and been around since 2014, so should be no reason to version test. 2024-09-14 11:06:55 +10:00
Isaac Connor
ae34457031 Take importance into count when logging failure to read packet.
Clear reorder_queue_size from opts as it only applies to avformat
2024-07-24 12:07:56 -04:00
Isaac Connor
63a2ed4b06 Take Importance into accoutn when logging Unable to read from stream 2024-07-08 08:39:41 -04:00
Isaac Connor
aa1aee230f If camera time jumps back more than 10 seconds, fail the capture. 2024-07-03 08:54:46 -04:00
Isaac Connor
90b5b1f154 Reduce time jump amount to 20seconds. We have many cameras that jump more than 20, but less than 40 and so the dts are accepted by reordering. Better to restart capture I think. 2024-04-07 11:30:22 -04:00
Aaron Kling
c4683d90a9 Format code using astyle google format
Commands used:
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.cpp
astyle --style=google --indent=spaces=2 --keep-one-line-blocks src/*.h
2024-03-26 13:43:58 -05:00
Isaac Connor
26231c4579 Return 0 if packet is not for video or audio stream 2024-03-02 11:19:27 -05:00
Isaac Connor
e4a2f9879e Don't assume video if not audio, could be data 2024-03-02 11:00:03 -05:00
Isaac Connor
bb4858103d Increase time jump to 40 seconds because Avigilon cameras seem to do this a lot 2024-03-02 09:58:22 -05:00
Isaac Connor
3eede7228c Use Importance when logging about time jumping back too far 2024-02-27 17:39:52 -05:00
Isaac Connor
ff41c1612f Use time instead of pts for legibility in warning about jumping back in time. Don't break capture until we have at least 5 of these errors. 2024-02-19 09:52:10 -05:00
Isaac Connor
de7b915291 Increase the time jump to 20 seconds. 2024-02-06 15:59:08 -05:00
Isaac Connor
b869a6e5a9 Must always CLose in PrimeCapture because each OpenFfmpeg allocates structures. 2024-01-29 10:10:56 -05:00
Isaac Connor
21743f71a1 Reset lastPTS on Close 2024-01-27 10:27:39 -05:00
Isaac Connor
543d3bdd98 Fix lastPTS assignment when not using a second input. Use a 10 sec max pts gap before fail to capture 2024-01-26 19:47:39 -05:00
Isaac Connor
4888019f1b Add detection for significant jump back in time in incoming packets 2024-01-26 18:16:24 -05:00
Isaac Connor
db135cba46 Add isPrimed to camera class instead of it just being in ffmpeg_camera. Rename mCanCapture to isPrimed in ffmpeg_camera. 2023-12-06 09:38:38 -05:00
Isaac Connor
558aed0561 Fix memleak due to not freeing the opts dict except on error. 2023-10-26 13:44:02 -04:00
Isaac Connor
3f7e9d57ae Put back code to free audio context and codec. If we aren't useing second input, we still need to free them. 2023-10-20 10:51:44 -04:00
Isaac Connor
7eb601ef4d Restore audio recording 2023-09-13 10:47:45 -04:00
David Schmidt
5bfa28d172 Use unique_ptr instread of local scope object pointer for second input 2023-09-09 18:51:54 +02:00
Isaac Connor
9295c390ca re-parse Options into opts so that they are available to open_codec 2023-07-28 17:39:08 -04:00
Isaac Connor
ef29805a4d Test for word auto in decodername and don't do lookup for it 2023-07-17 17:01:39 -04:00
Isaac Connor
0a0293f34a Turn warning about mismatched dimensions into a debug 2023-06-12 10:17:11 -04:00
Isaac Connor
f8ca7cee94 Cleanup constructor a bit 2023-06-08 10:58:08 -04:00
Isaac Connor
ab9298cbf0 Add DecoderName to Monitors, and use it in ffmpeg_camera instead of just trying all options 2023-02-26 16:30:56 -05:00
Isaac Connor
c1c25aeb76 Add sqv hwaccel types 2023-02-25 18:07:54 -05:00
Isaac Connor
7a1066c534 Disable multi-threaded decoding as a test 2023-01-26 18:46:38 -05:00
Isaac Connor
32add0952c Differentiate between negative pts and AV_NOPTS_VALUE when looking for wrap around. 2023-01-10 14:19:40 -05:00
Isaac Connor
0d569c26d7 fix formatting string 2023-01-07 12:35:24 -05:00
Isaac Connor
090b90565f Add uriencoding of the password 2023-01-06 12:22:04 -05:00
Isaac Connor
48c18ca4ed Attempt to better handle 32bit wrap around in the pts in the input stream. 2022-12-23 09:02:41 -05:00
AngeloGioacchino Del Regno
7f8badc334 zm_ffmpeg_camera: Add support for Jetson Nano/Xavier NVMPI
Add support for the NVMPI hardware decoders (not CUDA decoders!)
of the Tegra SoCs found in the Jetson Nano/TX/TX2 and Xavier NX/AGX.

This platform supports hardware decoding of H264, HEVC, MPEG2,
MPEG4, VP8 and VP9.
2022-11-24 00:09:02 +01:00
Isaac Connor
dd82a01291 Don't encode the user/pass. If they were properly entered in the web ui then we will double encode them. 2022-09-18 12:35:04 -04:00
Isaac Connor
e1d381bc9e Don't set auth_type. It doesn't seem to be support and shouldn't be necessary 2022-08-22 11:46:36 -04:00
parvit (Vittorio Parrella)
a94d74143e support for ffmpeg type camera authentication with special characters 2022-08-20 10:01:14 -04:00
Doug Nazar
acbdf1854d Add guard to handle resetting AVPacket after use.
Also handle allocation failures.
2022-07-29 14:56:38 -04:00
Doug Nazar
110cc436a3 Switch from av_init_packet() to av_packet_alloc()
Remove all uses of deprecated av_init_packet() and switch any stack
based AVPackets to unique_ptrs allocated with av_packet_alloc().

Ensure that all code paths call av_packet_unref() after use to reset
before next usage.
2022-07-29 14:56:26 -04:00
Isaac Connor
a5ef240e96 Use remove_authentication instead of mask_authentication 2022-07-04 11:02:02 -04:00
Isaac Connor
e6eb94760c Use MaskedPath when logging failure to open 2022-06-22 11:13:43 -04:00
Isaac Connor
984c08049b fix compile on < ffmpeg5 2022-05-18 17:12:06 -04:00
Isaac Connor
61c5f9aad3 ffmpeg5 fix by adding const 2022-05-18 16:29:49 -04:00