gpt4 book ai didi

ffmpeg - dash.js 不播放 MP4Box 生成的 mpd 文件

转载 作者:行者123 更新时间:2023-12-04 23:03:52 25 4
gpt4 key购买 nike

我已经对 mp4 文件的音频进行了转码和剥离,如下所示:

$ ffmpeg -codec:a libvo_aacenc -ar 44100 -ac 1 -codec:v libx264 -profile:v baseline -level 13 -b:v 2000k dir/out.mp4 -i dir/original.mp4

$ ffmpeg -i dir/out.mp4 -an dir/out_an.mp4

我使用以下 MP4Box 命令生成 mpd:

$ MP4Box -dash 30000 -dash-profile on-demand -segment-name out-seg -out dir/out_dash dir/out.mp4

这将产生以下 mpd 文件:

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.5.1-DEV-rev4065 -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H2M11.77S" profiles="urn:mpeg:dash:profile:full:2011">
<ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
<Title>dashtest/output_dash.mpd generated by GPAC</Title>
</ProgramInformation>

<Period id="" duration="PT0H2M11.77S">
<AdaptationSet segmentAlignment="true" maxWidth="640" maxHeight="360" maxFrameRate="30000/1001" par="16:9">
<ContentComponent id="1" contentType="video" lang="und"/>
<ContentComponent id="2" contentType="audio" lang="und"/>
<Representation id="1" mimeType="video/mp4" codecs="avc1.42c00d,mp4a.40.02" width="640" height="360" frameRate="30000/1001" sar="1:1" audioSamplingRate="44100" startWithSAP="0" bandwidth="2097272">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<SegmentList timescale="1000" duration="30046">
<Initialization sourceURL="out-seginit.mp4"/>
<SegmentURL media="out-seg1.m4s"/>
<SegmentURL media="out-seg2.m4s"/>
<SegmentURL media="out-seg3.m4s"/>
<SegmentURL media="out-seg4.m4s"/>
<SegmentURL media="out-seg5.m4s"/>
</SegmentList>
</Representation>
</AdaptationSet>
</Period>
</MPD>

最佳答案

尝试添加参数 -frag 30000,使文件分片到 30 秒。所以整个命令是这样的

$ MP4Box -dash 30000 -frag 30000 -dash-profile on-demand -segment-name out-seg -out dir/out_dash dir/out.mp4

我试过这个命令,我可以在 bitdash 播放器和 MP4Client 中播放 mpd 文件

关于ffmpeg - dash.js 不播放 MP4Box 生成的 mpd 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29241982/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com