Add metadata map to VideoSource and add MP4 H.265 preset

This commit is contained in:
Stu Leak 2025-12-08 16:02:53 -05:00
parent 2dd9c7d279
commit eb349f8365
2 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package convert
// FormatOptions contains all available output format presets
var FormatOptions = []FormatOption{
{Label: "MP4 (H.264)", Ext: ".mp4", VideoCodec: "libx264"},
{Label: "MP4 (H.265)", Ext: ".mp4", VideoCodec: "libx265"},
{Label: "MKV (H.265)", Ext: ".mkv", VideoCodec: "libx265"},
{Label: "MOV (ProRes)", Ext: ".mov", VideoCodec: "prores_ks"},
{Label: "DVD-NTSC (MPEG-2)", Ext: ".mpg", VideoCodec: "mpeg2video"},

View File

@ -77,8 +77,8 @@ type VideoSource struct {
Duration float64
VideoCodec string
AudioCodec string
Bitrate int // Video bitrate in bits per second
AudioBitrate int // Audio bitrate in bits per second
Bitrate int // Video bitrate in bits per second
AudioBitrate int // Audio bitrate in bits per second
FrameRate float64
PixelFormat string
AudioRate int
@ -94,6 +94,7 @@ type VideoSource struct {
GOPSize int // GOP size / keyframe interval
HasChapters bool // Whether file has embedded chapters
HasMetadata bool // Whether file has title/copyright/etc metadata
Metadata map[string]string
}
// DurationString returns a human-readable duration string (HH:MM:SS or MM:SS)