My application deals with recording video using Jetson Nano. After recording, depends on the return code of the recording function, I rename the video file. Recently, I noticed that sometime, my log shows an exception at the renaming line:
021-10-08 20:31:51,421 - root - ERROR - Exception occurred.
Traceback (most recent call last):
File "/home/shozemi/.local/lib/python3.6/site-packages/aiclassroom/capture.py", line 355, in entry
sys.exit(main(args=arguments))
File "/home/shozemi/.local/lib/python3.6/site-packages/aiclassroom/capture.py", line 318, in main
os.rename(output_path, f'{output_path}.failed')
FileNotFoundError: [Errno 2] No such file or directory: '/home/uname/original/division-school_20211008_1936_classroom_75_4659.mp4' -> '/home/uname/original/division-school_20211008_1936_classroom_75_4659.mp4.failed'
However, when I check the folder, the file is indeed there, and has already been renamed!
~/original$ ls -la *4659*
-rw-rw-r-- 1 uname uname 1428816762 10月 8 20:21 division-school_20211008_1936_classroom_75_4659.mp4.failed
-rw-rw-r-- 1 uname uname 1122092 10月 8 20:21 division-school_20211008_1936_classroom_75_4659.png
Before renaming, I also read the video file and get a frame from the video as the thumbnail on my web system, and you can see the thumbnail is created normally too. So in a nutshell:
- Capture video = OK
- Read from disk and create thumbnail = OK
- Rename: log says "ERROR" but is actually OK too!
Can someone explain it for me?
Additional information:
- OS: Ubuntu 18.04
- System: Jetson Nano
- Python 3.6