RMS icon indicating copy to clipboard operation
RMS copied to clipboard

Codec/capture issues when working with video files for RMS.StartCapture

Open MaadhyamRana opened this issue 1 year ago • 0 comments

This issue occurs on the prerelease branch, with RMS.StartCapture. When using the -i (input) flag with a video file:

python -m RMS.StartCapture -i ~/Downloads/CAEUA3_20240713_052714_473898.mkv

Issues occur when working with either media backend (cv2 or gst - options found in the .config file)
For gstreamer, the following is output in the shell:

0:00:00.017080707 15242 0x555e087c5240 ERROR           GST_PIPELINE gst/parse/grammar.y:570:gst_parse_element_make: no element "avdec_h264"
0:00:00.017106770 15242 0x555e087c5240 ERROR           GST_PIPELINE gst/parse/grammar.y:1264:priv_gst_parse_yyparse: link has no sink [source=@0x555e087c74b0]
0:00:00.017644186 15242 0x555e087c5240 ERROR           GST_PIPELINE gst/parse/grammar.y:1264:priv_gst_parse_yyparse: link has no source [sink=@0x555e087da910]
Process BufferedCapture-3:
Traceback (most recent call last):
  File "/home/mrana/anaconda3/envs/rms/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/home/mrana/RMS/RMS/BufferedCapture.py", line 915, in run
    while not self.exit.is_set() and not self.initVideoDevice():
                                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrana/RMS/RMS/BufferedCapture.py", line 661, in initVideoDevice
    self.device = GstVideoFile(self.video_file, decoder=self.config.gst_decoder,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrana/RMS/RMS/Routines/GstreamerCapture.py", line 213, in __init__
    self.initStream()
  File "/home/mrana/RMS/RMS/Routines/GstreamerCapture.py", line 243, in initStream
    self.device = self.createGSTDevice()
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrana/RMS/RMS/Routines/GstreamerCapture.py", line 229, in createGSTDevice
    self.pipeline = Gst.parse_launch(pipeline_str)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: gst_parse_error: no element "avdec_h264" (1)

And then if the config is set to use cv2, instead of the above error, BufferedCapture loops on the following:

2024/09/12 12:27:04-INFO-BufferedCapture-line:916 - Waiting for the video device to be connect...

MaadhyamRana avatar Sep 12 '24 16:09 MaadhyamRana