Estamos desenvolvendo um player embutido que transmite através do protocolo DASH. Uma parada é primeiro converter todas as mídias enviadas pelo usuário para MP4 (h264), o problema é que, quando o ffmpeg gera o manifesto para o DASH (arquivo MPD), ele não inclui o valor de largura de banda para o segmento de vídeo. O áudio vem com a largura de banda.
A ausência da largura de banda para o segmento de vídeo faz com que o player não reproduza o vídeo.
Como posso ter certeza de que o ffmpeg incluirá a largura de banda?
Comandoffmpeg:
segment_cmd = [
'ffmpeg -i {input_file}'
' -c copy',
' -c:v libx264',
' -x264-params "nal-hrd=cbr"',
' -vf scale=-1:{resolution}',
' -b:v 1M',
' -minrate 1M',
' -maxrate 1M',
' -bufsize 2M',
' -use_template 1',
' -init_seg_name init-stream\$RepresentationID\$-$Bandwidth\$.m4s',
' -media_seg_name chunk-stream\$RepresentationID\$-\$Bandwidth\$-\$Number\$.m4s',
' -adaptation_sets "id=0,streams=v id=1,streams=a"',
' -f dash {prep_dir}{resolution}.mpd'
]
o arquivo MPD sem BANDWIDTH
<?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="PT1M30.0S"
minBufferTime="PT4.9S">
<ProgramInformation>
</ProgramInformation>
<Period start="PT0.0S">
<AdaptationSet contentType="video" segmentAlignment="true" bitstreamSwitching="true" frameRate="24000/1001">
<Representation id="0" mimeType="video/mp4" codecs="avc1.64001f" 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="143143" />
<S d="127127" />
<S d="121121" />
<S d="116116" />
<S d="126126" />
<S d="89089" />
<S d="150150" />
<S d="106106" />
<S d="152152" />
<S d="82082" />
<S d="133133" />
<S d="107107" />
<S d="154154" />
<S d="81081" />
<S d="116116" />
<S d="140140" />
<S d="118118" />
<S d="99099" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet contentType="audio" segmentAlignment="true" bitstreamSwitching="true">
<Representation id="1" 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="260096" />
<S d="233472" />
<S d="222208" />
<S d="214016" />
<S d="231424" />
<S d="163840" />
<S d="275456" />
<S d="195584" />
<S d="279552" />
<S d="150528" />
<S d="244736" />
<S d="196608" />
<S d="283648" />
<S d="148480" />
<S d="214016" />
<S d="257024" />
<S d="217088" />
<S d="185344" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
</MPD>