kaltura / nginx-vod-module

NGINX-based MP4 Repackager
GNU Affero General Public License v3.0
2k stars 439 forks source link

about readme vod_hls_container_format mpegts and fmp4 #1403

Closed wzzc-dev closed 11 months ago

wzzc-dev commented 1 year ago

I try to use VOD module to play H265 format mov file, can play directly without using encryption case, encryption case need to set VOD: mpegts, but why Apple does not support HEVC over MPEG TS in the document

vod_hls_container_format syntax: vod_hls_container_format mpegts/fmp4/auto default: auto context: http, server, location Sets the container format of the HLS segments. The default behavior is to use fmp4 for HEVC, and mpegts otherwise (Apple does not support HEVC over MPEG TS).

erankor commented 1 year ago

You're asking me why Apple decided not to support HEVC with MPEG-TS?! last time I checked, I wasn't working for Apple...

Anyway, it's explicitly started here: https://developer.apple.com/documentation/http_live_streaming/http_live_streaming_hls_authoring_specification_for_apple_devices "1.5. The container format for HEVC video MUST be fMP4."

In my understanding, Apple wants to deprecate MPEG-TS in general. They can't remove it entirely due to all the streams out there that use MPEG-TS. When they added HEVC, they already supported fMP4, and since it was a new feature, they didn't have to worry about backward compatibility. So they preferred not to continue digging the MPEG-TS hole any deeper, and require that HEVC will use only fMP4.

wzzc-dev commented 1 year ago

Thank you very much for your reply, When playing a video in h265 format vod_hls_container_format:mpegts is
The video can be played, defaultvod_hls_container_format:fmp4 The video is not playing;

The video can be played

vod_hls_container_format:mpegts

#EXTM3U
#EXT-X-TARGETDURATION:9
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-KEY:METHOD=AES-128,URI="http://192.168.10.46/space/media/hls/hvc1.mp4/encryption.key",IV=0x8CF5AAA8277524D913AF1F09A3D97CDB
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:9.026,
http://192.168.10.46/space/media/hls/hvc1.mp4/segment-1-v1-a1.ts
#EXTINF:2.183,
http://192.168.10.46/space/media/hls/hvc1.mp4/segment-2-v1-a1.ts
#EXT-X-ENDLIST

The video is not playing;

default vod_hls_container_format:fmp4

#EXTM3U
#EXT-X-TARGETDURATION:9
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-KEY:METHOD=AES-128,URI="http://192.168.10.46/space/media/hls/hvc1.mp4/encryption.key",IV=0x8CF5AAA8277524D913AF1F09A3D97CDB
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-MAP:URI="http://192.168.10.46/space/media/hls/hvc1.mp4/init-v1-a1.mp4"
#EXTINF:9.026,
http://192.168.10.46/space/media/hls/hvc1.mp4/segment-1-v1-a1.m4s
#EXTINF:2.183,
http://192.168.10.46/space/media/hls/hvc1.mp4/segment-2-v1-a1.m4s
#EXT-X-ENDLIST
erankor commented 1 year ago

On which player/device are you testing? Can you send the stream URL?

wzzc-dev commented 1 year ago

On which player/device are you testing? Can you send the stream URL?

I tested it on vlc Player for windows and ios

wzzc-dev commented 1 year ago

Can you send the stream URL?

When vod_hls_container_format:fmp4, the slice file can be retrieved but cannot be played

erankor commented 1 year ago

I meant a URL that I can use to pull the stream and check...

han4235 commented 1 year ago

OK

从 Windows 版邮件https://go.microsoft.com/fwlink/?LinkId=550986发送

发件人: @.> 发送时间: 2022年11月20日 14:32 收件人: @.> 抄送: @.***> 主题: Re: [kaltura/nginx-vod-module] about readme vod_hls_container_format mpegts and fmp4 (Issue #1403)

Can you send the stream URL?

When vod_hls_container_format:fmp4, the slice file can be retrieved but cannot be played

― Reply to this email directly, view it on GitHubhttps://github.com/kaltura/nginx-vod-module/issues/1403#issuecomment-1321051501, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABBAPXX5QTW3DEH76CL56IDWJHAV7ANCNFSM6AAAAAASFLTSUQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

wzzc-dev commented 1 year ago

https://u7p3m3xe.dev-space.eulix.xyz/space/media/hls/hvc1.mp4/index.m3u8 @erankor sorry this is the url that can't be played

erankor commented 1 year ago

There are a couple of unrelated issues with this URL -

  1. It's an HTTPS URL that returns HTTP URLs - update the conf to either use relative URLs or to return https://
  2. The internal hostname used for the segments (eulixnetwork-server.bp-cicada-dev.svc.cluster.local) does not resolve
wzzc-dev commented 1 year ago

I assembled two m3u8 index files

H265 You Can't play it

#EXTM3U
#EXT-X-TARGETDURATION:9
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-KEY:METHOD=AES-128,URI="https://u7p3m3xe.dev-space.eulix.xyz/space/media/hls/hvc1.mp4/encryption.key",IV=0x8CF5AAA8277524D913AF1F09A3D97CDB
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-MAP:URI="https://u7p3m3xe.dev-space.eulix.xyz/space/media/hls/hvc1.mp4/init-v1-a1.mp4"
#EXTINF:9.026,
https://u7p3m3xe.dev-space.eulix.xyz/space/media/hls/hvc1.mp4/segment-1-v1-a1.m4s
#EXTINF:2.183,
https://u7p3m3xe.dev-space.eulix.xyz/space/media/hls/hvc1.mp4/segment-2-v1-a1.m4s
#EXT-X-ENDLIST

H264 You can play it

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-KEY:METHOD=AES-128,URI="https://u7p3m3xe.dev-space.eulix.xyz/space/media/hls/264-60.mp4/encryption.key",IV=0x8CF5AAA8277524D913AF1F09A3D97CDB
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:9.979,
https://u7p3m3xe.dev-space.eulix.xyz/space/media/hls/264-60.mp4/segment-1-v1-a1.ts
#EXTINF:6.836,
https://u7p3m3xe.dev-space.eulix.xyz/space/media/hls/264-60.mp4/segment-2-v1-a1.ts
#EXT-X-ENDLIST
wzzc-dev commented 1 year ago

I need iv, so I'm going to comment this out, but I don't think it has anything to do with that

https://github.com/wang-zhichuang/nginx-vod-module/blob/7b52e071d2e27b6cf536858780c3a05fd506409e/ngx_http_vod_hls.c#L173

image

erankor commented 1 year ago

As previously requested - I want a valid URL that shows the problem, not a paste of an m3u8... The previously sent URL still returns HTTP segments and a hostname that does not resolve.

wzzc-dev commented 1 year ago

H265 You Can't play it http://123.60.17.171:3080/space/media/hls/hvc1.mp4/index.m3u8

H264 You can play it http://123.60.17.171:3080/space/media/hls/264-60.mp4/index.m3u8

erankor commented 1 year ago

http://123.60.17.171:3080/space/media/hls/hvc1.mp4/index.m3u8 plays fine on my iPhone. Maybe you are testing on some device that does not support HEVC.

wzzc-dev commented 1 year ago

http://123.60.17.171:3080/space/media/hls/hvc1.mp4/index.m3u8 plays fine on my iPhone. Maybe you are testing on some device that does not support HEVC.

On which player/device are you testing? I can't play it with iphone11/vlc

erankor commented 1 year ago

I tested on iPhone XR running iOS 15 / 16 (I've just upgraded to 16 and it worked before and after the upgrade)