[Config Support]: How to correct aspect ratio in recordings #11115
-
Describe the problem you are havingI have a Metzler VDM10 doorbell which is actually a branded Hikvision doorbell. I have access to the rtsp substream only (or at least I didn't find out how to get the main stream) with a resolution of 704x576. The real aspect ratio of the stream is 16:9 but as default it is displayed shrunken in a 5:4 or near 4:3 ratio.
So it is now displayed correctly in the jsmpeg stream and seems to be correctly used for object tracking but in the mse stream and in the recordings the aspect ratio of the videos is not correct. I think that I need do some transcoding with ffmpeg to get the resulting videos with correct aspect ratio and I tried different approaches but without success:
Probably I hove to do it for the Thanks in advance! Version0.13.2-6476F8A Frigate config filemqtt:
enabled: false
ffmpeg:
hwaccel_args: preset-vaapi
go2rtc:
streams:
klingel:
- rtsp://user:[email protected]:554/Streaming/channels/102
- isapi://user:[email protected]:80/
- "ffmpeg:klingel#video=h264#audio=aac"
klingel_sub:
- rtsp://user:[email protected]:554/Streaming/channels/102
- "ffmpeg:klingel_sub#video=h264"
cameras:
Klingel:
ffmpeg:
output_args:
record: preset-record-generic-audio-copy
#record: "-vf scale=ih*16/9:ih,scale=iw:-2,setsar=1"
#record: '-aspect 16:9'
#detect: -vf scale=1024:576 -f rawvideo -pix_fmt yuv420p
#detect: -vf scale=ih*16/9:ih,scale=iw:-2,setsar=1 -f rawvideo -pix_fmt yuv420p
#detect: -vf scale_vaapi=w=iw*2:h=ih,hwdownload -f rawvideo -pix_fmt yuv420p
detect: -vf scale_vaapi=w=1024:h=576,setdar=dar=1.77777,hwdownload -f rawvideo -pix_fmt yuv420p
inputs:
- path: rtsp://127.0.0.1:8554/klingel
input_args: preset-rtsp-restream
roles:
- record
- path: rtsp://127.0.0.1:8554/klingel_sub
input_args: preset-rtsp-restream
roles:
- detect
detect:
enabled: true
width: 1024
height: 576
record:
enabled: true
live:
stream_name: klingel_sub
motion:
mask:
- 1024,0,0,0,0,159,459,233,653,243,734,225,906,247,1024,249
detectors:
ov:
type: openvino
device: AUTO
model:
path: /openvino-model/ssdlite_mobilenet_v2.xml
objects:
track:
- person
- car
- bicycle
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
labelmap_path: /openvino-model/coco_91cl_bkgr.txt Relevant log output2024-04-25 11:24:47.604411804 [INFO] Preparing Frigate...
2024-04-25 11:24:47.623175357 [INFO] Starting Frigate...
2024-04-25 11:24:49.127549053 [2024-04-25 13:24:49] frigate.app INFO : Starting Frigate (0.13.2-6476f8a)
2024-04-25 11:24:49.127627659 [2024-04-25 13:24:49] frigate.app INFO : Creating directory: /tmp/cache
2024-04-25 11:24:49.150261313 [2024-04-25 13:24:49] frigate.config WARNING : Customizing more than a detector model path is unsupported.
2024-04-25 11:24:49.157682958 [2024-04-25 13:24:49] peewee_migrate.logs INFO : Starting migrations
2024-04-25 11:24:49.166323244 [2024-04-25 13:24:49] peewee_migrate.logs INFO : There is nothing to migrate
2024-04-25 11:24:49.166440039 [2024-04-25 13:24:49] frigate.app INFO : Recording process started: 307
2024-04-25 11:24:49.169013130 [2024-04-25 13:24:49] frigate.app INFO : go2rtc process pid: 89
2024-04-25 11:24:49.187798081 [2024-04-25 13:24:49] detector.ov INFO : Starting detection process: 316
2024-04-25 11:24:49.187803179 [2024-04-25 13:24:49] frigate.app INFO : Output process started: 318
2024-04-25 11:24:49.206321293 [2024-04-25 13:24:49] frigate.app INFO : Camera processor started for Klingel: 323
2024-04-25 11:24:49.207305216 [2024-04-25 13:24:49] frigate.app INFO : Capture process started for Klingel: 324
2024-04-25 11:24:49.469965059 [2024-04-25 13:24:49] frigate.detectors.plugins.openvino INFO : Model Input Shape: [1,300,300,3]
2024-04-25 11:24:49.470048524 [2024-04-25 13:24:49] frigate.detectors.plugins.openvino INFO : Model Output-0 Shape: [1,1,100,7]
2024-04-25 11:24:49.470163201 [2024-04-25 13:24:49] frigate.detectors.plugins.openvino INFO : Model has 1 Output Tensors
2024-04-25 15:08:04.696509089 [h264 @ 0x7f11ec1ab900] out of range intra chroma pred mode
2024-04-25 15:08:04.696516718 [h264 @ 0x7f11ec1ab900] error while decoding MB 13 22 Frigate statsNo response Operating systemHassOS Install methodHassOS Addon Coral versionCPU (no coral) Any other information that may be helpfulHomeassistant + Frigate is running on an older i5-3470 pc with 8GB of RAM and a 270 GB SSD. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
the best way to do this would be to only do it once using go2rtc and then pull from that stream for detect and recording
|
Beta Was this translation helpful? Give feedback.
the best way to do this would be to only do it once using go2rtc and then pull from that stream for detect and recording