将MPEG-DASH段(例如,init.mp4 + segment.m4s)合并回完整的source.mp4吗? [英] Combine MPEG-DASH segments (ex, init.mp4 + segments.m4s) back to a full source.mp4?

查看:363
本文介绍了将MPEG-DASH段(例如,init.mp4 + segment.m4s)合并回完整的source.mp4吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GPAC, http://gpac.wp.mines-telecom.fr/,可以与MPEG-DASH规范一起用于视频分割.一种类型的结果是init文件(例如,init.mp4)和几个大致固定时间段(例如,segment-%d.m4s)的组合.如果我刚得到这些结果,并且想将它们反向/组合回一个完整的source.mp4文件,该怎么办?我可以为此使用GPAC或ffmpeg吗?

GPAC, http://gpac.wp.mines-telecom.fr/, can be used to do video segmentation along with MPEG-DASH spec. One type of results is a combination of init files (ex, init.mp4) and several roughly fixed-duration segments (ex, segment-%d.m4s). What if I just got those results and I like to reverse/combine them back to one full source.mp4 file? Can I use GPAC or ffmpeg for this?

推荐答案

您可以只使用 cat 命令或类似工具来完成此工作:

You can just use the cat command or similar tools to do this job:

cat init.mp4 > source.mp4
cat segment-1.m4s >> source.mp4
cat segment-2.m4s >> source.mp4
...

要对当前文件夹中的所有段自动执行此操作,可以使用以下命令:

To do this automatically for all segments in the current folder, the following command can be used:

cat init.mp4 $(ls -vx segment-*.m4s)>source.mp4

ls 的-v参数自然对输出进行排序(即1、2,...,10,...,100),否则按词法进行排序(即1、10、100),2,...).-x参数将输出放在一行而不是列上.

The -v parameter for ls sorts the output naturally (i.e. 1, 2, ..., 10, ..., 100), otherwise it sorts lexically (i.e. 1, 10, 100, 2, ...). The -x parameter puts the output on a line instead of columns.

这篇关于将MPEG-DASH段(例如,init.mp4 + segment.m4s)合并回完整的source.mp4吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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