I am using ffprobe and python on Lambda and trying to get the dimensions of a video. I have the code that grabs the localized source file.
# Download the source file from S3
source_object = s3.Object(source_bucket_name, find_file_name)
print(f'The source object is {source_object}')
source_file = '/tmp/source.mp4'
source_object.download_file(source_file)
# Get dimensions of video
dimensions_x = os.system('ffprobe -v error -select_streams v:0 -show_entries stream=height,width -of csv=s=x:p=0 ' + source_file )
print(f'The dimensions of x are {dimensions_x}')
The source file is in an S3 bucket and the stored in the /tmp
file. However, the print file doesn't show up in my Cloudwatch logs. It seems to pass right over this code as well.
print(f'The dimensions of x are {dimensions_x}')
I have been trying different methods with FFmpeg, all with the same outcome. The code all works as expected except for the code getting the dimensions.