Skip to content

Get http media stream from Axis Camera #636

Closed Answered by vivekatoffice
vmithani asked this question in VAPIX
Discussion options

You must be logged in to vote

HI @vmithani ,
Adding Python code samples which I have tested with AXIS P1367 Network Camera (AXIS OS version 10.12.166)

Using "/axis-cgi/media.cgi?resolution=1920x1080&fps=30&videocodec=h264&container=mp4" with "ffmpeg.exe" in the same folder.

import os
import requests
import subprocess
import time

def capture_video(url, duration, output_file):
    # Start capturing the video stream
    command = f'ffmpeg -i "{url}" -t {duration} -c:v copy -c:a copy "{output_file}"'
    process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    
    # Wait for the specified duration
    time.sleep(duration)
    
    # Terminate the ffmpeg process
    process.term…

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@vmithani
Comment options

Comment options

You must be logged in to vote
1 reply
@vmithani
Comment options

Comment options

You must be logged in to vote
3 replies
@vmithani
Comment options

@vivekatoffice
Comment options

@vmithani
Comment options

Answer selected by vmithani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
VAPIX
Labels
None yet
3 participants