[FFmpeg-devel] [PATCH 1/5] lavc : yami : add libyami decoder/encoder

Jun Zhao mypopydev at gmail.com
Tue Aug 16 11:51:11 EEST 2016



On 2016/8/16 15:40, Chao Liu wrote:
> On Mon, Aug 15, 2016 at 10:22 PM, Jun Zhao <mypopydev at gmail.com> wrote:
> 
cult...
>>
>> I used the ffmpeg_QSV/ffmpeg_libyami/ffmpeg_vaapi to do zero-copy mode
>> transcode with default setting as profile case.
>>
> Perhaps you could share your test environment settings and the results, so
> others could repro and confirm what you said, which could make this patch
> more appealing.
> IIUC, there is no hardware accelerated encoder for VP8 in ffmpeg yet.
> That's another value of this patch..

some log you can refer to, and now I can't find QSV test bed :(

barry at barry:~/Source/video/yami/ffmpeg_libyami$ ./ffmpeg -y -vaapi_device /dev/dri/card0 -hwaccel vaapi -hwaccel_output_format vaapi -i ../ffmpeg_yami_testcase/skyfall2-trailer.mp4 -an -vf 'format=nv12|vaapi,hwupload' -c:v h264_vaapi -profile 77 -level:v 40  -b 4000k  output_vaapi_transcode.mp4
ffmpeg version N-81825-g80f8fc9 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/opt/ffmpeg --enable-libyami --disable-doc --enable-version3 --enable-vaapi
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 51.102 / 57. 51.102
  libavformat    57. 46.101 / 57. 46.101
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 51.100 /  6. 51.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
libva info: VA-API version 0.39.3
libva info: va_getDriverName() returns 0
libva info: Trying to open /opt/yami/vaapi/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../ffmpeg_yami_testcase/skyfall2-trailer.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isom
    creation_time   : 2012-07-31 00:31:48
  Duration: 00:02:30.77, start: 0.000000, bitrate: 4002 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 3937 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2012-07-31 00:31:48
      handler_name    : MP4 Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 61 kb/s (default)
    Metadata:
      creation_time   : 2012-07-31 00:31:48
      handler_name    : MP4 Sound Media Handler
Please use -profile:a or -profile:v, -profile is ambiguous
Please use -b:a or -b:v, -b is ambiguous
[mp4 @ 0x36bedc0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, mp4, to 'output_vaapi_transcode.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isom
    encoder         : Lavf57.46.101
    Stream #0:0(eng): Video: h264 (h264_vaapi) (Main) ([33][0][0][0] / 0x0021), vaapi_vld, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 4000 kb/s, 23.98 fps, 24k tbn, 23.98 tbc (default)
    Metadata:
      creation_time   : 2012-07-31 00:31:48
      handler_name    : MP4 Video Media Handler
      encoder         : Lavc57.51.102 h264_vaapi
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
Press [q] to stop, [?] for help
[h264 @ 0x382ba40] Hardware accelerated decoding with frame threading is known to be unstable and its use is discouraged.
Input stream #0:0 frame changed from size:1920x1080 fmt:yuv420p to size:1920x1080 fmt:vaapi_vld
Unrepairable overflow!-0.0 size=     797kB time=00:00:01.79 bitrate=3639.5kbits/s dup=1 drop=0 speed=3.54x    
frame= 3615 fps=132 q=-0.0 Lsize=   71470kB time=00:02:30.69 bitrate=3885.3kbits/s dup=1 drop=0 speed=5.49x    
video:71435kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.048997%
barry at barry:~/Source/video/yami/ffmpeg_libyami$ mediainfo output_vaapi_transcode.mp4 
General
Complete name                            : output_vaapi_transcode.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 69.8 MiB
Duration                                 : 2mn 30s
Overall bit rate mode                    : Variable
Overall bit rate                         : 3 883 Kbps
Writing application                      : Lavf57.46.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main at L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 2 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2mn 30s
Bit rate mode                            : Variable
Bit rate                                 : 3 881 Kbps
Maximum bit rate                         : 256 Mbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.078
Stream size                              : 69.8 MiB (100%)
Language                                 : English


barry at barry:~/Source/video/yami/ffmpeg_libyami$ ./ffmpeg -y -c:v libyami_h264 ../ffmpeg_yami_testcase/skyfall2-trailer.mp4 -c:v libyami_h264 output_yami_transcode.mp4 ffmpeg version N-81825-g80f8fc9 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/opt/ffmpeg --enable-libyami --disable-doc --enable-version3 --enable-vaapi
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 51.102 / 57. 51.102
  libavformat    57. 46.101 / 57. 46.101
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 51.100 /  6. 51.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
Output #0, mp4, to '../ffmpeg_yami_testcase/skyfall2-trailer.mp4':
Output file #0 does not contain any stream
barry at barry:~/Source/video/yami/ffmpeg_libyami$ ./ffmpeg -y -c:v libyami_h264 -i ../ffmpeg_yami_testcase/skyfall2-trailer.mp4 -c:v libyami_h264 output_yami_transcode.mp4 
ffmpeg version N-81825-g80f8fc9 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Debian 4.9.2-10)
  configuration: --prefix=/opt/ffmpeg --enable-libyami --disable-doc --enable-version3 --enable-vaapi
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 51.102 / 57. 51.102
  libavformat    57. 46.101 / 57. 46.101
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 51.100 /  6. 51.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
libva info: VA-API version 0.39.3
libva info: va_getDriverName() returns 0
libva info: Trying to open /opt/yami/vaapi/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../ffmpeg_yami_testcase/skyfall2-trailer.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isom
    creation_time   : 2012-07-31 00:31:48
  Duration: 00:02:30.77, start: 0.000000, bitrate: 4002 kb/s
    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), nv12, 1920x1080, 3937 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 48k tbc (default)
    Metadata:
      creation_time   : 2012-07-31 00:31:48
      handler_name    : MP4 Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 61 kb/s (default)
    Metadata:
      creation_time   : 2012-07-31 00:31:48
      handler_name    : MP4 Sound Media Handler
[libyami_h264 @ 0x2711e20] Using the main profile as default.
[mp4 @ 0x26ea120] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mp4, to 'output_yami_transcode.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isom
    encoder         : Lavf57.46.101
    Stream #0:0(eng): Video: h264 (libyami_h264) ([33][0][0][0] / 0x0021), yami, 1920x1080, q=2-31, 200 kb/s, 23.98 fps, 24k tbn, 23.98 tbc (default)
    Metadata:
      creation_time   : 2012-07-31 00:31:48
      handler_name    : MP4 Video Media Handler
      encoder         : Lavc57.51.102 libyami_h264
    Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2012-07-31 00:31:48
      handler_name    : MP4 Sound Media Handler
      encoder         : Lavc57.51.102 aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (libyami_h264) -> h264 (libyami_h264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[aac @ 0x26eb7e0] SSR is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x26eb7e0] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel at ffmpeg.org)
Error while decoding stream #0:1: Not yet implemented in FFmpeg, patches welcome
frame= 3615 fps=182 q=-0.0 Lsize=   75955kB time=00:02:30.76 bitrate=4127.0kbits/s dup=1 drop=0 speed=7.58x    
video:73474kB audio:2393kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.115290%
[aac @ 0x26f49c0] Qavg: 1272.917
                 
barry at barry:~/Source/video/yami/ffmpeg_libyami$ mediainfo output_yami_transcode.mp4 
General
Complete name                            : output_yami_transcode.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 74.2 MiB
Duration                                 : 2mn 30s
Overall bit rate                         : 4 126 Kbps
Writing application                      : Lavf57.46.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main at L4.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=12
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2mn 30s
Bit rate                                 : 3 992 Kbps
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.080
Stream size                              : 71.8 MiB (97%)
Language                                 : English

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 2mn 30s
Bit rate mode                            : Constant
Bit rate                                 : 132 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 2.34 MiB (3%)
Language                                 : English



More information about the ffmpeg-devel mailing list