video_transcoding: HEVC output is not playable by QuickTime on macOS 10.13 High Sierra Beta 6
Using transcode-video --handbrake-option encoder=x265 --mp4 I am unable to create a file that can be played back by QuickTime on 10.13. It appears the output is not compatible with the upcoming HEVC support in macOS. I have not tested playback on iOS 11 beta yet.
video_transcoding 0.17.3 macOS 10.13 beta 6
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 36 (14 by maintainers)
Commits related to this issue
- Compile ffmpeg and dependencies from latest versions See https://github.com/donmelton/video_transcoding/issues/160 — committed to ntodd/video_transcoding_docker by deleted user 7 years ago
Been digging a bit and might have some info.
It looks like ffmpeg has added hvc1 tag support with these two commits: https://github.com/FFmpeg/FFmpeg/commit/974d508e571085dce43e688595da058804169088 https://github.com/FFmpeg/FFmpeg/commit/369a3e111cb8015c3a3acc5c2c15728c8f37084f
They are currently in master and do not appear to be in a ffmpeg release yet. With the patches, you should be able to do the following with ffmpeg directly to get an hvc1 tagged version:
ffmpeg -i input.mp4 -vcodec copy -acodec copy -tag:v hvc1 output.mp4I will try to build from master and test, but probably won’t have time to check until tomorrow.
Confirming FFmpeg compiled from source works as described above. I tagged a version of the docker image that has the necessary patches (as well as latest libx265) if anyone needs it. Run it with:
docker run -itv "pwd":/data ntodd/video-transcoding:0.17.3-ffmpegYou can then convert
hev1tagged h265 tohvc1with:ffmpeg -i input.mp4 -vcodec copy -acodec copy -tag:v hvc1 output.mp4or similar.Output works in QuickTime on MacOS 10.13 beta 6.
Install HEAD version of
ffmpeg:Update
hev1tag tohvc1:Full version posted here: https://gist.github.com/k06a/45f4ff4e52a7c0ad2add370ab1a315e7
Installation:
Converting video, than audio, than combining into 1 file and finally fix tag:
@ntodd @donmelton I just found this. Haven’t tested it yet, but looks like the latest handbrake nightly builds will support
hvc1out of the box: https://github.com/HandBrake/HandBrake/commit/67dfaca7ac3ec56cc4ab3c7f9f60ab3b7c43a0dbMaybe we just have to wait a little 😃
Update: Tested & Works
@ntodd Thank you so much for this. I was able to convert a large batch of improperly tagged files in seconds and they now all play flawlessly on my Apple TV. You’re my hero. 😃
@mikumi Thanks for the information! That would explain a lot to @ntodd and myself. 😃
However, it’s not
transcode-videothat is marking the streams as such. It’sHandBrakeCLIor the LibAV library within it.Of course, if the HandBrake team doesn’t fix this problem, I could do it within
transcode-videoby callingmp4boxdirectly. However, that would add another dependency.@ntodd I had the same problem. I’m no expert, but looks like it has to do with the packaging of the stream, see this stackoverflow answer: https://stackoverflow.com/a/32485240/968099
From what I understand
transcode-videomarks the video stream hashev1, but it actually needs to be marked ashvc1in order to be recognized by Quick Time.Running
mp4box -raw 1 file.mp4ans thenmp4box -add file_track1.hvc output.mp4as described in the stackoverflow answer solved the issue for me.Ideally
transcode-videowould be able to outputhvc1streams directly, maybe as an option. But it’s also possible Quick Time won’t have this issue anymore in future betas.This worked for me: https://danconnor.com/posts/21d8bd7c22f6ae6b423c3c09/how_to_encode_h_265_hevc_video_that_will_play_in_quicktime_on_macos_using_ffmpeg_
I had some files from an older camera that just refused being converted by any software I threw at them. Now it works flawlessly in HEVC.
@necktwi The
-anoption forffmpegdisables audio output so I don’t think you want to use that.If it helps anyone, I built a version of the docker image that compiles more current versions of ffmpeg and handbrake so output from
transcode-videois tagged withhvc1correctly. You can also use included ffmpeg to re-tag any existing h265 videos.You can pull
ntodd/video-transcoding:headto get this version and the dockerfile is at https://github.com/ntodd/video_transcoding_docker/blob/head/video-transcoding/Dockerfile.Instructions for basic usage of the docker image are at https://hub.docker.com/r/ntodd/video-transcoding/, just be sure to pull the
headversion to get the latest.@donmelton I mean Brorsoft Video Converter. It is a good HEVC/h265 converting tool. Converting always brings some loss but it can be ignore when you play it.