Convert mp4 file to ts file (slice)

The tool used is ffmpeg:

ffmpeg official website: http://ffmpeg.org/download.html
ffmpeg download address: https://ffmpeg.zeranoe.com/builds/

After downloading, configure the bin directory to the environment variable. You can use the relevant commands.

先用ffmpeg把abc.mp4文件转换为abc.ts文件:

ffmpeg -y -i abc.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb abc.ts



再用ffmpeg把abc.ts文件切片并生成playlist.m3u8文件,5秒一个切片:

ffmpeg -i abc.ts -c copy -map 0 -f segment -segment_list playlist.m3u8 -segment_time 5 abc%03d.ts

Post: https://www.cnblogs.com/xiezhidong/p/6924775.html

The command to convert to ts:
https://blog.csdn.net/yygydok/article/details/80051262

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325127790&siteId=291194637