Project

General

Profile

Who can help me with subtitles

Added by jiang wei over 3 years ago

What is the reason for the disappearance of subtitles in this m3u8 format stream after ffmpeg encoding

pipe:///usr/bin/ffmpeg -i "https://liveorigin01.hbogoasia.com:8443/origin/live/MSIA/index.m3u8" -vcodec copy -acodec copy -map 0 -c copy -f mpegts pipe:1

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audiod",NAME="audio_eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",LANGUAGE="eng",URI="5.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audiod",NAME="audio_mal",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2",LANGUAGE="mal",URI="6.m3u8"
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audiod",NAME="audio_chi",DEFAULT=NO,AUTOSELECT=YES,CHANNELS="2",LANGUAGE="chi",URI="7.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="eng",DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="eng",URI="8.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="man",DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="man",URI="9.m3u8"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="mal",DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="mal",URI="10.m3u8"
#EXT-X-STREAM-INF:BANDWIDTH=687256,AVERAGE-BANDWIDTH=687256,CODECS="avc1.640015,mp4a.40.2",PROGRAM-ID=1,RESOLUTION=480x270,AUDIO="audiod",SUBTITLES="subs"
1.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1147048,AVERAGE-BANDWIDTH=1147048,CODECS="avc1.64001e,mp4a.40.2",PROGRAM-ID=1,RESOLUTION=640x360,AUDIO="audiod",SUBTITLES="subs"
2.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1964424,AVERAGE-BANDWIDTH=1964424,CODECS="avc1.64001f,mp4a.40.2",PROGRAM-ID=1,RESOLUTION=960x540,AUDIO="audiod",SUBTITLES="subs"
3.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3803560,AVERAGE-BANDWIDTH=3803560,CODECS="avc1.640028,mp4a.40.2",PROGRAM-ID=1,RESOLUTION=1920x1080,AUDIO="audiod",SUBTITLES="subs"
4.m3u8


Replies (5)

RE: Who can help me with subtitles - Added by saen acro over 3 years ago

Copy also subtitles streams

RE: Who can help me with subtitles - Added by jiang wei over 3 years ago

How to copy subtitles streams

RE: Who can help me with subtitles - Added by Hiro Protagonist over 3 years ago

If you use ffprobe with the stream URL you will be able to see the streams provided, e.g.

Stream #0:2(chi): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Stream #0:6: Video: h264 ([27][0][0][0] / 0x001B), none, 90k tbr, 90k tbn, 1

The number:number after the # identifies the stream. You can use the -map parameter with ffmpeg to
select the streams you want.

When I tried the url you posted, there were no subtitle streams.

RE: Who can help me with subtitles - Added by saen acro over 3 years ago

ffmpeg -i "input" -map 0:a? -map 0:s? -map 0:v -c:v copy -c:a copy -c:s copy "output" 
    (1-5/5)