I’m a beginner with FFmpeg. I’m trying to convert MOV files to MP4 using an Intel GPU (QSV), but it’s not working. I used the following Python script:
def convert_video_mov(input_file, output_file):
command = [
'ffmpeg',
'-i', input_file,
'-vf', 'scale=1920:1080',
'-c:v', 'libx264',
'-b:v', '2500k',
'-r', '30',
'-y',
output_file
]
subprocess.run(command)
input_video_path = ['IMG_4413.MOV', 'IMG_4437.MOV']
for i in range(len(input_video_path)):
convert_video_mov(input_video_path[i], "[conv]"+input_video_path[i])
When I run this script, I encounter the following errors:
[h264_qsv @ 0000012e3d198d40] Current pixel format is unsupported
[h264_qsv @ 0000012e3d198d40] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
[vost#0:0/h264_qsv @ 0000012e3d1c5b80] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0000012e3d0e5b00] Error sending frames to consumers: Function not implemented
[vf#0:0 @ 0000012e3d0e5b00] Task finished with error code: -40 (Function not implemented)
[vf#0:0 @ 0000012e3d0e5b00] Terminating thread with return code -40 (Function not implemented)
[vost#0:0/h264_qsv @ 0000012e3d1c5b80] Could not open encoder before EOF
[vost#0:0/h264_qsv @ 0000012e3d1c5b80] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_qsv @ 0000012e3d1c5b80] Terminating thread with return code -22 (Invalid argument)
[out#0/mov @ 0000012e3d12acc0] Nothing was written into output file, because at least one of its streams received no packets.
I tried running ffmpeg -formats
and saw the following two lines related to MOV:
E mov QuickTime / MOV
D mov,mp4,m4a,3gp,3g2,mj2 QuickTime / MOV
Is there a way to solve this problem? Thank you for any replies!
I tried Intel GPU to convert MP4 to MP4 (changing the size, bit-rate), it works.
JonnyW is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.