Advertisement
y2kbug

Untitled

Jan 30th, 2022
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. cap = cv2.VideoCapture(RTSP_URL)
  2. now = datetime.datetime.now(pytz.timezone('Asia/Hong_Kong'))
  3. full_file_path = "/tmp/" + ":".join([str(now.hour), str(now.minute), str(now.second)]) + ".mp4"
  4. video_writer = cv2.VideoWriter(full_file_path, cv2.VideoWriter_fourcc(*'H264'), 20, (1920, 1080))
  5. start_time = time.time()
  6. while time.time() <= start_time + 5:
  7. _, frame = cap.read()
  8. video_writer.write(frame)
  9. video_writer.release()
  10. asyncio.run(async_send_video(full_file_path))
  11. cap.release()
  12.  
  13. OpenCV: FFMPEG: tag 0x34363248/'H264' is not supported with codec id 27 and format 'mp4 / MP4 (MPEG-4 Part 14)'
  14. OpenCV: FFMPEG: fallback to use tag 0x31637661/'avc1'
  15. [ERROR:0@2.459] global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2767) open Could not find encoder for codec_id=27, error: Encoder not found
  16. [ERROR:0@2.459] global /io/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2839) open VIDEOIO/FFMPEG: Failed to initialize VideoWriter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement