Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: search_for_recordings() missing 1 required positional argument: 'args' #20

Open
XlashDev opened this issue Mar 5, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@XlashDev
Copy link

XlashDev commented Mar 5, 2022

Describe the bug
Hello, I'm tried testing your program and encountered this error while running hikload-qt. When I tested the connection I got 101,102 and 103. Upon clicking start download of an hour video with specified date and time this happens. TIA

Screenshot from 2022-03-05 22-01-23

Additional context
Camera Model DS-2CD2027G1-L

@XlashDev XlashDev added the bug Something isn't working label Mar 5, 2022
@Tedyst
Copy link
Owner

Tedyst commented Mar 5, 2022

This should be now fixed in master, can you please clone the repository and then run python setup.py install to update hikload to the newest version and see if it works? If that dosen't work, can you please enable the debug mode because that may help us debug the issue. Thanks.

@Tedyst Tedyst self-assigned this Mar 5, 2022
@XlashDev
Copy link
Author

XlashDev commented Mar 6, 2022

Hi, thank you for fast response.

Installed via master as advised. I double check my credentials but is good so I don't know why this error shows up, no debug outputs on terminal
Screenshot from 2022-03-06 11-57-09

Tried via command line. It freezes with this command. I checked also the ISAPI dev info and streaming channels and it shows all relevant infos. So im not sure why it is not working.
Screenshot from 2022-03-06 11-34-14

@Tedyst
Copy link
Owner

Tedyst commented Mar 7, 2022

Maybe the device dosen't support directly downloading the videos? Can you try to enable ffmpeg to see if streaming from the DVR works? Thanks.

@XlashDev
Copy link
Author

XlashDev commented Mar 7, 2022

I downloaded videos using iVMS-4200. I only use Windows because of that downloader.

Here is the error after I run with ffmpeg options. Looks like similar to an open issue.

`hikload --server 192.168.1.75 --user admin --password Admin12345@ --starttime 2022-02-09T06:00:00+08:00 --endtime 2022-02-09T07:00:00+00:00 --debug --ffmpeg
DEBUG:hikload:http://admin:Admin12345@@192.168.1.75/ISAPI/System/deviceInfo
DEBUG:hikload:http://admin:Admin12345@@192.168.1.75/ISAPI/Streaming/channels
DEBUG:hikload:Data sent: 6a489c8e-0e2b-4f0d-9adb-b5d30aad1f9e1012022-02-09T06:00:00+08:00Z2022-02-09T07:00:00+00:00Z64
DEBUG:hikload:Starting download from: rtsp://admin:Admin12345@@192.168.1.75/ISAPI/Streaming/tracks/101/?starttime=20220208T215519Z&endtime=20220208T220521Z&name=ch01_00000000083000000&size=260276224
0%| ****
--- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/hikvisionapi/RTSPutils.py", line 57, in downloadRTSP
return ffmpeg.run(stream, capture_stdout=debug, capture_stderr=debug)
File "/home/xxxx/.local/lib/python3.9/site-packages/ffmpeg/_run.py", line 325, in run
raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/xxxx/.local/lib/python3.9/site-packages/tqdm/contrib/logging.py", line 28, in emit
msg = self.format(record)
File "/usr/lib/python3.9/logging/init.py", line 927, in format
return fmt.format(record)
File "/usr/lib/python3.9/logging/init.py", line 663, in format
record.message = record.getMessage()
File "/usr/lib/python3.9/logging/init.py", line 367, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "/usr/local/bin/hikload", line 11, in
load_entry_point('hikload==1.1.2', 'console_scripts', 'hikload')()
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/main.py", line 27, in main
run(args)
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/download.py", line 355, in run
download_recordings(server, args, downloadQueue)
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/download.py", line 327, in download_recordings
download_recording(server, args, recordingobj, original_path)
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/download.py", line 308, in download_recording
video_download_from_channel(
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/download.py", line 139, in video_download_from_channel
hikvisionapi.downloadRTSP(
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/hikvisionapi/RTSPutils.py", line 59, in downloadRTSP
logging.error('stdout:', e.stdout.decode('utf8'))
File "/usr/lib/python3.9/logging/init.py", line 2064, in error
root.error(msg, *args, **kwargs)
File "/usr/lib/python3.9/logging/init.py", line 1475, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/lib/python3.9/logging/init.py", line 1589, in _log
self.handle(record)
File "/usr/lib/python3.9/logging/init.py", line 1599, in handle
self.callHandlers(record)
File "/usr/lib/python3.9/logging/init.py", line 1661, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.9/logging/init.py", line 952, in handle
self.emit(record)
File "/home/xxxx/.local/lib/python3.9/site-packages/tqdm/contrib/logging.py", line 34, in emit
self.handleError(record)
Message: 'stdout:'
Arguments: ('',)
--- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/hikvisionapi/RTSPutils.py", line 57, in downloadRTSP
return ffmpeg.run(stream, capture_stdout=debug, capture_stderr=debug)
File "/home/xxxx/.local/lib/python3.9/site-packages/ffmpeg/_run.py", line 325, in run
raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/xxxx/.local/lib/python3.9/site-packages/tqdm/contrib/logging.py", line 28, in emit
msg = self.format(record)
File "/usr/lib/python3.9/logging/init.py", line 927, in format
return fmt.format(record)
File "/usr/lib/python3.9/logging/init.py", line 663, in format
record.message = record.getMessage()
File "/usr/lib/python3.9/logging/init.py", line 367, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "/usr/local/bin/hikload", line 11, in
load_entry_point('hikload==1.1.2', 'console_scripts', 'hikload')()
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/main.py", line 27, in main
run(args)
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/download.py", line 355, in run
download_recordings(server, args, downloadQueue)
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/download.py", line 327, in download_recordings
download_recording(server, args, recordingobj, original_path)
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/download.py", line 308, in download_recording
video_download_from_channel(
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/download.py", line 139, in video_download_from_channel
hikvisionapi.downloadRTSP(
File "/usr/local/lib/python3.9/dist-packages/hikload-1.1.2-py3.9.egg/hikload/hikvisionapi/RTSPutils.py", line 60, in downloadRTSP
logging.error('stderr:', e.stderr.decode('utf8'))
File "/usr/lib/python3.9/logging/init.py", line 2064, in error
root.error(msg, *args, **kwargs)
File "/usr/lib/python3.9/logging/init.py", line 1475, in error
self._log(ERROR, msg, args, **kwargs)
File "/usr/lib/python3.9/logging/init.py", line 1589, in _log
self.handle(record)
File "/usr/lib/python3.9/logging/init.py", line 1599, in handle
self.callHandlers(record)
File "/usr/lib/python3.9/logging/init.py", line 1661, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.9/logging/init.py", line 952, in handle
self.emit(record)
File "/home/xxxx/.local/lib/python3.9/site-packages/tqdm/contrib/logging.py", line 34, in emit
self.handleError(record)
Message: 'stderr:'
Arguments: ("ffmpeg version N-102995-g694545b6d5 Copyright (c) 2000-2021 the FFmpeg developers\n built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)\n configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64\n libavutil 57. 0.100 / 57. 0.100\n libavcodec 59. 3.101 / 59. 3.101\n libavformat 59. 4.100 / 59. 4.100\n libavdevice 59. 0.100 / 59. 0.100\n libavfilter 8. 0.103 / 8. 0.103\n libswscale 6. 0.100 / 6. 0.100\n libswresample 4. 0.100 / 4. 0.100\nUnrecognized option 'stimeout'.\nError splitting the argument list: Option not found\n",)
ERROR:root:Could not download 20220209065613-101.mkv. Try to remove --fmpeg.
ERROR:root:ffmpeg error (see stderr output for detail)
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 55/55 [00:00<00:00, 77.24it/s]`

@XlashDev
Copy link
Author

XlashDev commented Mar 7, 2022

And btw based on your test how many mbps can you reach during transfer? with that iVMS 4200 I can reach 45 to 80mbs depending on Camera.

@Tedyst
Copy link
Owner

Tedyst commented Mar 7, 2022

Apparently ffmpeg renamed -stimeout to -timeout and I didn't notice. This should now work as intended.

And btw based on your test how many mbps can you reach during transfer? with that iVMS 4200 I can reach 45 to 80mbs depending on Camera.

Usually I would get around 30-40mbps with HikLoad and with iVMS. I could not find any noticeable difference when not using --ffmpeg. But keep in mind that using ffmpeg is usually very slow, since we need to pretty much rerecord the entire video live. I don't know why sometimes HikLoad can't download directly from ISAPI, maybe HikVision updated the ISAPI and I can't find the newer revision.

@XlashDev
Copy link
Author

XlashDev commented Mar 7, 2022

Thank you for fixing that issue. ffmpeg can be accelerated when with GPU support. Tried it with Nvidia GPU.

Still freezes at 0%. Let me investigate and get back here in case I find why it is not working on our cameras.

hikload --server 192.168.1.75 --user admin --password Admin12345@ --starttime 2022-02-09T06:00:00 --endtime 2022-02-09T07:00:00 --debug --ffmpeg DEBUG:hikload:http://admin:Admin12345@@192.168.1.75/ISAPI/System/deviceInfo DEBUG:hikload:http://admin:Admin12345@@192.168.1.75/ISAPI/Streaming/channels DEBUG:hikload:Data sent: <?xml version = "1.0" encoding = "UTF-8" ?><CMSearchDescription version="1.0" xmlns="http://www.hikvision.com/ver20/XMLSchema"><searchID>7af3b49b-3bf0-4b5d-bcfd-28c0cd581332</searchID><trackIDList><trackID>101</trackID></trackIDList><timeSpanList><timeSpan><startTime>2022-02-09T06:00:00Z</startTime><endTime>2022-02-09T07:00:00Z</endTime></timeSpan></timeSpanList><maxResults>64</maxResults></CMSearchDescription> DEBUG:hikload:Starting download from: rtsp://admin:Admin12345@@192.168.1.75/ISAPI/Streaming/tracks/101/?starttime=20220209T055611Z&endtime=20220209T060611Z&name=ch01_00000000131000000&size=260046848 0%| | 0/7 [00:00<?, ?it/s]

EDIT:

I let the script running and it downloaded some parts and got some error. I will explore this and the ISAPI hikvision manuals.

Message: 'stderr:' Arguments: ('ffmpeg version N-102995-g694545b6d5 Copyright (c) 2000-2021 the FFmpeg developers\n built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)\n configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64\n libavutil 57. 0.100 / 57. 0.100\n libavcodec 59. 3.101 / 59. 3.101\n libavformat 59. 4.100 / 59. 4.100\n libavdevice 59. 0.100 / 59. 0.100\n libavfilter 8. 0.103 / 8. 0.103\n libswscale 6. 0.100 / 6. 0.100\n libswresample 4. 0.100 / 4. 0.100\n[rtsp @ 0x55e411d943c0] Missing PPS in sprop-parameter-sets, ignoring\n[rtsp @ 0x55e411d943c0] method SETUP failed: 500 Internal Server Error\nrtsp://admin:Admin12345@@192.168.1.75/ISAPI/Streaming/tracks/101/?starttime=20220209T060611Z&endtime=20220209T061611Z&name=ch01_00000000132000000&size=260374528: Server returned 5XX Server Error reply\n',) ERROR:root:Could not download 20220209060611-101.mkv. Try to remove --fmpeg. ERROR:root:ffmpeg error (see stderr output for detail) DEBUG:hikload:Starting download from: rtsp://admin:Admin12345@@192.168.1.75/ISAPI/Streaming/tracks/101/?starttime=20220209T061611Z&endtime=20220209T062611Z&name=ch01_00000000133000000&size=260538368 14%|███████████████████████▊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants