[FFmpeg-trac] #11045(undetermined:new): vp9 in mp4 does not maintain transparency (yuva420p)

FFmpeg trac at avcodec.org
Wed Jun 5 15:34:03 EEST 2024


#11045: vp9 in mp4 does not maintain transparency (yuva420p)
--------------------------------------+----------------------------------
             Reporter:  Jozef Chutka  |                     Type:  defect
               Status:  new           |                 Priority:  normal
            Component:  undetermined  |                  Version:  7.0
             Keywords:                |               Blocked By:
             Blocking:                |  Reproduced by developer:  0
Analyzed by developer:  0             |
--------------------------------------+----------------------------------
 Using ffmpeg 7.0, I am able to create .mkv, .webm output with alpha
 channel, however not when creating .mp4

 creating transparent video vp9 in mp4 does not seem to maintain alpha
 channel:

 {{{

 ffmpeg -i input.png -vcodec libvpx-vp9 -auto-alt-ref 0 -y out.mkv
 ffmpeg -i input.png -vcodec libvpx-vp9 -auto-alt-ref 0 -y out.webm
 ffmpeg -i input.png -vcodec libvpx-vp9 -auto-alt-ref 0 -y out.mp4
 }}}

 The output log looks similar for all commands
 {{{
 Output #0, mp4, to 'out.mp4':
   Metadata:
     encoder         : Lavf61.1.100
   Stream #0:0: Video: vp9 (vp09 / 0x39307076),
 yuva420p(unknown/bt709/iec61966-2-1, progressive), 256x256 [SAR 1:1 DAR
 1:1], q=2-31, 25 fps, 12800 tbn
       Metadata:
         encoder         : Lavc61.3.100 libvpx-vp9
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
 }}}

 Notice, ffmpeg claims yuva420p is used, however, mp4 does not really store
 yuva420p:

 {{{
 ffmpeg -vcodec libvpx-vp9 -i out.mkv
 ...
 Stream #0:0: Video: vp9 (libvpx-vp9) (Profile 0), yuva420p(tv,
 unknown/bt709/iec61966-2-1, progressive), 256x256, SAR 1:1 DAR 1:1, 25
 fps, 25 tbr, 1k tbn

 ffmpeg -vcodec libvpx-vp9 -i out.webm
 ...
 Stream #0:0: Video: vp9 (libvpx-vp9) (Profile 0), yuva420p(tv,
 unknown/bt709/iec61966-2-1, progressive), 256x256, SAR 1:1 DAR 1:1, 25
 fps, 25 tbr, 1k tbn

 ffmpeg -vcodec libvpx-vp9 -i out.mp4
 ...
  Stream #0:0[0x1](und): Video: vp9 (libvpx-vp9) (Profile 0) (vp09 /
 0x39307076), yuv420p(tv, unknown/bt709/iec61966-2-1, progressive),
 256x256, 211 kb/s, SAR 1:1 DAR 1:1, 25 fps, 25 tbr, 12800 tbn (default)
 }}}

 When tested in a chrome browser which supports all these formats, only
 .mkv and .webm is rendered with transparency, while .mp4 being opaque.

 So the question is, does mp4 support vp9 with yuva420p or not? If not,
 should ffmpeg throw an error during encoding?
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11045>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list