Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VP9 in MP4 container #99

Open
mossly opened this issue Apr 30, 2023 · 1 comment
Open

VP9 in MP4 container #99

mossly opened this issue Apr 30, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mossly
Copy link

mossly commented Apr 30, 2023

Support for encoding VP9 in an MP4 container would be useful for Discord as webm lacks native iOS support and therefore does not embed.

VP9 is natively supported and does embed on iOS when uploaded in mp4.

Encoding works in ffmpeg, but my attempt to make a custom encode profile for webmgenerator has been unsuccessful.

{"name":"Discord 50M VP9 mp4","editable":false,"outputFormat":"mp4:VP9","maximumSize":"50.0","audioChannels":"No audio"}

@dfaker
Copy link
Owner

dfaker commented May 2, 2023

A customer encoder spec would be the way to go, but a direct copy of the vpn doesn't seem to work on iphone:

{
	"name":"VP9 mp4",
	"baseEncoder":"",
	"extension":"mp4",
	"multi-pass-encode":true,
	"commandBlocks":[
		{"cmds":["-shortest", "-copyts", "-start_at_zero", "-c:v","libvpx-vp9"]},
		

		{"conditions":[["audioChannels","contains","Copy"]],
	     "cmds":["-c:a","libopus"],
		 "altCmds":[]
		},
		
		{"cmds":["-stats","-threads","{encoderStageThreads}"]},


		{"selection":{	
			"name":"auto-alt-ref",
			"label":"VP9 auto-alt-ref",
			"default":"6",
			"type":"int",
			"cmds":["-auto-alt-ref", "{value}"]
		}},

		{"selection":{	
			"name":"lag-in-frames",
			"label":"VP9 lag-in-frames",
			"default":"25",
			"type":"int",
			"cmds":["-lag-in-frames", "{value}"]
		}},

		{"conditions":[["passPhase","equals","1"]],
	     "cmds":[],
		 "altCmds":["-speed", "1"]
		},

		{"cmds":["-flags", "+psnr", "-row-mt", "1", "-tile-columns", "{tileColumns}", "-tile-rows", "0"
                ,"-aq-mode", "0"]
		},


		{"selection":{	
			"name":"arnr-maxframes",
			"label":"VP9 ARNR maximum frames",
			"default":"15",
			"type":"int",
			"cmds":["-arnr-maxframes", "{value}"]
		}},

		{"selection":{	
			"name":"arnr-strength",
			"label":"VP9 ARNR noise filter strength",
			"default":"0",
			"type":"int",
			"cmds":["-arnr-strength", "{value}"]
		}},

		{"selection":{	
			"name":"pixfmt",
			"label":"Output Pixel Format",
			"default":"yuv420p profile:0",
			"options":[
				{"name":"yuv420p10le profile:2","cmds":["-profile:v", "2", "-pix_fmt", "yuv420p10le"]},
				{"name":"yuv420p profile:0","cmds":["-profile:v", "0", "-pix_fmt", "yuv420p"]},
				{"name":"yuv444p12le profile:3","cmds":["-profile:v", "3", "-pix_fmt", "yuv444p12le"]}
			]
		}},

		{"selection":{	
			"name":"quality",
			"label":"Deadline / Quality",
			"default":"good",
			"options":[
				{"name":"Good","cmds":["-quality", "good"]},
				{"name":"Best","cmds":["-quality", "best"]},
				{"name":"Realtime","cmds":["-quality", "realtime"]}
			]
		}},


		{"cmds":["-tune-content", "default", "-enable-tpl", "1", "-frame-parallel", "0"
                ,"-metadata", "Title={metadata_title}","-b:v","{br}"]
		},

		{"conditions":[["audioChannels","contains","No audio"]],
	     "cmds":["-an"]
		},
		{"conditions":[["audioChannels","contains","Stereo"]],
	     "cmds":["-ac","2","-ar","48k", "-b:a","{audoBitrate}"]
		},
		{"conditions":[["audioChannels","contains","Mono"]],
	     "cmds":["-ac","1","-ar","48k", "-b:a","{audoBitrate}"]
		},
		{"conditions":[["audioChannels","contains","Copy"]],
	     "cmds":["-c:a","copy"]
		},
		{"cmds":["-sn"]}
	]
}

Any ideas on additonal parameters or options you'd want?

@dfaker dfaker added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants