ffmpeg将m4s转换为mp4

问题描述 投票:1回答:2

我正在研究DASH,试图为最终用户优化QoE。

我有一个视频,并使用ffmpeg将其编码为不同的比特率,并且一切都很好,并且可以使用破折号来播放视频。

我想要的是将从用户接收的段中合并为一个m4,并将该m4s转换为mp4。

我在ffmpeg中尝试了很多方法,但是它总是给我这个错误:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9a9e500] could not find corresponding track id 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9a9e500] could not find corresponding trex
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x9a9e500] error reading header
test2.m4s: Invalid data found when processing input

segment_1.m4s在这里。

我该如何解决此问题?

video ffmpeg mp4 mpeg-dash
2个回答
0
投票
将m4s片段合并为一个文件,确保文件顺序正确。例如:

cat video-0.m4s >> all.m4s cat video-1.m4s >> all.m4s cat video-2.m4s >> all.m4s cat video-3.m4s >> all.m4s cat video-4.m4s >> all.m4s cat video-5.m4s >> all.m4s cat video-6.m4s >> all.m4s cat video-7.m4s >> all.m4s cat video-8.m4s >> all.m4s cat video-9.m4s >> all.m4s cat video-10.m4s >> all.m4s

然后立即进行所有转换。

ffmpeg -i all.m4s -c copy video.mp4

这不是

尝试流方法时遇到相同的问题(could not find corresponding trex)。 

我在all.txt文件中包含了所有想要的文件,其中包含

file 'video-0.m4s' file 'video-1.m4s' file 'video-2.m4s' file 'video-3.m4s' file 'video-4.m4s' file 'video-5.m4s' file 'video-6.m4s' file 'video-7.m4s' file 'video-8.m4s' file 'video-9.m4s' file 'video-10.m4s'

并且我尝试了ffmpeg -f concat -safe 0 -i all.txt -c copy video.mp4,导致了同样的问题。

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fde2d0c520] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fde2d0c520] Auto-inserting h264_mp4toannexb bitstream filter
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fde2d0c520] could not find corresponding track id 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fde2d0c520] could not find corresponding trex
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55fde2d0c520] error reading header
[concat @ 0x55fde2cff900] Impossible to open 'rifle-1.m4s'
[concat @ 0x55fde2cff900] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, concat, from 'all.txt':
[... omitted ...]
all.txt: Input/output error

0
投票
windows:

sort and list the files

(参考:How to sort by file name the same way Windows Explorer does?

 type *init*.mp4 list.txt > Filename.mp4

Linux:

 ls -1v v1*.m4s > list.txt
 cat *init*.mp4 list.txt > Filename.mp4
© www.soinside.com 2019 - 2024. All rights reserved.