ffmpeg破折号编码:vp9编解码器的比特率始终为200k

ffmpeg破折号编码:vp9编解码器的比特率始终为200k,ffmpeg,mpeg-dash,vp9,Ffmpeg,Mpeg Dash,Vp9,我正在使用以下命令(前面的put):生成短划线文件: ffmpeg -y -nostdin -loglevel error -i "$1" \ -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:a\?:0 \ -maxrate:v:0 350k -bufsize:v:0 700k -c:v:0 libx264 -filter:v:0 "scale=320:-2

我正在使用以下命令(前面的put):生成短划线文件:

ffmpeg -y -nostdin -loglevel error -i "$1" \
        -map 0:v:0  -map 0:v:0 -map 0:v:0  -map 0:v:0  -map 0:v:0  -map 0:v:0 -map 0:a\?:0  \
        -maxrate:v:0 350k -bufsize:v:0 700k -c:v:0 libx264 -filter:v:0 "scale=320:-2"  \
        -maxrate:v:1 1000k -bufsize:v:1 2000k -c:v:1 libx264 -filter:v:1 "scale=640:-2"  \
        -maxrate:v:2 3000k -bufsize:v:2 6000k -c:v:2 libx264 -filter:v:2 "scale=1280:-2" \
        -maxrate:v:3 300k -minrate:v:3 100k -bufsize:v:3 600k -c:v:3 libvpx-vp9 -filter:v:3 "scale=320:-2"  \
        -maxrate:v:4 1088k -minrate:v:4 200k -bufsize:v:4 2176k -c:v:4 libvpx-vp9 -filter:v:4 "scale=640:-2"  \
        -maxrate:v:5 1500k -minrate:v:5 300k -bufsize:v:5 3000k -c:v:5 libvpx-vp9 -filter:v:5 "scale=1280:-2"  \
        -use_timeline 1  -use_template 1 -adaptation_sets "id=0,streams=0,1,2 id=1,streams=3,4,5 id=2,streams=a" \
        -threads 8 -crf 3 -seg_duration 5 -hls_init_time 1 -hls_time 5 -hls_playlist true -f dash "$2"
问题是,在输出中,我总是得到带宽为200K的VP9编解码器(见下面的输出),而对于相同的视频带宽,H264编解码器随PAR分辨率而变化,并且相当少,我预计VP9甚至更小,因为它压缩更多。我已经使用了多种不同的选项进行了测试,如:
-b:v
-deadline
-cpu-used
-crf,但这些选项的值不同,我缺少什么

样本输出
mpd
文件:

<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="urn:mpeg:dash:schema:mpd:2011"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
    profiles="urn:mpeg:dash:profile:isoff-live:2011"
    type="static"
    mediaPresentationDuration="PT25.4S"
    minBufferTime="PT15.0S">
    <ProgramInformation>
    </ProgramInformation>
    <Period id="0" start="PT0.0S">
        <AdaptationSet id="0" contentType="video" segmentAlignment="true" bitstreamSwitching="true" lang="und">
            <Representation id="0" mimeType="video/mp4" codecs="avc1.64000c" bandwidth="104972" width="320" height="180" frameRate="24000/1001">
                <SegmentTemplate timescale="24000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="130130" />
                        <S d="250250" />
                        <S d="176176" />
                        <S d="54054" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
            <Representation id="1" mimeType="video/mp4" codecs="avc1.64001e" bandwidth="227233" width="640" height="360" frameRate="24000/1001">
                <SegmentTemplate timescale="24000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="130130" />
                        <S d="250250" />
                        <S d="180180" />
                        <S d="50050" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
            <Representation id="2" mimeType="video/mp4" codecs="avc1.64001f" bandwidth="616878" width="1280" height="720" frameRate="24000/1001">
                <SegmentTemplate timescale="24000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="130130" />
                        <S d="250250" />
                        <S d="180180" />
                        <S d="50050" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
        <AdaptationSet id="1" contentType="video" segmentAlignment="true" bitstreamSwitching="true" lang="und">
            <Representation id="3" mimeType="video/mp4" codecs="vp09.00.11.08" bandwidth="200000" width="320" height="180" frameRate="24000/1001">
                <SegmentTemplate timescale="24000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="128128" r="3" />
                        <S d="98098" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
            <Representation id="4" mimeType="video/mp4" codecs="vp09.00.21.08" bandwidth="200000" width="640" height="360" frameRate="24000/1001">
                <SegmentTemplate timescale="24000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="128128" r="3" />
                        <S d="98098" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
            <Representation id="5" mimeType="video/mp4" codecs="vp09.00.31.08" bandwidth="200000" width="1280" height="720" frameRate="24000/1001">
                <SegmentTemplate timescale="24000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="128128" r="3" />
                        <S d="98098" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
        <AdaptationSet id="2" contentType="audio" segmentAlignment="true" bitstreamSwitching="true" lang="eng">
            <Representation id="6" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audioSamplingRate="44100">
                <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
                <SegmentTemplate timescale="44100" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="235520" r="3" />
                        <S d="180224" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
    </Period>
</MPD>

,但我试过的所有30秒视频都是一样的。

从中得到帮助,似乎我必须使用编码或编码

当我使用编码时,我删除了
bufSize
minRate
等,并将
-b:v
设置为零,我能够生成不默认为200k的可变比特率,下面的示例命令,我也将使用编码进行测试

ffmpeg -y -nostdin -loglevel error -i "$1" \
        -map 0:v:0  -map 0:v:0 -map 0:v:0  -map 0:v:0  -map 0:v:0  -map 0:v:0 -map 0:a\?:0  \
        -maxrate:v:0 350k -bufsize:v:0 700k -c:v:0 libx264 -filter:v:0 "scale=320:-2"  \
        -maxrate:v:1 1000k -bufsize:v:1 2000k -c:v:1 libx264 -filter:v:1 "scale=640:-2"  \
        -maxrate:v:2 3000k -bufsize:v:2 6000k -c:v:2 libx264 -filter:v:2 "scale=1280:-2" \
        -b:v:3 0 -c:v:3 libvpx-vp9 -filter:v:3 "scale=320:-2"  \
         -b:v:4 0 -c:v:4 libvpx-vp9 -filter:v:4 "scale=640:-2"  \
         -b:v:5 0 -c:v:5 libvpx-vp9 -filter:v:5 "scale=1280:-2"  \
        -use_timeline 1  -use_template 1 -adaptation_sets "id=0,streams=0,1,2 id=1,streams=3,4,5 id=2,streams=a" \
        -threads 32 -deadline best -cpu-used 1 -crf 3 -seg_duration 5 -hls_init_time 1 -hls_time 5 -hls_playlist true -f dash "$2"