Fix RFC-6381 for some codecs

This commit is contained in:
Zoe Roux 2024-06-16 19:32:42 +00:00
parent 7e3a1743c0
commit d7cb6f3c96
No known key found for this signature in database
2 changed files with 5 additions and 5 deletions

View File

@ -35,7 +35,7 @@ func GetMimeCodec(stream *ffprobe.Stream) *string {
ret += fmt.Sprintf("%02x", stream.Level) ret += fmt.Sprintf("%02x", stream.Level)
return &ret return &ret
case "h265": case "h265", "hevc":
// The h265 syntax is a bit of a mystery at the time this comment was written. // The h265 syntax is a bit of a mystery at the time this comment was written.
// This is what I've found through various sources: // This is what I've found through various sources:
// FORMAT: [codecTag].[profile].[constraint?].L[level * 30].[UNKNOWN] // FORMAT: [codecTag].[profile].[constraint?].L[level * 30].[UNKNOWN]
@ -95,15 +95,15 @@ func GetMimeCodec(stream *ffprobe.Stream) *string {
ret := "Opus" ret := "Opus"
return &ret return &ret
case "ac-3": case "ac3":
ret := "mp4a.a5" ret := "mp4a.a5"
return &ret return &ret
case "eac3", "E-AC-3": case "eac3":
ret := "mp4a.a6" ret := "mp4a.a6"
return &ret return &ret
case "x-flac", "FLAC": case "flac":
ret := "fLaC" ret := "fLaC"
return &ret return &ret

View File

@ -248,7 +248,7 @@ func saveInfo[T any](save_path string, mi *T) error {
func getInfo(path string) (*MediaInfo, error) { func getInfo(path string) (*MediaInfo, error) {
defer printExecTime("mediainfo for %s", path)() defer printExecTime("mediainfo for %s", path)()
ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) ctx, cancelFn := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelFn() defer cancelFn()
mi, err := ffprobe.ProbeURL(ctx, path) mi, err := ffprobe.ProbeURL(ctx, path)