generate hls stream using h265 codecHLS video segmenting complications. How to create a transport stream with...
What is the highest possible scrabble score for placing a single tile
Angel of Condemnation - Exile creature with second ability
Does Doodling or Improvising on the Piano Have Any Benefits?
How to explain what's wrong with this application of the chain rule?
What is going on with 'gets(stdin)' on the site coderbyte?
Can I say "fingers" when referring to toes?
What does "Scientists rise up against statistical significance" mean? (Comment in Nature)
Why does a simple loop result in ASYNC_NETWORK_IO waits?
Why Shazam when there is already Superman?
Terse Method to Swap Lowest for Highest?
Need help understanding what a natural log transformation is actually doing and why specific transformations are required for linear regression
Do the primes contain an infinite almost arithmetic progression?
Redundant comparison & "if" before assignment
Has any country ever had 2 former presidents in jail simultaneously?
Is there a way to get `mathscr' with lower case letters in pdfLaTeX?
Why "had" in "[something] we would have made had we used [something]"?
What if a revenant (monster) gains fire resistance?
Temporarily disable WLAN internet access for children, but allow it for adults
What is the evidence for the "tyranny of the majority problem" in a direct democracy context?
Calculating total slots
A social experiment. What is the worst that can happen?
Store Credit Card Information in Password Manager?
Mixing PEX brands
Why is this estimator biased?
generate hls stream using h265 codec
HLS video segmenting complications. How to create a transport stream with ffmpegffmpeg: Converting MKV to MP4 losslessTranscode HLS m3u8 to MP4 and include text trackHow can I overlay PNGs with transparency over a video? (each PNG should cover one frame)FFmpeg - Fade in watermark onlyCannot play MPEG-TS from webcam using ExoPlayer on Android or Quicktime on MacChanging the codec while keeping the bitrate with ffmpegA/V out of sync when using ffmpeg from mpeg-ts to dashHow to use ffmpeg to add multiple audio files to the video at a specific time?Encode stereoscopic h265 video with FFmpeg
I am trying to convert h264
video to an hls stream which uses h265
codec. As this bitmovin article suggests, we need to use framgmented mp4
for the hls/h265
stream to work on safari.
- I am able to convert
h264
toh265
properly using this command
ffmpeg -i input.mp4 -c:v libx265 -tag:v hvc1 out.mp4
- I am able to convert an input video (
h264
) to hls (framgmented mp4
) using this command
ffmpeg -y -i input.mp4
-c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10
-hls_flags delete_segments+append_list+split_by_time
-hls_playlist_type vod manifest.m3u8
Now when I use the above command by specifying h265
, the output hls stream does not work in safari. It throws this error
Plugin Handled Load
Command
ffmpeg -y -i input.mp4
-vf scale=640:360 -c:v libx265 -tag:v hvc1 -c:a copy
-hls_segment_type fmp4 -hls_time 6 -hls_list_size 10
-hls_flags delete_segments+append_list+split_by_time
-hls_playlist_type vod manifest.m3u8
What might be the issue here ?
ffmpeg streaming h.265 hls
add a comment |
I am trying to convert h264
video to an hls stream which uses h265
codec. As this bitmovin article suggests, we need to use framgmented mp4
for the hls/h265
stream to work on safari.
- I am able to convert
h264
toh265
properly using this command
ffmpeg -i input.mp4 -c:v libx265 -tag:v hvc1 out.mp4
- I am able to convert an input video (
h264
) to hls (framgmented mp4
) using this command
ffmpeg -y -i input.mp4
-c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10
-hls_flags delete_segments+append_list+split_by_time
-hls_playlist_type vod manifest.m3u8
Now when I use the above command by specifying h265
, the output hls stream does not work in safari. It throws this error
Plugin Handled Load
Command
ffmpeg -y -i input.mp4
-vf scale=640:360 -c:v libx265 -tag:v hvc1 -c:a copy
-hls_segment_type fmp4 -hls_time 6 -hls_list_size 10
-hls_flags delete_segments+append_list+split_by_time
-hls_playlist_type vod manifest.m3u8
What might be the issue here ?
ffmpeg streaming h.265 hls
I've run into this as well. I've narrowed it down to an issue Safari has with the libx265 hevc encoder. If you use hevc_videotoolbox (with -allow_sw 0 or 1), it will properly encode and Safari will play it. It's a shame, because the quality of hevc_videotoolbox is pretty poor for bitrates under 5000k.
– Bryan Scott
Jan 30 at 20:15
Further searching has brought me to at least one problem Apple apps have with libx265: it puts an "hev1" tag instead of an "hvc1" tag in the mp4 container (see discussion in discussions.apple.com/thread/8091782). I tried overriding the tag (-tag:v hvc1) but that didn't fix the problem for Safari.
– Bryan Scott
Jan 30 at 21:19
add a comment |
I am trying to convert h264
video to an hls stream which uses h265
codec. As this bitmovin article suggests, we need to use framgmented mp4
for the hls/h265
stream to work on safari.
- I am able to convert
h264
toh265
properly using this command
ffmpeg -i input.mp4 -c:v libx265 -tag:v hvc1 out.mp4
- I am able to convert an input video (
h264
) to hls (framgmented mp4
) using this command
ffmpeg -y -i input.mp4
-c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10
-hls_flags delete_segments+append_list+split_by_time
-hls_playlist_type vod manifest.m3u8
Now when I use the above command by specifying h265
, the output hls stream does not work in safari. It throws this error
Plugin Handled Load
Command
ffmpeg -y -i input.mp4
-vf scale=640:360 -c:v libx265 -tag:v hvc1 -c:a copy
-hls_segment_type fmp4 -hls_time 6 -hls_list_size 10
-hls_flags delete_segments+append_list+split_by_time
-hls_playlist_type vod manifest.m3u8
What might be the issue here ?
ffmpeg streaming h.265 hls
I am trying to convert h264
video to an hls stream which uses h265
codec. As this bitmovin article suggests, we need to use framgmented mp4
for the hls/h265
stream to work on safari.
- I am able to convert
h264
toh265
properly using this command
ffmpeg -i input.mp4 -c:v libx265 -tag:v hvc1 out.mp4
- I am able to convert an input video (
h264
) to hls (framgmented mp4
) using this command
ffmpeg -y -i input.mp4
-c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10
-hls_flags delete_segments+append_list+split_by_time
-hls_playlist_type vod manifest.m3u8
Now when I use the above command by specifying h265
, the output hls stream does not work in safari. It throws this error
Plugin Handled Load
Command
ffmpeg -y -i input.mp4
-vf scale=640:360 -c:v libx265 -tag:v hvc1 -c:a copy
-hls_segment_type fmp4 -hls_time 6 -hls_list_size 10
-hls_flags delete_segments+append_list+split_by_time
-hls_playlist_type vod manifest.m3u8
What might be the issue here ?
ffmpeg streaming h.265 hls
ffmpeg streaming h.265 hls
edited Jul 13 '18 at 9:19
formatkaka
asked Jul 11 '18 at 11:32
formatkakaformatkaka
1066
1066
I've run into this as well. I've narrowed it down to an issue Safari has with the libx265 hevc encoder. If you use hevc_videotoolbox (with -allow_sw 0 or 1), it will properly encode and Safari will play it. It's a shame, because the quality of hevc_videotoolbox is pretty poor for bitrates under 5000k.
– Bryan Scott
Jan 30 at 20:15
Further searching has brought me to at least one problem Apple apps have with libx265: it puts an "hev1" tag instead of an "hvc1" tag in the mp4 container (see discussion in discussions.apple.com/thread/8091782). I tried overriding the tag (-tag:v hvc1) but that didn't fix the problem for Safari.
– Bryan Scott
Jan 30 at 21:19
add a comment |
I've run into this as well. I've narrowed it down to an issue Safari has with the libx265 hevc encoder. If you use hevc_videotoolbox (with -allow_sw 0 or 1), it will properly encode and Safari will play it. It's a shame, because the quality of hevc_videotoolbox is pretty poor for bitrates under 5000k.
– Bryan Scott
Jan 30 at 20:15
Further searching has brought me to at least one problem Apple apps have with libx265: it puts an "hev1" tag instead of an "hvc1" tag in the mp4 container (see discussion in discussions.apple.com/thread/8091782). I tried overriding the tag (-tag:v hvc1) but that didn't fix the problem for Safari.
– Bryan Scott
Jan 30 at 21:19
I've run into this as well. I've narrowed it down to an issue Safari has with the libx265 hevc encoder. If you use hevc_videotoolbox (with -allow_sw 0 or 1), it will properly encode and Safari will play it. It's a shame, because the quality of hevc_videotoolbox is pretty poor for bitrates under 5000k.
– Bryan Scott
Jan 30 at 20:15
I've run into this as well. I've narrowed it down to an issue Safari has with the libx265 hevc encoder. If you use hevc_videotoolbox (with -allow_sw 0 or 1), it will properly encode and Safari will play it. It's a shame, because the quality of hevc_videotoolbox is pretty poor for bitrates under 5000k.
– Bryan Scott
Jan 30 at 20:15
Further searching has brought me to at least one problem Apple apps have with libx265: it puts an "hev1" tag instead of an "hvc1" tag in the mp4 container (see discussion in discussions.apple.com/thread/8091782). I tried overriding the tag (-tag:v hvc1) but that didn't fix the problem for Safari.
– Bryan Scott
Jan 30 at 21:19
Further searching has brought me to at least one problem Apple apps have with libx265: it puts an "hev1" tag instead of an "hvc1" tag in the mp4 container (see discussion in discussions.apple.com/thread/8091782). I tried overriding the tag (-tag:v hvc1) but that didn't fix the problem for Safari.
– Bryan Scott
Jan 30 at 21:19
add a comment |
1 Answer
1
active
oldest
votes
I tested this with ffmpeg 4.1.1 today on macOS 10.14.3, and it seems to work beautifully. I do have to transcode to a MP4 initially (can't just go direct to HLS manifest during the transcode stage as the resulting m3u8 is unplayable in Safari – seems like a ffmpeg bug), but the packaging function appears to work perfectly well, and I am able to play the resulting HEVC HLS m3u8 (in UHDp60 HDR10 even – albeit with quite a bit of buffering on my iPhone XS Max and a non-tone-mapped display in macOS) in Safari on both macOS 10.14.3 and iOS 12.1.2.
As stated above, I first need to transcode to MP4 (the following example takes a UHDp60 HEVC HDR10 input and transcodes to 1080p60 HEVC HDR10):
ffmpeg -y -i source.mp4 -c:v libx265 -tag:v hvc1 -pix_fmt yuv420p10le -s 1920x1080 -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:bitrate=4000:keyint=120:strict-cbr" -c:a copy ~/Sites/HLS/1080p/HDR10.mp4
From the resulting file, I can then do the HLS packaging:
ffmpeg -y -i ~/Sites/HLS/1080p/HDR10.mp4 -c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10 -hls_flags delete_segments+append_list+split_by_time -hls_playlist_type vod ~/Sites/HLS/1080p/HDR10.m3u8
The output from these steps produces all the necessary file to be able to logon to my web server and automatically play the HLS playlist in Safari. Safari can even play streamed HEVC HDR10 MP4 files from a web server now. So I would suggest attempting to do that first – if your original MP4 doesn't play in Safari via the web server, then it is unlikely that a HLS packaging of it will either.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1338231%2fgenerate-hls-stream-using-h265-codec%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I tested this with ffmpeg 4.1.1 today on macOS 10.14.3, and it seems to work beautifully. I do have to transcode to a MP4 initially (can't just go direct to HLS manifest during the transcode stage as the resulting m3u8 is unplayable in Safari – seems like a ffmpeg bug), but the packaging function appears to work perfectly well, and I am able to play the resulting HEVC HLS m3u8 (in UHDp60 HDR10 even – albeit with quite a bit of buffering on my iPhone XS Max and a non-tone-mapped display in macOS) in Safari on both macOS 10.14.3 and iOS 12.1.2.
As stated above, I first need to transcode to MP4 (the following example takes a UHDp60 HEVC HDR10 input and transcodes to 1080p60 HEVC HDR10):
ffmpeg -y -i source.mp4 -c:v libx265 -tag:v hvc1 -pix_fmt yuv420p10le -s 1920x1080 -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:bitrate=4000:keyint=120:strict-cbr" -c:a copy ~/Sites/HLS/1080p/HDR10.mp4
From the resulting file, I can then do the HLS packaging:
ffmpeg -y -i ~/Sites/HLS/1080p/HDR10.mp4 -c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10 -hls_flags delete_segments+append_list+split_by_time -hls_playlist_type vod ~/Sites/HLS/1080p/HDR10.m3u8
The output from these steps produces all the necessary file to be able to logon to my web server and automatically play the HLS playlist in Safari. Safari can even play streamed HEVC HDR10 MP4 files from a web server now. So I would suggest attempting to do that first – if your original MP4 doesn't play in Safari via the web server, then it is unlikely that a HLS packaging of it will either.
add a comment |
I tested this with ffmpeg 4.1.1 today on macOS 10.14.3, and it seems to work beautifully. I do have to transcode to a MP4 initially (can't just go direct to HLS manifest during the transcode stage as the resulting m3u8 is unplayable in Safari – seems like a ffmpeg bug), but the packaging function appears to work perfectly well, and I am able to play the resulting HEVC HLS m3u8 (in UHDp60 HDR10 even – albeit with quite a bit of buffering on my iPhone XS Max and a non-tone-mapped display in macOS) in Safari on both macOS 10.14.3 and iOS 12.1.2.
As stated above, I first need to transcode to MP4 (the following example takes a UHDp60 HEVC HDR10 input and transcodes to 1080p60 HEVC HDR10):
ffmpeg -y -i source.mp4 -c:v libx265 -tag:v hvc1 -pix_fmt yuv420p10le -s 1920x1080 -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:bitrate=4000:keyint=120:strict-cbr" -c:a copy ~/Sites/HLS/1080p/HDR10.mp4
From the resulting file, I can then do the HLS packaging:
ffmpeg -y -i ~/Sites/HLS/1080p/HDR10.mp4 -c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10 -hls_flags delete_segments+append_list+split_by_time -hls_playlist_type vod ~/Sites/HLS/1080p/HDR10.m3u8
The output from these steps produces all the necessary file to be able to logon to my web server and automatically play the HLS playlist in Safari. Safari can even play streamed HEVC HDR10 MP4 files from a web server now. So I would suggest attempting to do that first – if your original MP4 doesn't play in Safari via the web server, then it is unlikely that a HLS packaging of it will either.
add a comment |
I tested this with ffmpeg 4.1.1 today on macOS 10.14.3, and it seems to work beautifully. I do have to transcode to a MP4 initially (can't just go direct to HLS manifest during the transcode stage as the resulting m3u8 is unplayable in Safari – seems like a ffmpeg bug), but the packaging function appears to work perfectly well, and I am able to play the resulting HEVC HLS m3u8 (in UHDp60 HDR10 even – albeit with quite a bit of buffering on my iPhone XS Max and a non-tone-mapped display in macOS) in Safari on both macOS 10.14.3 and iOS 12.1.2.
As stated above, I first need to transcode to MP4 (the following example takes a UHDp60 HEVC HDR10 input and transcodes to 1080p60 HEVC HDR10):
ffmpeg -y -i source.mp4 -c:v libx265 -tag:v hvc1 -pix_fmt yuv420p10le -s 1920x1080 -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:bitrate=4000:keyint=120:strict-cbr" -c:a copy ~/Sites/HLS/1080p/HDR10.mp4
From the resulting file, I can then do the HLS packaging:
ffmpeg -y -i ~/Sites/HLS/1080p/HDR10.mp4 -c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10 -hls_flags delete_segments+append_list+split_by_time -hls_playlist_type vod ~/Sites/HLS/1080p/HDR10.m3u8
The output from these steps produces all the necessary file to be able to logon to my web server and automatically play the HLS playlist in Safari. Safari can even play streamed HEVC HDR10 MP4 files from a web server now. So I would suggest attempting to do that first – if your original MP4 doesn't play in Safari via the web server, then it is unlikely that a HLS packaging of it will either.
I tested this with ffmpeg 4.1.1 today on macOS 10.14.3, and it seems to work beautifully. I do have to transcode to a MP4 initially (can't just go direct to HLS manifest during the transcode stage as the resulting m3u8 is unplayable in Safari – seems like a ffmpeg bug), but the packaging function appears to work perfectly well, and I am able to play the resulting HEVC HLS m3u8 (in UHDp60 HDR10 even – albeit with quite a bit of buffering on my iPhone XS Max and a non-tone-mapped display in macOS) in Safari on both macOS 10.14.3 and iOS 12.1.2.
As stated above, I first need to transcode to MP4 (the following example takes a UHDp60 HEVC HDR10 input and transcodes to 1080p60 HEVC HDR10):
ffmpeg -y -i source.mp4 -c:v libx265 -tag:v hvc1 -pix_fmt yuv420p10le -s 1920x1080 -x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:bitrate=4000:keyint=120:strict-cbr" -c:a copy ~/Sites/HLS/1080p/HDR10.mp4
From the resulting file, I can then do the HLS packaging:
ffmpeg -y -i ~/Sites/HLS/1080p/HDR10.mp4 -c copy -hls_segment_type fmp4 -hls_time 6 -hls_list_size 10 -hls_flags delete_segments+append_list+split_by_time -hls_playlist_type vod ~/Sites/HLS/1080p/HDR10.m3u8
The output from these steps produces all the necessary file to be able to logon to my web server and automatically play the HLS playlist in Safari. Safari can even play streamed HEVC HDR10 MP4 files from a web server now. So I would suggest attempting to do that first – if your original MP4 doesn't play in Safari via the web server, then it is unlikely that a HLS packaging of it will either.
answered 16 mins ago
csimon2csimon2
111
111
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1338231%2fgenerate-hls-stream-using-h265-codec%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I've run into this as well. I've narrowed it down to an issue Safari has with the libx265 hevc encoder. If you use hevc_videotoolbox (with -allow_sw 0 or 1), it will properly encode and Safari will play it. It's a shame, because the quality of hevc_videotoolbox is pretty poor for bitrates under 5000k.
– Bryan Scott
Jan 30 at 20:15
Further searching has brought me to at least one problem Apple apps have with libx265: it puts an "hev1" tag instead of an "hvc1" tag in the mp4 container (see discussion in discussions.apple.com/thread/8091782). I tried overriding the tag (-tag:v hvc1) but that didn't fix the problem for Safari.
– Bryan Scott
Jan 30 at 21:19