0

I have problems with FFmpeg and Intel QuickSync. If I start my ffmpeg command from shell it works correctly. But if I want to start the same ffmpeg command from an cronjob I get Failure with quicksync

My command is:

/bin/ffmpeg -vsync passthrough -copytb 1 -hwaccel qsv -probesize 5000000 -analyzeduration 16000000 -c:v hevc_qsv -recv_buffer_size 67108864 -i source -filter_complex "[v:0]hwdownload,format=pix_fmts=nv12[format:0]; [format:0]cvdelogo=filename=file:buffer_queue_size=150:detect_interval=25:score_min=0.4:scale_min=0.75:scale_max=1.25:padding_left=10:padding_right=10:padding_top=10:padding_bottom=10[cvdelogo]; [cvdelogo]split=outputs=1[hwupload:0]; [hwupload:0]hwupload=extra_hw_frames=10[map:v:0]" -map [map:v:0] -c:v h264_qsv -flags:v +global_header+cgop -preset:v veryfast -g 250 -b:v:0 6200k -maxrate:v:0 6200k -bufsize:v:0 6200k -map a:0 -c:a copy -f hls -hls_flags delete_segments -hls_time 10 -hls_list_size 6 output.m3u8

If I run that on terminal everything works. But if I want to start it from php with shell_exec command over an cronjob I get this failure:

[AVHWDeviceContext @ 0x2cc7b80] Failed to initialise VAAPI connection: -1 (unknown libva error). Error creating a QSV device

I don't know why FFmpeg is not founding the vaapi device from cronjob, pls help me out of this issue.

Thanks

Bulat
  • 720
  • 7
  • 15
  • Your cron job probably doesn't have `$DISPLAY` set, or is otherwise not allowed / authorized to connect to the graphics hardware. – Peter Cordes May 13 '19 at 23:47
  • Thanks for reply i fixxed it... the issue was on PATH Variable on /etc/environment. I have another question. Is it possible to use igpu and Nvidia GPU together on Ffmpeg? For Example 1 Stream transcoding with QuickSync another Stream transcoding with Nvidia Nvenc at same time... – Ahmet Gürer May 14 '19 at 22:01
  • No idea, I don't have a use for low quality per bitrate video so I typically use libx265, usually with `-preset slower`, or sometimes libx264 `-preset veryslow` for lower resolutions. – Peter Cordes May 15 '19 at 06:35
  • My question was whether I could use Nvidia Nvenc and Quicksync together :-). But Thanks – Ahmet Gürer May 15 '19 at 08:03
  • I understood your question, I was just explaining why I don't know the answer, sorry. Even though I know they exist I don't use either of them. – Peter Cordes May 15 '19 at 08:05

0 Answers0