Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3056 Discussions

Monit and Zabbix, try to restart ffmpeg script with QSV encoder

rasko_N_
Beginner
770 Views

Thanks for Intel team for Media SDK. Good solution to transcode via GPU of CPU. Everything working very well.

Only one problem: when try to restart ffmpeg via monit or send remote command from ZABBIX we got error message to init MFX, if try to put command to directly to linux command line likes: node8# /etc/init.d/ch1 restart it works very well. We are tested just change in ffmpeg config file h264_qsv to libx264 we can use MONIT and Zabbix to restart.  

[h264_qsv @ 0x1fc6be0] mfx init: /dev/dri/renderD128 vaInitialize failed
[h264_qsv @ 0x1fc6be0] mfx init: /dev/dri/renderD129 fd open failed
[h264_qsv @ 0x1fc6be0] mfx init: /dev/dri/renderD130 fd open failed
[h264_qsv @ 0x1fc6be0] mfx init: /dev/dri/card0 vaInitialize failed
[h264_qsv @ 0x1fc6be0] mfx init: /dev/dri/card1 vaInitialize failed
[h264_qsv @ 0x1fc6be0] mfx init: /dev/dri/card2 fd open failed
[h264_qsv @ 0x1fc6be0] Error initializing the encoder
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

#!/bin/bash

NAME=ch1
INPUT=227.0.2.68:2068
OUTPUT=229.1.1.68:2068
SERVICE_ID=111
SERVICE_NAME=CTC
# OUTPUT2=224.22.22.22:1234

case "$1" in
start)
   if [ -e /var/run/$NAME.pid ];then
     echo $NAME is already running
    else
FFREPORT=file=/var/log/ffmpeg/$NAME.log:level=16 $NAME -re -v 40 \
 -i "udp://$INPUT?fifo_size=1000000&overrun_nonfatal=1" -nostdin -sn -map 0:p:$SERVICE_ID \
 -c:v h264_qsv -threads 0 -preset:v faster \
 -acodec libfdk_aac -b:a 92k \
 -y -r 25 -vsync 1 -async 25 \
 -b:v 900k -bufsize 900k \
 -metadata service_provider="CONNECT LLC" \
 -metadata service_name="$SERVICE_NAME" \
 -y -f mpegts -flush_packets 0 \
 "udp://$OUTPUT?fifo_buffer=5000000&overrun_nonfatal_option=1&pkt_size=1316&ttl=12" >/dev/null 2>&1 & echo $!>/var/run/$NAME.pid
   fi
   ;;
stop)
   kill `cat /var/run/$NAME.pid`
   rm /var/run/$NAME.pid
   ;;
restart)
   $0 stop
   $0 start
   ;;
status)
   if [ -e /var/run/$NAME.pid ]; then
      echo $NAME is running, pid=`cat /var/run/$NAME.pid`
   else
      echo $NAME is NOT running
      exit 1
   fi
   ;;
*)
   echo "Usage: $0 {start|stop|status|restart}"
esac

exit 0

 

0 Kudos
3 Replies
rasko_N_
Beginner
770 Views

Thanks! Problem has solved :)

0 Kudos
gabriel_p_2
Beginner
770 Views

I have the same problem, could You share the solution ?

 

 

Br

Paralichko

0 Kudos
rasko_N_
Beginner
770 Views

Add to config:

export LIBVA_DRIVERS_PATH=/opt/intel/mediasdk/lib64
export LIBVA_DRIVER_NAME=iHD
export MFX_HOME=/opt/intel/mediasdk
export PKG_CONFIG_PATH=/opt/intel/opencl:

 

 

0 Kudos
Reply