当使用ffmpeg指定绝对hls_fmp4_init_文件名时,如何修复m3u8中的EXT-X-MAP:URI?

当使用ffmpeg指定绝对hls_fmp4_init_文件名时,如何修复m3u8中的EXT-X-MAP:URI?,ffmpeg,mp4,http-live-streaming,ffmpeg-php,fmp4,Ffmpeg,Mp4,Http Live Streaming,Ffmpeg Php,Fmp4,今天我发现教我关于碎片化MP4(FMP4) 使用,我取得了很大的进步 我运行以下命令: '/usr/bin/ffmpeg' '-y' '-i' '/myproject/storage/app/sample_media/2020-02-27/Sample Videos 5.mp4' \ '-c:v' 'libx264' '-s:v' '1920x1080' \ '-crf' '20' '-sc_threshold' '0' '-g' '48' '-keyint_min' '48' \ '-hls

今天我发现教我关于碎片化MP4(FMP4)

使用,我取得了很大的进步

我运行以下命令:

'/usr/bin/ffmpeg' '-y' '-i' '/myproject/storage/app/sample_media/2020-02-27/Sample Videos 5.mp4' \
'-c:v' 'libx264' '-s:v' '1920x1080' \
 '-crf' '20' '-sc_threshold' '0' '-g' '48' '-keyint_min' '48' \
'-hls_list_size' '0' '-hls_time' '10' '-hls_allow_cache' '0' '-b:v' '4889k' \
'-maxrate' '5866k' '-hls_segment_type' 'fmp4' \
'-hls_fmp4_init_filename' '/myproject/public/storage/000000002/init.mp4' \
'-hls_segment_filename' '/myproject/public/storage/000000002/list_1080p_%04d.m4s' \
'-hls_key_info_file' '/myproject/hls_hls.keyInfo' '-strict' '-2' '-threads' '12' \
'/myproject/public/storage/000000002/list_1080p.m3u8'
然后我在我的网页上尝试显示视频

最初,它不会加载

但是,如果我在对列表_1080p.m3u8进行编辑后刷新页面,则可以正确加载视频:

更改为:

#EXT-X-MAP:URI=“/myproject/public/storage/000000002/init.mp4”

致:

#EXT-X-MAP:URI=“init.mp4”

如何更改ffmpeg命令,使其知道init.mp4保存位置的绝对路径,但也知道只在m3u8中写入文件名
init.mp4
,而不写入任何路径?

(我尝试过使用
-hls\u fmp4\u init\u filename init.mp4
而不使用ABolute路径,但是它在根目录下创建init.mp4,这也不起作用。我需要每个视频的init.mp4都位于自己的文件夹中。)

我认为可能是问题所在。我认为可能是问题所在。