1. 07 Nov, 2019 1 commit
    • Guo, Yejun's avatar
      avfilter/vf_dnn_processing: add a generic filter for image proccessing with dnn networks · 4d980a8c
      Guo, Yejun authored
      This filter accepts all the dnn networks which do image processing.
      Currently, frame with formats rgb24 and bgr24 are supported. Other
      formats such as gray and YUV will be supported next. The dnn network
      can accept data in float32 or uint8 format. And the dnn network can
      change frame size.
      
      The following is a python script to halve the value of the first
      channel of the pixel. It demos how to setup and execute dnn model
      with python+tensorflow. It also generates .pb file which will be
      used by ffmpeg.
      
      import tensorflow as tf
      import numpy as np
      import imageio
      in_img = imageio.imread('in.bmp')
      in_img = in_img.astype(np.float32)/255.0
      in_data = in_img[np.newaxis, :]
      filter_data = np.array([0.5, 0, 0, 0, 1., 0, 0, 0, 1.]).reshape(1,1,3,3).astype(np.float32)
      filter = tf.Variable(filter_data)
      x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
      y = tf.nn.conv2d(x, filter, strides=[1, 1, 1, 1], padding='VALID', name='dnn_out')
      sess=tf.Session()
      sess.run(tf.global_variables_initializer())
      output = sess.run(y, feed_dict={x: in_data})
      graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
      tf.train.write_graph(graph_def, '.', 'halve_first_channel.pb', as_text=False)
      output = output * 255.0
      output = output.astype(np.uint8)
      imageio.imsave("out.bmp", np.squeeze(output))
      
      To do the same thing with ffmpeg:
      - generate halve_first_channel.pb with the above script
      - generate halve_first_channel.model with tools/python/convert.py
      - try with following commands
        ./ffmpeg -i input.jpg -vf dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=native -y out.native.png
        ./ffmpeg -i input.jpg -vf dnn_processing=model=halve_first_channel.pb:input=dnn_in:output=dnn_out:fmt=rgb24:dnn_backend=tensorflow -y out.tf.png
      Signed-off-by: 's avatarGuo, Yejun <yejun.guo@intel.com>
      Signed-off-by: 's avatarPedro Arthur <bygrandao@gmail.com>
      4d980a8c
  2. 06 Nov, 2019 15 commits
  3. 05 Nov, 2019 6 commits
  4. 04 Nov, 2019 14 commits
  5. 03 Nov, 2019 4 commits
    • Nicolas Frattaroli's avatar
      avformat/ftp: add AVOptions for authentication · a8ec0685
      Nicolas Frattaroli authored
      This introduces two new AVOption options for the FTP protocol,
      one named ftp-user to supply the username to be used for auth,
      one named ftp-password to supply the password to be used for auth.
      
      These are useful for when an API user does not wish to deal with
      URL manipulation and percent encoding.
      
      Setting them while also having credentials in the URL will use the
      credentials from the URL. The rationale for this is that credentials
      embedded in the URL are probably more specific to what the user is
      trying to do than anything set by some API user.
      Signed-off-by: 's avatarNicolas Frattaroli <ffmpeg@fratti.ch>
      Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
      a8ec0685
    • Andriy Gelman's avatar
      avformat: Add max_probe_packets option · 5e3229df
      Andriy Gelman authored
      Allows user to set maximum number of buffered packets when
      probing a codec. It was a hard-coded parameter before this commit.
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      5e3229df
    • Zhong Li's avatar
      lavc/qsvenc: enable vp9 encoder · 33583803
      Zhong Li authored
      1. must enable low_power mode since just VDENC can be supported by iHD
      driver right now
      2. Coding option1 and extra_data are not supported by MSDK
      3. IVF header will be inserted in MSDK by default, but it is not needed
      for FFmpeg, so disable it.
      Signed-off-by: 's avatarZhong Li <zhongli_dev@126.com>
      33583803
    • Linjie Fu's avatar
      lavc/qsvenc: Fix bitrate_limit to allow AVC encode in limited bitrate · e786e373
      Linjie Fu authored
      MFXVideoENCODE_Query calls CheckVideoParamQueryLike in MSDK and
      will determine whether to set param.mfx.TargetKbps to the allowed
      minTargetKbps according to the bitrate_limit in extco2 buffer.
      
      Thus q->param.ExtParam must be set before MFXVideoENCODE_Query in case
      minTargetKbps is written to TargetKbps by default.
      
      1080P AVC encoding with option "-bitrate_limit 0 -b:v 100k":
      Before patch:
                  902 kbps
      After patch:
                  156 kbps
      Signed-off-by: 's avatarLinjie Fu <linjie.fu@intel.com>
      e786e373