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

How do I set -tag:v hvc1 for QuickTime-compatible HEVC (H.265) encoding? #87

Open
reinhart1010 opened this issue Oct 27, 2023 · 0 comments

Comments

@reinhart1010
Copy link

Hi, I'm following the steps at https://brandur.org/fragments/ffmpeg-h265 to allow ffmpeg-converted H.265 videos to be playable on QuickTime. However, I'm still unsure on how to set that properly using this library.

In a batch processing Go script, I decided to use the following examples to convert H.264 videos to H.265.

trans.MediaFile().SetPreset("fast")
trans.MediaFile().SetVideoCodec("libx265")
trans.MediaFile().SetVideoProfile("main")
trans.MediaFile().SetTags(map[string]string{"p": "hvc1"})
trans.MediaFile().SetFrameRate(VIDEO_FRAME_RATE)
trans.MediaFile().SetAudioCodec("aac")
trans.MediaFile().SetAudioRate(AUDIO_SAMPLING_RATE)

In this case, the tag is still not applied properly.

I've also replaced trans.MediaFile().SetTags(map[string]string{"p": "hvc1"}) with others, including:

  • trans.MediaFile().SetTags(map[string]string{"hvc1": ""}) (same behavior)
  • trans.MediaFile().SetRawOutputArgs([]string{"-tag:v hvc1"})
    • Error: failed finish ffmpeg ([-y -i videos/orig/58.mp4 -r 30 -ar 44100 -c:v libx265 -profile:v main -c:a aac -preset fast -tag:v hvc1 -hls_list_size 0 videos/h265-aac-mp4/58.mp4]) with exit status 1 message
    • However, running ffmpeg -y -i videos/orig/58.mp4 -r 30 -ar 44100 -c:v libx265 -profile:v main -c:a aac -preset fast -tag:v hvc1 -hls_list_size 0 videos/h265-aac-mp4/58.mp4 manually works and produces the QuickTime-playable HEVC video.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant