Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghidmx: can't generate segments when multiple representation in the index #2840

Closed
romainapivideo opened this issue May 16, 2024 · 3 comments

Comments

@romainapivideo
Copy link

Hello !
I play a bit with the new interesting ghidmx filter, and i can't get it to generate segment on the 2nd representation in the index.

Here is what i am doing:

1 - Generate the index from 2 fmp4 files

gpac -i /videos/video_1080p.mp4 -i /videos/audio_128k.mp4 -o /videos/result/index.ghi:segdur=4

It generate the following index:

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.5-DEV-rev66-ge60a64160-master at 2024-05-16T12:07:38.302Z -->
<GHIX xmlns="urn:gpac:dash:index:2023" segmentDuration="PT0H0M4.000S" template="$RepresentationID$-$Number$$Init=init$" maxSegmentDuration="PT0H0M4.011S" mediaPresentationDuration="PT0H0M30.166S">
 <Period duration="PT0H0M30.166S">
  <AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="30" par="16:9" startWithSAP="1">
   <Representation id="1" mimeType="video/mp4" codecs="avc1.640028" width="1920" height="1080" frameRate="30" sar="1:1" bandwidth="2994647" src="/videos/video_1080p.mp4" trackID="1">
    <SegmentList timescale="15360" sampleDuration="512" srcTimescale="15360">
     <I t="0" n="1" d="61440"/>
     <I t="61440" n="121" d="61440"/>
     <I t="122880" n="241" d="61440"/>
     <I t="184320" n="361" d="61440"/>
     <I t="245760" n="481" d="61440"/>
     <I t="307200" n="601" d="61440"/>
     <I t="368640" n="721" d="61440"/>
     <I t="430080" n="841" d="33280"/>
    </SegmentList>
    <prop type="MIMEType" value="video/mp4" />
    <prop type="ClockID" value="1" />
    <prop type="StreamType" value="Visual" />
    <prop type="Timescale" value="15360" />
    <prop type="HasSync" value="true" />
    <prop type="Duration" value="463360/15360" />
    <prop type="NumFrames" value="905" />
    <prop type="FPS" value="15360/512" />
    <prop type="StreamSubtype" value="vide" />
    <prop type="IsoAltBrands" value="iso6,cmfc,mp41" />
    <prop type="IsoBrand" value="iso6" />
    <prop type="MaxCTSOffset" value="1536" />
    <prop type="TrackTemplate" value="AAAA/3RyYWsAAABcdGtoZAAAAAMAAAAA4munigAAAAEAAAAAAAB11gAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAHgAAABDgAAAAAAJttZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAADwAAAcSAFXEAAAAAAA3aGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAEdQQUMgSVNPIFZpZGVvIEhhbmRsZXIAAAAAPG1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAAAhkaW5mAAAAGHN0YmwAAAAQc3RzZAAAAAAAAAAA" />
    <prop type="TrexTemplate" value="AAAAIHRyZXgAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAA=" />
    <prop type="MovieTime" value="30166/1000" />
    <prop type="Width" value="1920" />
    <prop type="Height" value="1080" />
    <prop type="TransX" value="0" />
    <prop type="TransY" value="0" />
    <prop type="ZOrder" value="0" />
    <prop name="title" ptype="str" value="Big Buck Bunny, Sunflower version" />
    <prop name="artist" ptype="str" value="Blender Foundation 2008, Janus Bager Kristensen 2013" />
    <prop name="writer" ptype="str" value="Sacha Goedegebure" />
    <prop name="comment" ptype="str" value="Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net" />
    <prop name="genre" ptype="str" value="Animation" />
    <prop type="HandlerName" value="GPAC ISO Video Handler" />
    <prop type="TrackFlags" value="3" />
    <prop type="TrackMatrix" value="65536,0,0,0,65536,0,0,0,1073741824" />
    <prop name="isom:creation_date" ptype="luint" value="0" />
    <prop name="isom:modification_date" ptype="luint" value="0" />
    <prop type="CodecID" value="MPEG-4 AVC|H264 Video" />
    <prop type="DecoderConfig" value="AWQAKP/hABtnZAAorNlAeAIn5cBEAAADAAQAAAMA8DxgxlgBAAZo6+LLIsD9+PgA" />
    <prop type="DecoderConfigIndex" value="1" />
    <prop type="Bitrate" value="2994647" />
    <prop type="ISOMSubtype" value="avc1" />
    <prop type="STSDTemplate" value="AAAAnmF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAHgAQ4AEgAAABIAAAAAAAAAAEVTGF2YzYwLjMxLjEwMiBsaWJ4MjY0AAAAAAAAAAAAAAAY//8AAAA4YXZjQwFkACj/4QAbZ2QAKKzZQHgCJ+XARAAAAwAEAAADAPA8YMZYAQAGaOviyyLA/fj4AAAAABBwYXNwAAAAAQAAAAE=" />
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" startWithSAP="1">
   <Representation id="2" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" bandwidth="128000" src="/videos/audio_128k.mp4" trackID="1">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
    <SegmentList timescale="48000" sampleDuration="1024" srcTimescale="48000">
     <I t="0" n="1" d="191488"/>
     <I t="191488" n="188" d="192512"/>
     <I t="384000" n="376" d="191488"/>
     <I t="575488" n="563" d="192512"/>
     <I t="768000" n="751" d="191488"/>
     <I t="959488" n="938" d="192512"/>
     <I t="1152000" n="1126" d="191488"/>
     <I t="1343488" n="1313" d="98304"/>
    </SegmentList>
    <prop type="MIMEType" value="video/mp4" />
    <prop type="ClockID" value="1" />
    <prop type="StreamType" value="Audio" />
    <prop type="Timescale" value="48000" />
    <prop type="HasSync" value="false" />
    <prop type="Duration" value="1441792/48000" />
    <prop type="NumFrames" value="1408" />
    <prop type="StreamSubtype" value="soun" />
    <prop type="IsoAltBrands" value="iso6,cmfc,mp41" />
    <prop type="IsoBrand" value="iso6" />
    <prop type="TrackTemplate" value="AAAA+3RyYWsAAABcdGtoZAAAAAMAAAAA4munigAAAAEAAAAAAAB1VQAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAJdtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAALuAABYAAFXEAAAAAAA3aGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAEdQQUMgSVNPIEF1ZGlvIEhhbmRsZXIAAAAAOG1pbmYAAAAQc21oZAAAAAAAAAAAAAAACGRpbmYAAAAYc3RibAAAABBzdHNkAAAAAAAAAAA=" />
    <prop type="TrexTemplate" value="AAAAIHRyZXgAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAA=" />
    <prop type="MovieTime" value="30037/1000" />
    <prop name="title" ptype="str" value="Big Buck Bunny, Sunflower version" />
    <prop name="artist" ptype="str" value="Blender Foundation 2008, Janus Bager Kristensen 2013" />
    <prop name="writer" ptype="str" value="Sacha Goedegebure" />
    <prop name="comment" ptype="str" value="Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net" />
    <prop name="genre" ptype="str" value="Animation" />
    <prop type="HandlerName" value="GPAC ISO Audio Handler" />
    <prop type="TrackFlags" value="3" />
    <prop type="AltGroup" value="1" />
    <prop name="isom:creation_date" ptype="luint" value="0" />
    <prop name="isom:modification_date" ptype="luint" value="0" />
    <prop type="CodecID" value="MPEG-4 AAC Audio" />
    <prop type="DecoderConfig" value="EZBW5QA=" />
    <prop type="DecoderConfigIndex" value="1" />
    <prop type="SampleRate" value="48000" />
    <prop type="NumChannels" value="2" />
    <prop type="BPS" value="16" />
    <prop type="SamplesPerFrame" value="1024" />
    <prop type="Bitrate" value="128000" />
    <prop type="Maxrate" value="128000" />
    <prop type="DBSize" value="0" />
    <prop type="ISOMSubtype" value="mp4a" />
    <prop type="STSDTemplate" value="AAAAYm1wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAKmVzZHMAAAAAAxwAAAAEFEAVAAAAAAH0AAAB9AAFBRGQVuUABgECAAAAFGJ0cnQAAAAAAAH0AAAB9AA=" />
   </Representation>
  </AdaptationSet>
 </Period>
</GHIX>

2 - Generating init files like this is working

gpac -i /videos/result/index.ghi:gm=init:rep=1 -o /videos/result/master.mpd
gpac -i /videos/result/index.ghi:gm=init:rep=2 -o /videos/result/master.mpd

Generating playlist for hls and dash also works

3 - However when generating segments it works for represention 1 but not for 2

# works
gpac -i /videos/result/index.ghi:rep=1:sn=1 -o /videos/result/master.mpd
# not working
gpac -i /videos/result/index.ghi:rep=2:sn=1 -o /videos/result/master.mpd

It gives the following error:

Filters not connected:
fout (dst=/videos/result/master.mpd) (idx=2)

I notice also in the index on representation 2 the mimeType is audio/mp4 which is correct, and in the props its <prop type="MIMEType" value="video/mp4" />
Don't know if it can make the filters fail ?

Thanks for your help.

Regard,
Romain

@rbouqueau
Copy link
Member

I can't reproduce. Could you share a sample with us?

@romainapivideo
Copy link
Author

@jeanlf jeanlf closed this as completed in 43f8872 May 23, 2024
@jeanlf
Copy link
Member

jeanlf commented May 23, 2024

Now fixed, was caused by same track ID being used in the source files - thanks for the detailed report and files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants