FFmpeg make mpeg2 ts without discontinuity

怎甘沉沦 提交于 2019-12-01 04:30:22

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/10825476/ffmpeg-make-mpeg2-ts-without-discontinuity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!