I am trying to play H.265 video file using AVPlayer(Both in iOS 10,11). Following is the code:
let fileUrl = Bundle.main.url(forResource: "sample-h265-360", withExtension: "mp4")
player = AVPlayer(url: fileUrl!)
player?.play()
Audio is playing fine but video is not showing(I am using AVPlayerViewController). I have read that H.265 is supported in iOS 11 but the result is same for me(audio playing but video not showing).
I tried to transfer the file and play it using other Apps. It worked fine with ShareIt. Can anyone suggest libraries to play this content? or what in-built music player does shareIt use? Is there any mistake in my code? Was anyone successful in playing H.265 file using AVPlayer?
Since September 19, all iPhone 7 and up (and 2017 iPad Pros) can now fully deliver and receive video in the H. 265 codec - a step up from H. 264 that has been used since the very first iPhone was released.
Yes. Since Apple released iOS 11 in 2017, HEVC codec is fully supported by newer iPhones.
iOS 11 and macOS High Sierra introduced support for these new, industry-standard media formats: HEIF (High Efficiency Image File Format) for photos. HEVC (High Efficiency Video Coding), also known as H.
For some stupid reason, Apple will only play hevc mp4s that are tagged as ‘hvc1’. Most authoring tools will tag as 'hev1’
You can retag with ffmpeg, but only with very recient builds.
ffmpeg -i input.mp4 -vcodec copy -acodec copy -tag:v hvc1 output.mp4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With