Python Forum
Video recording with Raspberry Pi - What´s wrong with my python code?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Video recording with Raspberry Pi - What´s wrong with my python code?
#3
My video output is as follows: It correctly records and prints the timestamp on the videoframes. After one hour, the timestamp stops showing the accurate time (i.e. freezes at at the timepoint the camera should have stopped recording), but the camera continues to record.

UPDATE and SOLUTION
: I played around with the code a bit and stumbled about a person doing similar recordings as me. After combining the both the comment of deanhystad and the other one I finally found out that the problem is actually this:
while (datetime.datetime.now() - start).seconds < (3600):#this indicates to continue filming until you reach the maximize time for a given recording sgement
    camera.annotate_text = datetime.datetime.now().strftime('%d-%m-%Y %H:%M:%S')
    camera.wait_recording(0.2)
##############camera.wait_recording(3600)############
camera.stop_recording()
When I delete this line, it perfectly runs the exact amount of time it should have. Seems that I told python to run the while-loop for 3600 seconds and then record another 3600 seconds. Sometimes it is as simple as that. I´ll leave my problem description in here in case someone else manages to do this weird mistake... Doh
Reply


Messages In This Thread
RE: Video recording with Raspberry Pi - What´s wrong with my python code? - by Montezuma1502 - Feb-24-2023, 04:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I have a code which is very simple but still I cannot detect what's wrong with it max22 1 534 Nov-07-2023, 04:32 PM
Last Post: snippsat
  Something wrong with my code FabianPruitt 5 914 Jul-03-2023, 10:55 PM
Last Post: Pedroski55
  Compiles Python code with no error but giving out no output - what's wrong with it? pythonflea 6 1,654 Mar-27-2023, 07:38 AM
Last Post: buran
  Why doesn't this code work? What is wrong with path? Melcu54 7 1,925 Jan-29-2023, 06:24 PM
Last Post: Melcu54
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 2,690 Nov-05-2022, 11:33 AM
Last Post: Mavoz
Smile How we can prevent screen recording murad_ali 3 1,900 Jul-29-2022, 10:29 AM
Last Post: DeaD_EyE
  How to output Python in Spout or any other video sharing network? buzzdarkyear 4 2,240 Jan-11-2022, 11:37 AM
Last Post: buzzdarkyear
  Wrong code in Python exercise MaartenRo 2 1,567 Jan-01-2022, 04:12 PM
Last Post: MaartenRo
  The code I have written removes the desired number of rows, but wrong rows Jdesi1983 0 1,656 Dec-08-2021, 04:42 AM
Last Post: Jdesi1983
  How to decrease latency while recording streaming video. unicorn2019 0 1,293 Nov-15-2021, 02:12 PM
Last Post: unicorn2019

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020