I want to play DASH (Video:h264 Audio:G711A) using ijkplayer, how should I modify module.sh - android-ffmpeg

export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-openssl"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-muxer=dash"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-libxml2"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-muxer=webm_dash_manifest"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-muxer=webm_chunk"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-demuxer=dash"
# export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-demuxer=webm_chunk"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=pcm_alaw"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=pcm_ulaw"
export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-decoder=pcm_mulaw"
I added these configurations at the bottom of module-lite.sh, but when playing DASH, there is only picture and no sound, what should I do?
<?xml version='1.0' encoding='UTF-8'?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:kvs="urn:aws:kinesisvideo:mpd:2019" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" availabilityStartTime="2022-03-07T08:40:35.487Z" publishTime="2022-03-07T09:29:53.333Z" minimumUpdatePeriod="PT0S" minBufferTime="PT1S">
<Period id="0" start="PT0S">
<AdaptationSet segmentAlignment="true" mimeType="video/mp4" startWithSAP="1">
<SegmentTemplate media="getMP4MediaFragment.mp4?SessionToken=CiDLaOcbvlTANnKweknURWqNerYZHdM8qhnYc4s1-7a0UxIQgKyfV133cJXSDr_tIeCaZBoZYZ7gJ7n28gohHFDYI34RtXcInz4y074pTiIgNfcSVAcUr82F2u1SeRZrrHp6YrSMPCuhQESx6HTKi60~&SequenceNumber=$Number$&TrackNumber=1" initialization="getMP4InitFragment.mp4?SessionToken=CiDLaOcbvlTANnKweknURWqNerYZHdM8qhnYc4s1-7a0UxIQgKyfV133cJXSDr_tIeCaZBoZYZ7gJ7n28gohHFDYI34RtXcInz4y074pTiIgNfcSVAcUr82F2u1SeRZrrHp6YrSMPCuhQESx6HTKi60~&TrackNumber=1" timescale="1000" startNumber="0">
<SegmentTimeline>
<S t="0" d="1648" kvs:fn="91343852333181734450051648276712447066637958917"/>
<S d="1567" kvs:fn="91343852333181734455003408433853968294145105934"/>
<S d="1765" kvs:fn="91343852333181734459955168590995489676641680882"/>
<S d="2096" kvs:fn="91343852333181734464906928748137011242654335051"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="video" bandwidth="574859" width="1280" height="720" frameRate="30.34" codecs="avc1.4d0033" scanType="progressive"/>
</AdaptationSet>
</Period>
</MPD>
Does this DASH stream contain sound? I don't see any audio related elements here

Related

Issues with using FFmpeg to generate MPEG-DASH files

I am using the following ffmpeg command to generate MPEG DASH files and manifest. I use single_file 1 to have a single file for each representation; so no chunking. But IDK why when I want to play the manifest using ExoPlayer, the video doesn't play from the beginning (rather it starts from around 50s).
ffmpeg -re -i .\video-h264.mkv -map 0 -map 0 -c:a aac -c:v libx264 -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -single_file 1 -use_template 1 -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" -f dash out.mpd
What is wrong with this? Is the manifest correct? Here is the generated 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="PT1M20.1S"
maxSegmentDuration="PT5.0S"
minBufferTime="PT16.0S">
<ProgramInformation>
</ProgramInformation>
<ServiceDescription id="0">
</ServiceDescription>
<Period id="0" start="PT48.0S">
<AdaptationSet id="0" contentType="video" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true" frameRate="30/1" maxWidth="960" maxHeight="540" par="517072:290799" lang="eng">
<Representation id="0" mimeType="video/mp4" codecs="avc1.4d401f" bandwidth="800000" width="960" height="540" sar="32317:32311">
<BaseURL>out-stream0.mp4</BaseURL>
<SegmentList timescale="1000000" duration="5000000" startNumber="7">
<Initialization range="0-832" />
<SegmentURL mediaRange="4800141-5599188" indexRange="4800141-4800192" />
<SegmentURL mediaRange="5599189-6243069" indexRange="5599189-5599240" />
<SegmentURL mediaRange="6243070-7224302" indexRange="6243070-6243121" />
<SegmentURL mediaRange="7224303-8138118" indexRange="7224303-7224354" />
<SegmentURL mediaRange="8138119-8232111" indexRange="8138119-8138170" />
</SegmentList>
</Representation>
<Representation id="2" mimeType="video/mp4" codecs="avc1.42c00d" bandwidth="300000" width="320" height="170" sar="549389:581598">
<BaseURL>out-stream2.mp4</BaseURL>
<SegmentList timescale="1000000" duration="5000000" startNumber="7">
<Initialization range="0-832" />
<SegmentURL mediaRange="1782920-2005667" indexRange="1782920-1782971" />
<SegmentURL mediaRange="2005668-2229412" indexRange="2005668-2005719" />
<SegmentURL mediaRange="2229413-2615209" indexRange="2229413-2229464" />
<SegmentURL mediaRange="2615210-2975346" indexRange="2615210-2615261" />
<SegmentURL mediaRange="2975347-2999288" indexRange="2975347-2975398" />
</SegmentList>
</Representation>
</AdaptationSet>
<AdaptationSet id="1" contentType="audio" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true" lang="eng">
<Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="69000" audioSamplingRate="44100">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1" />
<BaseURL>out-stream1.mp4</BaseURL>
<SegmentList timescale="1000000" duration="5000000" startNumber="12">
<Initialization range="0-764" />
<SegmentURL mediaRange="491493-536039" indexRange="491493-491544" />
<SegmentURL mediaRange="536040-580657" indexRange="536040-536091" />
<SegmentURL mediaRange="580658-625158" indexRange="580658-580709" />
<SegmentURL mediaRange="625159-669825" indexRange="625159-625210" />
<SegmentURL mediaRange="669826-713289" indexRange="669826-669877" />
</SegmentList>
</Representation>
<Representation id="3" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="69000" audioSamplingRate="22050">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1" />
<BaseURL>out-stream3.mp4</BaseURL>
<SegmentList timescale="1000000" duration="5000000" startNumber="12">
<Initialization range="0-764" />
<SegmentURL mediaRange="486188-530059" indexRange="486188-486239" />
<SegmentURL mediaRange="530060-574175" indexRange="530060-530111" />
<SegmentURL mediaRange="574176-618922" indexRange="574176-574227" />
<SegmentURL mediaRange="618923-663118" indexRange="618923-618974" />
<SegmentURL mediaRange="663119-706121" indexRange="663119-663170" />
</SegmentList>
</Representation>
</AdaptationSet>
</Period>
</MPD>
you need to remove
-window_size 5
it keeps only 5 segments of video in mpd
https://ffmpeg.org/ffmpeg-formats.html#dash-2

Issues with playing MPEG-DASH MPD file

I have built a simple mpeg-dash player using exoplayer API in Android. It reads and plays this MPD file. But can't play the following MPD file generated by FFmpeg:
ffmpeg -re -i .\video-h264.mkv -map 0 -map 0 -c:a aac -c:v libx264 -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" -f dash out.mpd
What is the issue? I can't understand it.
<?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="PT16.0S"
maxSegmentDuration="PT5.0S"
minBufferTime="PT10.0S">
<ProgramInformation>
</ProgramInformation>
<ServiceDescription id="0">
</ServiceDescription>
<Period id="0" start="PT0.0S">
<AdaptationSet id="0" contentType="video" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true" frameRate="24/1" maxWidth="1920" maxHeight="960" par="2:1">
<Representation id="0" mimeType="video/mp4" codecs="avc1.4d4028" bandwidth="800000" width="1920" height="960" sar="1:1">
<SegmentTemplate timescale="12288" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
<SegmentTimeline>
<S t="0" d="61440" r="2" />
<S d="13312" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation id="2" mimeType="video/mp4" codecs="avc1.42c00d" bandwidth="300000" width="320" height="170" sar="17:16">
<SegmentTemplate timescale="12288" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
<SegmentTimeline>
<S t="0" d="61440" r="2" />
<S d="13312" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
<AdaptationSet id="1" contentType="audio" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true" lang="eng">
<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="2" />
<SegmentTemplate timescale="48000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
<SegmentTimeline>
<S t="0" d="238584" />
<S d="239616" />
<S d="240640" />
<S d="50176" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
<Representation id="3" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audioSamplingRate="22050">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2" />
<SegmentTemplate timescale="22050" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
<SegmentTimeline>
<S t="0" d="109564" />
<S d="110592" r="1" />
<S d="22519" />
</SegmentTimeline>
</SegmentTemplate>
</Representation>
</AdaptationSet>
</Period>
</MPD>
My simple ExoPlayer API code is HERE. And my MPD is located on a local server. The error I get is this:
2022-01-20 11:49:13.751 11201-11929/com.example.myexoplayer E/ExoPlayerImplInternal: Source error.
com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to http://192.168.80.80/dash/out.mpd
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:194)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:102)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.open(DataSourceInputStream.java:65)
at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:114)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:295)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.io.IOException: Cleartext HTTP traffic to 192.168.80.80 not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:429)
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:350)
at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:192)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:102) 
at com.google.android.exoplayer2.upstream.DataSourceInputStream.open(DataSourceInputStream.java:65) 
at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:114) 
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:295) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:923) 

MPD MPEG-DASH - Shows only one bitrate

Help. I wont show bitrate.
player.getBitrateInfoListFor("video");
Shows only one bitrate - 454948
manifest.mpd generated by GPAC
<Period duration="PT0H21M48.338S">
<AdaptationSet segmentAlignment="true" group="1" maxWidth="270" maxHeight="480" maxFrameRate="2070000/93437" par="270:480" lang="und">
<Representation id="1" mimeType="video/mp4" codecs="avc3.640015" width="270" height="480" frameRate="2070000/93437" sar="1:1" startWithSAP="1" bandwidth="454948">
<SegmentTemplate media="480_bbb/segment__track1_$Number$.m4s" timescale="2070000" startNumber="1" duration="8280000" initialization="480_bbb/segment__track1_init.mp4"/>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="202" maxHeight="360" maxFrameRate="2070000/93437" par="202:360" lang="und">
<Representation id="2" mimeType="video/mp4" codecs="avc3.64000D" width="202" height="360" frameRate="2070000/93437" sar="1:1" startWithSAP="1" bandwidth="281508">
<SegmentTemplate media="360_bbb/segment__track1_$Number$.m4s" timescale="2070000" startNumber="1" duration="8280000" initialization="360_bbb/segment__track1_init.mp4"/>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="134" maxHeight="240" maxFrameRate="2070000/93437" par="134:240" lang="und">
<Representation id="3" mimeType="video/mp4" codecs="avc3.64000B" width="134" height="240" frameRate="2070000/93437" sar="1:1" startWithSAP="1" bandwidth="182832">
<SegmentTemplate media="240_bbb/segment__track1_$Number$.m4s" timescale="2070000" startNumber="1" duration="8280000" initialization="240_bbb/segment__track1_init.mp4"/>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" group="1" maxWidth="80" maxHeight="144" maxFrameRate="2070000/93437" par="80:144" lang="und">
<Representation id="4" mimeType="video/mp4" codecs="avc3.640009" width="80" height="144" frameRate="2070000/93437" sar="1:1" startWithSAP="1" bandwidth="99667">
<SegmentTemplate media="144_bbb/segment__track1_$Number$.m4s" timescale="2070000" startNumber="1" duration="8280000" initialization="144_bbb/segment__track1_init.mp4"/>
</Representation>
</AdaptationSet>
<AdaptationSet segmentAlignment="true" lang="und">
<Representation id="5" mimeType="audio/mp4" codecs="mp4a.40.2" startWithSAP="1" bandwidth="66056">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"/>
<SegmentTemplate media="audio_bbb/segment__track2_$Number$.m4s" timescale="48000" startNumber="1" duration="192000" initialization="audio_bbb/segment__track2_init.mp4"/>
</Representation>
</AdaptationSet>
</Period>
</MPD>
player.getBitrateInfoListFor("video");
Shows only one bitrate - 454948
Assuming the video Representations are interchangeable versions of the same content, they should all be within a single AdaptationSet so the client knows it may switch between them dynamically.
As you currently have it, the client will select the most appropriate AdaptationSet at start up (probably the first since there are no other indicators) and correctly determines there is only one bitrate available.
Your MPD file shows that all videos are in separate adaptation set.
Problem is in the command you use to segment videos in MP4Box. You have to set "profile" parameter while segmenting videos using MP4Box.
-profile NAME specifies the target DASH profile: onDemand, live, main, simple, full, and two profiles from the DASH-IF: dashavc264:live, dashavc264:onDemand. This will set default option values to ensure conformance to the desired profile.
MP4Box command to segment videos with onDemand profile:
MP4Box -dash 4000 -frag 4000 -rap -profile onDemand -segment-name %s/segment_ -url-template -out manifest.mpd video144.mp4#video video240.mp4#video video360.mp4#video video480.mp4#video audio.mp4#audio
Source: GPAC's DASH support in MP4Box

JavaFX Scene Builder, multiple ImageViews with the same image

I have placed a few image views to the scene, all pointing to the same image with different
viewports.
generated fxml:
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<ImageView fitHeight="150.0" fitWidth="200.0" layoutX="80.0" layoutY="91.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="#../../../../../Pictures/sas.png" />
</image>
<viewport>
<Rectangle2D height="50.0" minY="50.0" width="50.0" />
</viewport>
</ImageView>
<ImageView fitHeight="150.0" fitWidth="200.0" layoutX="308.0" layoutY="91.0" pickOnBounds="true" preserveRatio="true">
<viewport>
<Rectangle2D height="50.0" minX="50.0" minY="50.0" width="50.0" />
</viewport>
<image>
<Image url="#../../../../../Pictures/sas.png" />
</image>
</ImageView>
<ImageView layoutX="225.0" layoutY="250.0">
<image>
<Image url="#../../../../../Pictures/sas.png" />
</image>
</ImageView>
</children>
Question is, will this create 3 instances of the same image in memory?
If yes, then what is the best ways to avoid it, url("") in style attribute, css class? I would like to avoid creating css class for each individual icon!
Is it even worth using single large croped image for multiple icons & UI elements instead of small image for each at this day & age?
A quick test shows that the ImageViews do not reference the same Image in memory.
To do so, you can either used css as you described, or you can define the Image once in the FXML with an <fx:define> block and reference it via its fx:id attribute:
<fx:define>
<Image url="#../../../../../Pictures/sas.png" fx:id="sasImage" />
</fx:define>
<ImageView image="$sasImage" fitHeight="150.0" fitWidth="200.0" layoutX="80.0" layoutY="91.0" pickOnBounds="true" preserveRatio="true">
<viewport>
<Rectangle2D height="50.0" minY="50.0" width="50.0" />
</viewport>
</ImageView>
<ImageView image="$sasImage" fitHeight="150.0" fitWidth="200.0" layoutX="308.0" layoutY="91.0" pickOnBounds="true" preserveRatio="true">
<viewport>
<Rectangle2D height="50.0" minX="50.0" minY="50.0" width="50.0" />
</viewport>
</ImageView>
<ImageView image="$sasImage" layoutX="225.0" layoutY="250.0">
</ImageView>

Netbeans separted TopComponent in editor mode ignores minimum size

In my Netbeans 7.11 application I have an additional separated topcomponent in an editor mode that does not respect the minimum size that I specified using the GUI-builder.
The option for "Respect Minimum Size When Resizing Windows" in the Window System tab of the branding is checked.
My .wsmode file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mode PUBLIC
"-//NetBeans//DTD Mode Properties 2.0//EN"
"http://www.netbeans.org/dtds/mode-properties2_0.dtd">
<mode version="2.0">
<name unique="myTopComponent" />
<kind type="view" />
<state type="separated" />
<constraints>
<path orientation="horizontal" number="0" weight="1" />
<path orientation="vertical" number="0" weight="1" />
</constraints>
<bounds x="150" y="150" width="1200" height="670" />
<frame state="0"/>
<empty-behavior permanent="true" />
</mode>
What am I doing wrong or what am I missing?

Resources