[英]How do I combine AUDIO group with VIDEO stream and produce a new .ts file using ffmpeg?
Here is the input manifest:这是输入清单:
$ curl 'https://example.net/ipadlive/index_new.m3u8?sessionid=81893121496608402793&ipaddress=x.x.x.x&callsign=YYYY&hubid=51&zipcode='
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,LANGUAGE="en",URI="https://example.net/ipadlive/06_new.m3u8?cdnHost=da148.cdn.iptv.example.net&sessionid=81893121496608402793&ipaddress=x.x.x.x&callsign=CHAN&hubid=51&zipcode=&countycode=null&fta=null&optimumid=null&devicename=&devicetype=0&osver=&res=&fps="
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group",NAME="spa",DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="en",URI="https://example.net/ipadlive/07_new.m3u8?cdnHost=da148.cdn.iptv.example.net&sessionid=81893121496608402793&ipaddress=x.x.x.x&callsign=CHAN&hubid=51&zipcode=&countycode=null&fta=null&optimumid=null&devicename=&devicetype=0&osver=&res=&fps="
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=479776,RESOLUTION=240x180,CODECS="avc1.42c00c,mp4a.40.2",AUDIO="group"
https://example.net/ipadlive/01_new.m3u8?cdnHost=da148.cdn.iptv.example.net&sessionid=81893121496608402793&ipaddress=x.x.x.x&callsign=CHAN&hubid=51&zipcode=&countycode=null&fta=null&optimumid=null&devicename=&devicetype=0&osver=&res=&fps=
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=780576,RESOLUTION=320x240,CODECS="avc1.42c00d,mp4a.40.2",AUDIO="group"
https://example.net/ipadlive/02_new.m3u8?cdnHost=da148.cdn.iptv.example.net&sessionid=81893121496608402793&ipaddress=x.x.x.x&callsign=CHAN&hubid=51&zipcode=&countycode=null&fta=null&optimumid=null&devicename=&devicetype=0&osver=&res=&fps=
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1079872,RESOLUTION=480x360,CODECS="avc1.42c01e,mp4a.40.2",AUDIO="group"
https://example.net/ipadlive/03_new.m3u8?cdnHost=da148.cdn.iptv.example.net&sessionid=81893121496608402793&ipaddress=x.x.x.x&callsign=CHAN&hubid=51&zipcode=&countycode=null&fta=null&optimumid=null&devicename=&devicetype=0&osver=&res=&fps=
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1682976,RESOLUTION=640x480,CODECS="avc1.42c01e,mp4a.40.2",AUDIO="group"
https://example.net/ipadlive/04_new.m3u8?cdnHost=da148.cdn.iptv.example.net&sessionid=81893121496608402793&ipaddress=x.x.x.x&callsign=CHAN&hubid=51&zipcode=&countycode=null&fta=null&optimumid=null&devicename=&devicetype=0&osver=&res=&fps=
I've never seen this before where the audio stream is a separate url than a video stream listed in the manifest.我以前从未见过音频流是一个单独的 url,而不是清单中列出的视频流。
Is there a way I can combine an audio stream and a specific video stream to produce a new stream that has both audio and video in it?有没有一种方法可以将音频流和特定的视频流结合起来,以生成一个包含音频和视频的新流?
I was doing something like this:我正在做这样的事情:
ffmpeg -i <manifest> -c copy test.m3u8
and I don't get any audio. ffmpeg -i <manifest> -c copy test.m3u8
我没有得到任何音频。
I've tried changing <manifest>
to an individual video stream, but then no audio.我尝试将
<manifest>
更改为单个视频流,但没有音频。 If I change it to an AUDIO stream I get no video.如果我将其更改为 AUDIO 流,则没有视频。
I recently had the problem of combining an audio .ts file with its accompanying video .ts file.我最近遇到了将音频.ts 文件与其随附的视频.ts 文件结合起来的问题。 I was able to solve it using the following method for Windows users.
对于 Windows 用户,我能够使用以下方法解决它。 [see - Video resource ]
[见 - 视频资源]
1) You will need to download the ffmpeg library that will allow Windows to combine both files together. 1) 您需要下载ffmpeg 库,该库将允许 Windows 将两个文件组合在一起。 In my case I was running Windows 8 (32 bit OS) and chose a static build:
就我而言,我运行的是 Windows 8(32 位操作系统)并选择了静态构建:
2) I then opened notepad and wrote the following code once ffmpeg was installed: ffmpeg -i VIDEO.ts -i AUDIO.ts -c:v copy -c:a copy OUTPUT.mp4
2)然后我打开记事本并在安装
ffmpeg -i VIDEO.ts -i AUDIO.ts -c:v copy -c:a copy OUTPUT.mp4
编写以下代码: ffmpeg -i VIDEO.ts -i AUDIO.ts -c:v copy -c:a copy OUTPUT.mp4
I saved the notepad file as "joiner.bat"我将记事本文件保存为“joiner.bat”
NB: this bat file must present in the same folder as your separate audio and video ts files in order to combine them!!!注意:此 bat 文件必须与您单独的音频和视频 ts 文件位于同一文件夹中才能将它们组合在一起!!!
3) Once the bat file is in the same folder as your audio and video ts files you can double click on the joiner.bat file to combine the audio and video ts files into a single mp4 (OUTPUT.mp4) file. 3) bat 文件与您的音频和视频 ts 文件位于同一文件夹中后,您可以双击 joiner.bat 文件将音频和视频 ts 文件合并为一个mp4 (OUTPUT.mp4) 文件。
I hope this helps the more novice types among us.我希望这可以帮助我们中更多的新手类型。 Yes I'm still a n00b after many years - don't worry!
是的,多年后我仍然是 n00b - 别担心! ;)
;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.