From patchwork Fri Dec 1 18:17:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 6492 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp1474064jah; Fri, 1 Dec 2017 10:17:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMYJH9zezY59iOEY2phvVx3C4hMxhoz0VSdlzQLCp70TluMHSX28X5kji2d1y+B9kt085tst X-Received: by 10.223.159.15 with SMTP id l15mr6626379wrf.155.1512152250623; Fri, 01 Dec 2017 10:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512152250; cv=none; d=google.com; s=arc-20160816; b=Wnf8Y/N4D0DFlQVYksSaW0FTpB1rtnQutlcVfLxNN6ke0UyHdJM7aodXzhlmYyKAku vYAXeCkHRa8II7Dglpe0HG7EkNve8SFZgPs4Raaom8F6dHN4b8j04firpdGKsSuXZm/O SJYelMgbA3ksT5hcy+mL9mldCtl/U59PJRBJZ6cQe5lfGyCSrsZSYbmGToi7seAWSI0m LQG9+e3CU9KwAQL2vGfWKaDXoom3NGyNPf2IymGMv8YfbVahXr1UgSTwnUfRpTkzPeOR 0LVVPb3ZdyBTYHiqpsSN69Wb/awNhM0SufE1+pTrZIgmOLJ5DKDPTPGYpslvOlhwzD3S LJcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:dkim-signature :delivered-to:arc-authentication-results; bh=Du2E54HMIi2UcqZKHUQVLRGnz63GXlaY+QIUpXSB90g=; b=LekSYX1ecd7/7CV4EvFhhL4GAVEaXn/WWrsjotqT5Sn8mEvAJ4whIl5RbGIxwn+hcy Jf7TzeEFg5yuD7DgrOi6yzQ5FzWmYGivVRvyh+lkKQ2j3stY3fsmxHga3sa1qlgzUbI/ ZuJKPXuo+pdh+NOjocGBCc5fho2MGLfnStfqMhgV5qx9jdcZ0R3K8gJuq6zl7c1pJ+ga 8qrKCmstxJ9Kbp36qIdwxIuPpECfQlbK90r9ssijtSOyRMykyihgm34FbW69jTZR/fGn RC05k+HE/ycMK6HQK6TbL/8/K2AV555bdmnUsySwMAUap9d/vODDutWyYadj7dDA80lM jJnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=ENqLNCh4; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r142si1076149wme.110.2017.12.01.10.17.26; Fri, 01 Dec 2017 10:17:30 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=ENqLNCh4; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 92D2B68A4B6; Fri, 1 Dec 2017 20:17:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8993B68A3E0 for ; Fri, 1 Dec 2017 20:17:15 +0200 (EET) Received: by mail-wm0-f42.google.com with SMTP id b76so4888212wmg.1 for ; Fri, 01 Dec 2017 10:17:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=/Dl3WFlokyhijhL520/WX6R6/+SIBqlh4Umgef4O+OI=; b=ENqLNCh408D/1KBmGrHcpEFAbkL2tYNJLE/hbaabjytKO3d6wl29UZ8yxg6VB7BzPh 4sDAoZLcL8gZ4XIxtiaTJEbTe3JtTlYtDOzFy49iP9Fj/bAWnD1VjnD6W9/RjURGUcwM wHk+ZmCLmO+VcgAiM39gPb1U2sCfBnF0KUmI5mlj1dxwgy0DDl2DMJgSZMwo6FjswTYZ yYOuRLMgZOctW3wMsEg6eN+qeu4bEqg8kaont8WOkiMLS4QbcXW4T8FEJoWeZIUj27P1 9clQ1GDcO609LTdZNkU9j+gQ1Cot/lRzzk0yztct159pIb/oy3km1Hfq8c39piS2qiPd orDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/Dl3WFlokyhijhL520/WX6R6/+SIBqlh4Umgef4O+OI=; b=P23LMfUWPaly+ThcAPMW7aZuc2wt+PeutA92j7WeyDZu3PRNzn4UOiRxc8CpZpkSFU PS4X6kyEnn8X6wzaDt1aigENKxDFn8Jr3a6u9/afuAO35zhfqQgf9AgKzhRszBlrVFWO q12PKWhWlNGInyRTpDgzAdZ07QZwNp2dexE00Gl8CSy3wtMY63NxLNZzAKtH3nkZM86e /JXbqf2nny0OQ2RZUjF+GUrkFNxlzR/qQqO63Z8dsPdRDMQZDDaCRlFoGu8VRVdCE+cQ hOByeWy11cB2JX7dKDAAj2jzxXG2AmYOEzYlK87BxGSEbVOCYXtKPp/k6seI5qdCzLXe oCIQ== X-Gm-Message-State: AKGB3mIY542klOUe9geQL8U+iLDlRawRmmI7IEW7qM5IoTLfzM44ZDW0 umRspmu+570UBtKtiLi3SvcVKb+D X-Received: by 10.28.105.196 with SMTP id z65mr2014929wmh.146.1512152238320; Fri, 01 Dec 2017 10:17:18 -0800 (PST) Received: from [10.0.0.193] ([213.210.30.6]) by smtp.gmail.com with ESMTPSA id o22sm10063888wrb.40.2017.12.01.10.17.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Dec 2017 10:17:17 -0800 (PST) To: ffmpeg-devel@ffmpeg.org References: From: Mark Thompson Message-ID: Date: Fri, 1 Dec 2017 18:17:16 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Subject: Re: [FFmpeg-devel] Recent regression in VA-API compatibility (assertion in H.264 encode) X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" On 01/12/17 16:48, Devin Heitmueller wrote: > Hello, > > It looks like a recent patch causes VA-API H.264 encode to stop working and an assertion to be thrown. I ran a git bisect and narrowed it down to the following commit: > > 32a618a948c20f18db102d0b0976790222a57105 is the first bad commit > commit 32a618a948c20f18db102d0b0976790222a57105 > Author: Mark Thompson > Date: Wed Oct 18 19:46:53 2017 +0100 > > vaapi_h264: Do not use deprecated header type > > SEI headers should be inserted as generic raw data (the old specific > type has been deprecated in libva2). > > > When run with the above patch, I get the following output: > > [h264_vaapi @ 0x37d0a20] Warning: some packed headers are not supported (want 0xd, got 0xb). > [h264_vaapi @ 0x37d0a20] The encode compression level option is not supported with this VAAPI version. > ffmpeg: i965_drv_video.c:352: va_enc_packed_type_to_idx: Assertion `0' failed. > > Here’s the vainfo output which provides the version info for the driver, va-api version, etc. This is on a Haswell system running Centos 7. > > libva info: VA-API version 0.34.0 > libva info: va_getDriverName() returns 0 > libva info: Trying to open /usr/lib64/dri/i965_drv_video.so > libva info: Found init function __vaDriverInit_0_34 > libva info: va_openDriver() returns 0 > vainfo: VA-API version: 0.34 (libva 1.2.1) > vainfo: Driver version: Intel i965 driver - 1.2.2 Upgrading to a version less than four years old might be a plan - I admit we do notionally support that version because of old RHEL/CentOS, but it is not well tested (as you are finding). > > I’m using the following command line for testing: > > ./ffmpeg -y -vaapi_device /dev/dri/card0 -i /home/devin/inputfile.ts -vf 'format=nv12,hwupload' -c:v h264_vaapi out.mp4 > > Any suggestions that could be offered would be greatly appreciated. Likewise please let me know if there is any other information I can provide that would assist in getting this resolved. Try this? (Not tested, hardware which can run a version that old isn't immediately to hand.) (Probably wants a comment pointing at the driver code to explain why that condition, too.) - Mark --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -261,7 +261,8 @@ static int vaapi_encode_h264_write_extra_header(AVCodecContext *avctx, return 0; #if !CONFIG_VAAPI_1 - } else if (priv->sei_cbr_workaround_needed) { + } else if (priv->sei_cbr_workaround_needed && + ctx->va_packed_headers & VA_ENC_PACKED_HEADER_SLICE) { // Insert a zero-length header using the old SEI type. This is // required to avoid triggering broken behaviour on Intel platforms // in CBR mode where an invalid SEI message is generated by the