FFmpeg使mpeg2 ts不间断 [英] FFmpeg make mpeg2 ts without discontinuity

查看:172
本文介绍了FFmpeg使mpeg2 ts不间断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多MOV文件用iPhone记录,我想将它们转换成mpeg2 TS。我想使用它们进行实时视频流与HTTP Live Streaming协议。



我设置我的iPhone不断发送MOV文件到服务器。每个视频片段长5秒。我想让mpeg2 TS出来,并将他们的网址添加到m3u8播放列表。
我设法做到这一切,但是当我尝试播放流时,VLC播放器只播放播放列表中的前两个文件,并且播放列表中的最后一个文件。
我搜索互联网,我认为这与不连续有关。



有没有办法将多个MOV文件转换成多个mpeg2 TS段而不间断?



或者也许我在做别的事吗?
这是我的ffmpeg命令:

  ffmpeg.exe -i输入,MOV -f mpegts output.ts 

这里是我的m3u8列表:

 #EXTM3U 
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10,
fileSequence0.ts
#EXTINF:10,
fileSequence1.ts
#EXTINF:10,
fileSequence2.ts

提前感谢

解决方案

问题是您的系列电影不是流。当您创建单个mpeg2ts段时,每次运行ffmpeg时,时间戳将重新设置为0。您可以尝试使用
setpts 过滤器来调整每个细分受众群的开始时间戳。但首先,您需要知道上一个细分的最终结果。


I have many MOV files recorded with iPhone and I want to convert them to mpeg2 TS. I want to use them for live video streaming with HTTP Live Streaming protocol.

I set my iPhone to continiously send MOV files to server. Every video clip is 5 seconds long. I want to make mpeg2 TS out of them and add their urls to m3u8 playlist. I managed to do all of that, but when I try to play the stream VLC player plays only first two files in playlist, and last file in playlist at that moment. I searched the internet and I think this has something to do with discontinuity.

Is there any way to convert multiple MOV files into multiple mpeg2 TS segments without discontinuity?

Or maybe I'm doing something else wrong? Here is my ffmpeg command:

ffmpeg.exe -i input,MOV -f mpegts output.ts

and here is my m3u8 list:

#EXTM3U
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:10,
fileSequence0.ts
#EXTINF:10,
fileSequence1.ts
#EXTINF:10,
fileSequence2.ts

Thanks in advance

解决方案

The problem is that your series of movies is not a stream. When you create the individual mpeg2ts segments, the timestamps are re-set to 0 on each run of ffmpeg. You can try using the setpts filter to adjust the starting timestamp of each segment. But first you'll need to know the final pts of the previous segment.

这篇关于FFmpeg使mpeg2 ts不间断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆