I am using the following ffmpeg command to generate my hls playlist with the FFmpeg option -master_pl_name set.
ffmpeg -i becky.mov \
-i becky.mov \
-i becky.mov \
-i becky.mov \
-s:v:0 1920x1080 -c:v:0 libx264 -b:v:0 4000k \
-s:v:1 1280x720 -c:v:1 libx264 -b:v:1 2000k \
-s:v:2 854x480 -c:v:2 libx264 -b:v:2 1000k \
-s:v:3 640x360 -c:v:3 libx264 -b:v:3 600k \
-c:a:0 copy \
-map 0:a -map 0:v -map 1:v -map 2:v -map 3:v \
-var_stream_map "a:0,agroup:audio v:0,agroup:audio v:1,agroup:audio v:2,agroup:audio v:3,agroup:audio" \
-threads 0 -f hls -movflags frag_keyframe -hls_flags single_file+independent_segments \
-hls_segment_type fmp4 -hls_list_size 0 -hls_time 10 -hls_allow_cache 1 \
-master_pl_name master.m3u8 -y burnt/demo2/list_%v/master.m3u8
This is fine and will give me a master.m3u8 file that looks like this.
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=1047200,RESOLUTION=640x272,CODECS="avc1.4d4815,mp4a.40.2"
pl_0.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1788600,RESOLUTION=842x358,CODECS="avc1.4d481e,mp4a.40.2"
pl_1.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3436400,RESOLUTION=1280x544,CODECS="avc1.4d481f,mp4a.40.2"
pl_2.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=6096200,RESOLUTION=1920x816,CODECS="avc1.4d4828,mp4a.40.2"
pl_3.m3u8
The problem that I have is I need to generate my master.m3u8 file manually as I am also generating subtitles and audio description groups. I am using ffprobe to do this.
But I am not sure how to get the CODECS="avc1.4d4815,mp4a.40.2" value to then insert it into my master.m3u8 file.
My ffprobe output doesn't seem to give any of that information here is the full output.
{
"streams": [{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "Main",
"codec_type": "video",
"codec_time_base": "1001/48000",
"codec_tag_string": "[27][0][0][0]",
"codec_tag": "0x001b",
"width": 640,
"height": 272,
"coded_width": 640,
"coded_height": 272,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 21,
"chroma_location": "left",
"refs": 1,
"is_avc": "false",
"nal_length_size": "0",
"r_frame_rate": "24000/1001",
"avg_frame_rate": "24000/1001",
"time_base": "1/90000",
"start_pts": 7508,
"start_time": "0.083422",
"bits_per_raw_sample": "8",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"variant_bitrate": "800000"
}
},
{
"index": 1,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_time_base": "1/48000",
"codec_tag_string": "[15][0][0][0]",
"codec_tag": "0x000f",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/90000",
"start_pts": 5588,
"start_time": "0.062089",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"variant_bitrate": "800000"
}
},
{
"index": 2,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "Main",
"codec_type": "video",
"codec_time_base": "1001/48000",
"codec_tag_string": "[27][0][0][0]",
"codec_tag": "0x001b",
"width": 842,
"height": 358,
"coded_width": 848,
"coded_height": 368,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 30,
"chroma_location": "left",
"refs": 1,
"is_avc": "false",
"nal_length_size": "0",
"r_frame_rate": "24000/1001",
"avg_frame_rate": "24000/1001",
"time_base": "1/90000",
"start_pts": 7508,
"start_time": "0.083422",
"bits_per_raw_sample": "8",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"variant_bitrate": "1400000"
}
},
{
"index": 3,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_time_base": "1/48000",
"codec_tag_string": "[15][0][0][0]",
"codec_tag": "0x000f",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/90000",
"start_pts": 5588,
"start_time": "0.062089",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"variant_bitrate": "1400000"
}
},
{
"index": 4,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "Main",
"codec_type": "video",
"codec_time_base": "1001/48000",
"codec_tag_string": "[27][0][0][0]",
"codec_tag": "0x001b",
"width": 1280,
"height": 544,
"coded_width": 1280,
"coded_height": 544,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 31,
"chroma_location": "left",
"refs": 1,
"is_avc": "false",
"nal_length_size": "0",
"r_frame_rate": "24000/1001",
"avg_frame_rate": "24000/1001",
"time_base": "1/90000",
"start_pts": 7508,
"start_time": "0.083422",
"bits_per_raw_sample": "8",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"variant_bitrate": "2800000"
}
},
{
"index": 5,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_time_base": "1/48000",
"codec_tag_string": "[15][0][0][0]",
"codec_tag": "0x000f",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/90000",
"start_pts": 5588,
"start_time": "0.062089",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"variant_bitrate": "2800000"
}
},
{
"index": 6,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "Main",
"codec_type": "video",
"codec_time_base": "1001/48000",
"codec_tag_string": "[27][0][0][0]",
"codec_tag": "0x001b",
"width": 1920,
"height": 816,
"coded_width": 1920,
"coded_height": 816,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 40,
"chroma_location": "left",
"refs": 1,
"is_avc": "false",
"nal_length_size": "0",
"r_frame_rate": "24000/1001",
"avg_frame_rate": "24000/1001",
"time_base": "1/90000",
"start_pts": 7508,
"start_time": "0.083422",
"bits_per_raw_sample": "8",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"variant_bitrate": "5000000"
}
},
{
"index": 7,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_time_base": "1/48000",
"codec_tag_string": "[15][0][0][0]",
"codec_tag": "0x000f",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/90000",
"start_pts": 5588,
"start_time": "0.062089",
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0
},
"tags": {
"variant_bitrate": "5000000"
}
}
],
"format": {
"filename": "master.m3u8",
"nb_streams": 8,
"nb_programs": 4,
"format_name": "hls",
"format_long_name": "Apple HTTP Live Streaming",
"start_time": "0.062089",
"duration": "169.180238",
"size": "575",
"bit_rate": "27",
"probe_score": 100
}
}
Can someone point me in the right direction?
Thanks