From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 688374799F for ; Mon, 27 Nov 2023 19:47:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BB56568CF5C; Mon, 27 Nov 2023 21:47:10 +0200 (EET) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D7ABD68CD2D for ; Mon, 27 Nov 2023 21:47:03 +0200 (EET) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3316d3d11e1so2667431f8f.0 for ; Mon, 27 Nov 2023 11:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20230601.gappssmtp.com; s=20230601; t=1701114423; x=1701719223; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KbKn5h5v3tRUIMs2ItMmZL6DEPb1Tz0C1DvSpBDKklU=; b=TsKP2PIo0TgFy1RuiMG+ADj2iI1GA7N51YFsYfgXZTY8AsovVvvaL6JkCQe2CKF+LV +dhjeSNbvG5Ko8ZR2/yszherLAdXmWcVkJ8iW9jcwhRnsPzMzBQTsV6dgVcuF6c310dx w8p9cxzIa4EDneCmxzZke0x++nGIpC7GVWmNbOHtN5+cYp5VZc2MRTPLEVKeqzFWqCwz fw+RqOF1r7dPhLT1OUhfB2RddS/AopjSJpy5b598oH6JKps9jU0wV+b+grX4VH6oMon1 EtVdH7BChf/I4PaZFu23Tm/OsAWndLi3Je6g5uYQBfW8FEMwGY+k2uduEa04r1qFwWSd KbEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701114423; x=1701719223; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KbKn5h5v3tRUIMs2ItMmZL6DEPb1Tz0C1DvSpBDKklU=; b=tCSAWqLiWPLPJDbTXCLA7M32oP4mVcIbYaBs3tbx1YZbid1tn9M1p0ICDwHgxKAI34 6JxHoPyY57sIh4Vqiqq+jRvJntbrAfMdz7kiim2IUDbf8WPhf8RbCW88IO0GuTq1bZrv ndoifvjgxs3n/3ZlB9TTT1K9evzgTrMxeOW3nYg+Lezxx/L/I8idUzCIE79jyhOqilQ0 y3zFyGQbZLFTc9WHU0tl9lQvwPwcdI/B8GcvZPvR7aY6wgl5D3Ubu+p1MRpDsPq8mwbo vyht87nfisJk4ig/W34ADJYRhKckgCse/DUb+P1gJQ6X8hLd9aWnsyFyprmplgXNS21E rsEw== X-Gm-Message-State: AOJu0Yxp60JHTx0ArmaIwoeSns395s8IZ/QhTVl5limEVuid1zNQfIuP iS0Pq3fUQPSlvv96HBMGorfKrdln0V8vYGggizc= X-Google-Smtp-Source: AGHT+IFdIJTKICM6ewDDc6jNBUOHUbuzjXi6jWqQ4jje4Amadd7hMXMPINVkIH9kwJyMJLE+nueNzw== X-Received: by 2002:a05:6000:1acb:b0:332:fa6c:c896 with SMTP id i11-20020a0560001acb00b00332fa6cc896mr4911109wry.9.1701114423104; Mon, 27 Nov 2023 11:47:03 -0800 (PST) Received: from [192.168.0.15] (cpc92320-cmbg19-2-0-cust383.5-4.cable.virginm.net. [82.13.65.128]) by smtp.gmail.com with ESMTPSA id e18-20020a05600c4e5200b0040b43da0bbasm6375717wmq.30.2023.11.27.11.47.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Nov 2023 11:47:02 -0800 (PST) Message-ID: <96fc6bbf-7b6a-4306-8e52-63905893b6ce@jkqxz.net> Date: Mon, 27 Nov 2023 19:47:21 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20231031185817.6779-2-lucenticus@gmail.com> From: Mark Thompson In-Reply-To: <20231031185817.6779-2-lucenticus@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH 10 bit support v5 1/3] avcodec/amfenc: Fixes the color information in the output. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 31/10/2023 18:57, Evgeny Pavlov wrote: > From: Michael Fabian 'Xaymar' Dirks > > added 10 bit support for amf hevc. > > before: > > command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file.mkv -an -c:v h264_amf res.dx11_hw_h264.mkv > output - Format of input frames context (p010le) is not supported by AMF. > command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v hevc_amf res.dx11_hw_hevc.mkv > output - Format of input frames context (p010le) is not supported by AMF. > > after: > > command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v h264_amf res.dx11_hw_h264.mkv > output - 10-bit input video is not supported by AMF H264 encoder > command - ffmpeg.exe -hide_banner -y -hwaccel d3d11va -hwaccel_output_format d3d11 -i test_10bit_file -an -c:v hevc_amf res.dx11_hw_hevc.mkv > output - 10bit file > > v2 - lost line returned in ff_amf_pix_fmts > v3 - fixes after review > v4 - extract duplicated code, fix incorrect processing of 10-bit input for h264 > v5 - non-functional changes after review > > Co-authored-by: Evgeny Pavlov > --- > libavcodec/amfenc.c | 37 +++++++++++++++++++++++++++++++++++++ > libavcodec/amfenc.h | 3 +++ > libavcodec/amfenc_h264.c | 24 ++++++++++++++++++++---- > libavcodec/amfenc_hevc.c | 26 +++++++++++++++++++++++++- > 4 files changed, 85 insertions(+), 5 deletions(-) There is something very wrong with how the header information is working here. With this series applied, I ran: ffmpeg_g.exe -report -y -i in.mp4 -an -c:v hevc_amf -bsf:v trace_headers -frames:v 1 out.mp4 My input file is: Stream #0:0[0x1](und), 60, 1/60000: Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 74462 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default) [trace_headers @ 0000023184c753c0] Extradata [trace_headers @ 0000023184c753c0] Sequence Parameter Set ... [trace_headers @ 0000023184c753c0] 222 vui_parameters_present_flag 0 = 0 So no colour information at all in the headers, and the output file indeed says: Stream #0:0[0x1](und): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, progressive), 3840x2160, 977 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 60k tbn (default) However! Reading further: [trace_headers @ 0000023184c753c0] Packet: 2039 bytes, key frame, pts 0, dts 0. ... [trace_headers @ 0000023184c753c0] Sequence Parameter Set ... [trace_headers @ 0000023184c753c0] 222 vui_parameters_present_flag 1 = 1 [trace_headers @ 0000023184c753c0] 223 aspect_ratio_info_present_flag 1 = 1 [trace_headers @ 0000023184c753c0] 224 aspect_ratio_idc 11111111 = 255 [trace_headers @ 0000023184c753c0] 232 sar_width 0000000000000001 = 1 [trace_headers @ 0000023184c753c0] 248 sar_height 0000000000000001 = 1 [trace_headers @ 0000023184c753c0] 264 overscan_info_present_flag 0 = 0 [trace_headers @ 0000023184c753c0] 265 video_signal_type_present_flag 1 = 1 [trace_headers @ 0000023184c753c0] 266 video_format 101 = 5 [trace_headers @ 0000023184c753c0] 269 video_full_range_flag 0 = 0 [trace_headers @ 0000023184c753c0] 270 colour_description_present_flag 1 = 1 [trace_headers @ 0000023184c753c0] 271 colour_primaries 00001001 = 9 [trace_headers @ 0000023184c753c0] 279 transfer_characteristics 00010000 = 16 [trace_headers @ 0000023184c753c0] 287 matrix_coefficients 00001001 = 9 [trace_headers @ 0000023184c753c0] 295 chroma_loc_info_present_flag 0 = 0 [trace_headers @ 0000023184c753c0] 296 neutral_chroma_indication_flag 0 = 0 [trace_headers @ 0000023184c753c0] 297 field_seq_flag 0 = 0 [trace_headers @ 0000023184c753c0] 298 frame_field_info_present_flag 0 = 0 [trace_headers @ 0000023184c753c0] 299 default_display_window_flag 0 = 0 [trace_headers @ 0000023184c753c0] 300 vui_timing_info_present_flag 1 = 1 [trace_headers @ 0000023184c753c0] 301 vui_num_units_in_tick 00000000000000000000001111101001 = 1001 [trace_headers @ 0000023184c753c0] 333 vui_time_scale 00000000000000001110101001100000 = 60000 [trace_headers @ 0000023184c753c0] 365 vui_poc_proportional_to_timing_flag 1 = 1 [trace_headers @ 0000023184c753c0] 366 vui_num_ticks_poc_diff_one_minus1 1 = 0 Comparing the to the original, the chroma sample location (collocated top-left in the original, so the implied default is wrong) has been lost but the colours are otherwise correct in the extraneous headers embedded in the first packet. So the colour information has kindof been passed through, except not in the place in the headers which matters so it is mostly useless. (I guess it maybe works for raw streams with no headers?) I think you need to fix whatever is making the headers not match the actual stream content (which creates invalid files, mp4 and similar containers with global headers need them to match). Thanks, - Mark _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".