Fix stream for some cameras #22747
This was tested against the doorbird camera of olbjan on discord, as well as my HikVisions that were previously already working. Hopefully it will work for the Axis cameras @Kane610 is working on as well - please confirm.
The issue appears to be that the previous method would create a libx264 encoder codec when passed h264. I then copied over the video format from the input stream so that it would match and I could properly remux the stream. The reason for doing it this way was to be able to eventually drop in transcoding support without many changes as to how the output stream got created.
Unfortunately, for some feeds, that does not appear to work correctly, and since we only support remuxing streams at this point, it is much easier to pass in the input video stream as a template to the new output stream, and fixes the problems for the Doorbird without breaking my HikVisions.
See here for the differences on how the codec gets created.
Related issue (if applicable): #22593
Pull request in home-assistant.io with documentation (if applicable): N/A
@@ Coverage Diff @@ ## dev #22747 +/- ## ========================================== + Coverage 93.83% 93.84% +<.01% ========================================== Files 449 449 Lines 36584 36567 -17 ========================================== - Hits 34330 34315 -15 + Misses 2254 2252 -2