Media3 Transformer is actively under development and we are looking to hear from you! We welcome your feedback, feature requests and bug reports in the
issue tracker. Follow the
ExoPlayer blog for the latest updates.
การแมปโทนสี - รองรับเนื้อหา HDR และ SDR
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เมื่อทำงานกับ Transformer คุณต้องคำนึงถึงความเข้ากันได้
ระหว่างเนื้อหา HDR และ SDR ได้ HDR จะแสดงเนื้อหาที่มีรายละเอียดสีมากขึ้น
สีและคอนทราสต์ ทำให้ผู้ใช้ได้รับประสบการณ์การมองเห็นที่ดีขึ้น แต่เนื่องจาก
ความแตกต่างของช่วงสีระหว่าง HDR และ SDR โดยรวมองค์ประกอบ 2 ประเภท
เนื้อหาอาจนำไปสู่ปัญหาความเข้ากันได้
ขณะที่คุณสร้าง
Composition
,
คุณจะมีตัวเลือก setHdrMode
สำหรับอินพุตวิดีโอ HDR โดยค่าเริ่มต้น Transformer จะตั้งค่านี้เป็น
HDR_MODE_KEEP_HDR
,
ซึ่งช่วยให้แน่ใจว่าเอาต์พุตจะอยู่ในรูปแบบ HDR ถ้าอุปกรณ์ไม่
รองรับรูปแบบ HDR Transformer จะพยายามใช้
HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_OPEN_GL
แทน
ในบางกรณี คุณอาจรวมทั้งเนื้อหา HDR และ SDR เข้าด้วยกัน ตัวอย่างเช่น คุณสามารถ
อาจมีการวางซ้อน SDR ที่ด้านบนของวิดีโอและรูปภาพ HDR หรือคุณอาจผสมผสานกัน
ของวิดีโอ HDR และ SDR ในกรณีนี้ คุณมีตัวเลือกต่อไปนี้
|
ข้อดี |
ข้อเสีย |
แผนที่โทนสีด้วย MediaCodec |
เอาต์พุตภาพที่มีคุณภาพดีที่สุดหากรองรับในอุปกรณ์และ API ร่วมกัน |
รองรับเฉพาะใน API 31 ขึ้นไปในอุปกรณ์บางเครื่องและ API 33 ขึ้นไปสำหรับอุปกรณ์บางรุ่น
พร้อมรองรับการจับภาพ HDR หากไม่รองรับ Transformer จะส่ง
ExportException |
แผนที่โทนสีด้วย OpenGL |
รองรับใน API 29 ขึ้นไป แต่โดยทั่วไปรองรับอุปกรณ์ที่หลากหลายมากขึ้น ให้ผลลัพธ์ที่สอดคล้องกันมากขึ้น |
อาจสร้างความแตกต่างเพียงเล็กน้อยเมื่อเทียบกับผลลัพธ์ที่ได้จากการใช้
HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_MEDIACODEC |
ตีความ HDR เป็น SDR |
ตัวเลือกที่ได้รับการสนับสนุนอย่างกว้างขวางที่สุด |
เนื้อหามักจะมีลักษณะสีซีดและอาจแสดงอย่างไม่ถูกต้อง |
ข้อจำกัดปัจจุบัน
ระบบไม่รองรับรายการต่อไปนี้สำหรับการเรียบเรียงที่มีหลายเนื้อหา
- การแมปโทนสี SDR เป็น HDR
- ลำดับเนื้อหา SDR และ HDR ที่เริ่มต้นด้วยเนื้อหา HDR
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# Tone mapping - Supporting HDR and SDR content\n\nWhen working with Transformer, it is important to consider the compatibility\nbetween HDR and SDR content. HDR displays content with greater color detail,\ncolor and contrast, giving users a better visual experience. However, due to the\ndifference in color ranges between HDR and SDR, combining the two types of\ncontent could lead to compatibility issues.\n\nAs you are building a\n[`Composition`](/reference/androidx/media3/transformer/Composition.Builder),\nyou have the option to [`setHdrMode`](/reference/androidx/media3/transformer/Composition.Builder#setHdrMode(int))\nfor HDR video inputs. By default, Transformer sets this value to\n[`HDR_MODE_KEEP_HDR`](/reference/androidx/media3/transformer/Composition#HDR_MODE_KEEP_HDR()),\nwhich ensures the output is kept in the HDR format. If the device does not\nsupport the HDR format, Transformer automatically attempts to use\n[`HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_OPEN_GL`](/reference/androidx/media3/transformer/Composition#HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_OPEN_GL()) instead.\n\nIn some cases, you may be combining both HDR and SDR assets. For example, you\nmight have SDR overlays on top of HDR videos and images, or you might have a mix\nof HDR and SDR videos. In this case, you have the following options:\n\n| | Advantages | Disadvantages |\n|--------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Tone map with MediaCodec](/reference/androidx/media3/transformer/Composition#HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_MEDIACODEC()) | Best visual quality output if supported on device and API combination. | Only supported on API 31+ on certain devices and on API 33+ for devices with HDR capture support. If not supported, `Transformer` throws an `ExportException`. |\n| [Tone map with OpenGL](/reference/androidx/media3/transformer/Composition#HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_OPEN_GL()) | Supported on API 29+, with generally wider support across devices. Produces more consistent results. | May produce mild differences compared to output from using `HDR_MODE_TONE_MAP_HDR_TO_SDR_USING_MEDIACODEC`. |\n| [Interpret HDR as SDR](/reference/androidx/media3/transformer/Composition#HDR_MODE_EXPERIMENTAL_FORCE_INTERPRET_HDR_AS_SDR()) | Most widely supported option. | Contents will likely have a washed out look and may be displayed incorrectly. |\n\nCurrent limitations\n-------------------\n\nThe following are unsupported for multi-asset compositions:\n\n- SDR to HDR tone mapping\n- SDR and HDR content sequences that start with an HDR asset"]]