특정 MPEG-DASH 매니페스트를 생성하는 FFMpeg 명령줄

특정 MPEG-DASH 매니페스트를 생성하는 FFMpeg 명령줄

아래 매니페스트를 생성하기 위해 FFMpeg 명령을 얻으려고 했습니다. 바로 아래에는 제가 만들려고 시도한 FFmpeg 명령이 있지만 실제로 재생되도록 내 자신의 스트림을 해당 시스템에 추가하기 위해 제3자 시스템의 스트림을 복제하려는 것과 동일한 매니페스트 파일이 생성되지 않았습니다. .

"$ffmpeg_path" \
    -i "$input_file" \
    -r 30000/1001 \
    -vf "scale=3840:1080" \
    -c:v libx265 \
    -c:a aac -b:a 128k \
    -ar 48000 \
    -f dash \
    -use_timeline 1 \
    -use_template 1 \
    -init_seg_name "init-stream\$RepresentationID\$.m4s" \
    -media_seg_name "chunk-stream\$RepresentationID\$-\$Number%05d\$.m4s" \
    -seg_duration 3 \
    "$output_file"

위의 코드는 아래와 같이 구성된 매니페스트를 생성합니다.

<?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="PT1M35.1S"
    maxSegmentDuration="PT3.0S"
    minBufferTime="PT16.8S">
    <ProgramInformation>
    </ProgramInformation>
    <ServiceDescription id="0">
    </ServiceDescription>
    <Period id="0" start="PT0.0S">
        <AdaptationSet id="0" contentType="video" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true" frameRate="30000/1001" maxWidth="3840" maxHeight="1080" par="32:9">
            <Representation id="0" mimeType="video/mp4" codecs="hev1" bandwidth="2227590" width="3840" height="1080" sar="1:1">
                <SegmentTemplate timescale="30000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="247247" />
                        <S d="250250" r="9" />
                        <S d="104104" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
        <AdaptationSet id="1" contentType="audio" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true">
            <Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audioSamplingRate="48000">
                <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1" />
                <SegmentTemplate timescale="48000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
                    <SegmentTimeline>
                        <S t="0" d="143360" />
                        <S d="144384" r="29" />
                        <S d="93120" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
    </Period>
</MPD>

문제는 매니페스트가 아래 매니페스트처럼 보이는 스트림을 생성하는 데 필요하다는 것입니다. 아래와 같이 보이지 않거나 작동하지 않으면 이 제3자 시스템에서 올바르게 재생되지 않습니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediaPresentationDuration="PT1M35.7S" minBufferTime="PT5.9S" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd">
    <ProgramInformation />
    <Period id="0" start="PT0.0S">
        <AdaptationSet id="0" contentType="video" segmentAlignment="true" bitstreamSwitching="true">
            <Representation id="0" bandwidth="12000000" width="3840" height="1080" frameRate="30000/1001" mimeType="video/mp4" codecs="hev1">
                <SegmentTemplate media="chunk-stream$RepresentationID$-$Number%05d$.m4s" initialization="init-stream$RepresentationID$.m4s" startNumber="1" timescale="30000">
                    <SegmentTimeline>
                        <S t="0" d="89089" r="31" />
                        <S d="21021" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
        <AdaptationSet id="1" contentType="audio" segmentAlignment="true" bitstreamSwitching="true">
            <Representation id="1" bandwidth="1536000" audioSamplingRate="48000" mimeType="audio/mp4" codecs="mp4a.40.2">
                <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="16" />
                <SegmentTemplate media="chunk-stream$RepresentationID$-$Number%05d$.m4s" initialization="init-stream$RepresentationID$.m4s" startNumber="1" timescale="48000">
                    <SegmentTimeline>
                        <S t="0" d="143360" />
                        <S d="142336" r="2" />
                        <S d="143360" />
                        <S d="142336" r="3" />
                        <S d="143360" />
                        <S d="142336" r="3" />
                        <S d="143360" />
                        <S d="142336" r="3" />
                        <S d="143360" />
                        <S d="142336" r="3" />
                        <S d="143360" />
                        <S d="142336" r="3" />
                        <S d="143360" />
                        <S d="142336" r="1" />
                        <S d="32768" />
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
    </Period>
</MPD>

관련 정보