(old topic but creating a simplified examples and ffmpeg reference)

**Is it possible to generate dash `trun.version=1 (negative composite offset)` for audio segments?** 
Video segments use `trun.version=1` format but never able to do it on audio segments. 
Validators may output warnings if version=1 is not used.

Mp4box can write `trun.version=1` for video segments but no audio segments.
```
mp4box -dash 3840 -frag 1920 -dash-scale 1000 -mem-frags -rap -profile dashavc264:live \
  -profile-ext urn:hbbtv:dash:profile:isoff-live:2012 -min-buffer 2000 \
  -bs-switching no \
  -sample-groups-traf -single-traf --tfdt64 --tfdt_traf --noroll=yes --btrt=no --truns_first=yes \
  --cmaf=cmf2 -subsegs-per-sidx -1 \
  -segment-name "$RepresentationID$/$Number$$Init=i$" \
  -out "manifest.mpd" \
   "Agent327_Spring_640x360.mp4#trackID=1:id=v1:period=p0:asID=1:role=main:dur=11.520" \
   "Agent327_Spring_128.mp4#trackID=1:id=a1:period=p0:asID=21:role=main:dur=11.520"
```

Ffmpeg can write `trun.version=1` for video and audio segments.
(output folders `./0/, ./1/` must exist)
```
v1=[s1]scale=640x360:out_range=tv:out_color_matrix=bt709:flags=full_chroma_int+accurate_rnd,format=yuv420p,setsar=1/1[v1]
ffmpeg -i "Agent327_Spring_640x360.mp4" -i "Agent327_Spring_128.mp4" -t "11.520" -preset fast \ 
  -r 25 -keyint_min 25 -g 50 \
  -filter_complex "[0:v]split=1[s1]; $v1" \
  -refs 3 -bf 3 -b_strategy 1 -flags +cgop -sc_threshold 0 \
  -c:v libx264 -pix_fmt yuv420p \
  -map "[v1]" -crf:v:0 23 -profile:v:0 main -level:v:0 3.0 -maxrate:v:0 600k -bufsize:v:0 1200k -b:v:0 600k \
  -metadata:s:v:0 "language=eng" -metadata:s:v:0 "role=main" \
  -color_range tv -colorspace bt709 -color_primaries bt709 -color_trc bt709 \
  -map 1:a -ar:a:0 48000 -ac:a:0 2 -c:a:0 aac -b:a:0 128k \
  -metadata:s:a:0 "language=eng" -metadata:s:a:0 "role=main" \
  -format_options "movflags=cmaf:write_btrt=0" \
  -seg_duration 4 -use_template 1 -use_timeline 0 -dash_segment_type mp4 -frag_duration 4 \
  -adaptation_sets "id=0,frag_type=duration,streams=v id=1,frag_type=duration,streams=a" \
  -init_seg_name  "$RepresentationID$/i.mp4" \
  -media_seg_name "$RepresentationID$/$Number$.m4s" \
  -movflags negative_cts_offsets+faststart \
  -f dash -y "manifest.mpd"
```

Reference:
https://github.com/gpac/gpac/issues/1260
https://github.com/gpac/gpac/issues/1253
Test input files:
https://refapp.hbbtv.org/videos/dashtest/Agent327_Spring_128.mp4
https://refapp.hbbtv.org/videos/dashtest/Agent327_Spring_640x360.mp4

Generate dash "trun.version=1" audio segments never happens, video segments are fine
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Generate dash "trun.version=1" audio segments never happens, video segments are fine
Issue date:

--- start body ---
(old topic but creating a simplified examples and ffmpeg reference)

**Is it possible to generate dash `trun.version=1 (negative composite offset)` for audio segments?** 
Video segments use `trun.version=1` format but never able to do it on audio segments. 
Validators may output warnings if version=1 is not used.

Mp4box can write `trun.version=1` for video segments but no audio segments.
```
mp4box -dash 3840 -frag 1920 -dash-scale 1000 -mem-frags -rap -profile dashavc264:live \
  -profile-ext urn:hbbtv:dash:profile:isoff-live:2012 -min-buffer 2000 \
  -bs-switching no \
  -sample-groups-traf -single-traf --tfdt64 --tfdt_traf --noroll=yes --btrt=no --truns_first=yes \
  --cmaf=cmf2 -subsegs-per-sidx -1 \
  -segment-name "$RepresentationID$/$Number$$Init=i$" \
  -out "manifest.mpd" \
   "Agent327_Spring_640x360.mp4#trackID=1:id=v1:period=p0:asID=1:role=main:dur=11.520" \
   "Agent327_Spring_128.mp4#trackID=1:id=a1:period=p0:asID=21:role=main:dur=11.520"
```

Ffmpeg can write `trun.version=1` for video and audio segments.
(output folders `./0/, ./1/` must exist)
```
v1=[s1]scale=640x360:out_range=tv:out_color_matrix=bt709:flags=full_chroma_int+accurate_rnd,format=yuv420p,setsar=1/1[v1]
ffmpeg -i "Agent327_Spring_640x360.mp4" -i "Agent327_Spring_128.mp4" -t "11.520" -preset fast \ 
  -r 25 -keyint_min 25 -g 50 \
  -filter_complex "[0:v]split=1[s1]; $v1" \
  -refs 3 -bf 3 -b_strategy 1 -flags +cgop -sc_threshold 0 \
  -c:v libx264 -pix_fmt yuv420p \
  -map "[v1]" -crf:v:0 23 -profile:v:0 main -level:v:0 3.0 -maxrate:v:0 600k -bufsize:v:0 1200k -b:v:0 600k \
  -metadata:s:v:0 "language=eng" -metadata:s:v:0 "role=main" \
  -color_range tv -colorspace bt709 -color_primaries bt709 -color_trc bt709 \
  -map 1:a -ar:a:0 48000 -ac:a:0 2 -c:a:0 aac -b:a:0 128k \
  -metadata:s:a:0 "language=eng" -metadata:s:a:0 "role=main" \
  -format_options "movflags=cmaf:write_btrt=0" \
  -seg_duration 4 -use_template 1 -use_timeline 0 -dash_segment_type mp4 -frag_duration 4 \
  -adaptation_sets "id=0,frag_type=duration,streams=v id=1,frag_type=duration,streams=a" \
  -init_seg_name  "$RepresentationID$/i.mp4" \
  -media_seg_name "$RepresentationID$/$Number$.m4s" \
  -movflags negative_cts_offsets+faststart \
  -f dash -y "manifest.mpd"
```

Reference:
https://github.com/gpac/gpac/issues/1260
https://github.com/gpac/gpac/issues/1253
Test input files:
https://refapp.hbbtv.org/videos/dashtest/Agent327_Spring_128.mp4
https://refapp.hbbtv.org/videos/dashtest/Agent327_Spring_640x360.mp4

--- end body ---

None