The Audio requires raw streaming instead of mp4 or m4a,and the Dolby Vision MP4 file generated by the above process is tested to be perfectly compatible with Apple devices.
### 
**For Mac or Linux:**

```
> ffmpeg -i $1 -c copy -vbsf hevc_mp4toannexb -f hevc -y -an video.tmp.hevc;
> ffmpeg -i $1 -c copy -y -vn audio.tmp.aac; #Can not be omitted
> mp4muxer -i video.tmp.hevc -o $2.tmp.mp4 --dvh1flag 0 --dv-profile 5 --mpeg4-comp-brand mp42,iso6,isom,msdh,dby1 --overwrite;
> mp4box -add "$2.tmp.mp4#video" -add "audio.tmp.aac" -new $2.mp4;
```

**For Windows:**
```
@echo off
for %%i in (%*) do (
ffmpeg -y -i %%i.ts -map 0:a -c copy %%i.aac && ffmpeg -y -i %%i.ts -c copy -vbsf hevc_mp4toannexb -f hevc %%i.hevc && mp4muxer -i %%i.hevc -o %%i.hevc.mp4 --dvh1flag 0 --dv-profile 5 --mpeg4-comp-brand mp42,iso6,isom,msdh,dby1 --overwrite  && mp4box -inter 500 -noprog -add %%i.hevc.mp4#1:name= -add %%i.aac#1:name=:lang=chi -brand mp42isom -ab iso6 -ab msdh -ab dby1 -new MUX_%%i.mp4
)
pause.
```
**Requirements**

-   [ffmpeg](https://ffmpeg.org/download.html) (>=5.0)
    Read track info, extract stream
-   [mp4box](https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/) (>=2.1)
    Mux video, audio, subtitle together
-   [mp4muxer](https://github.com/DolbyLaboratories/dlb_mp4base/tree/master/bin)
    Mux ES to DoVi mp4

 Please ensure the version of these software, or the output may not be correct!
Apple Device Dolby Vision Perfect Mixed Stream Sharing Posts
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Apple Device Dolby Vision Perfect Mixed Stream Sharing Posts
Issue date:

--- start body ---
The Audio requires raw streaming instead of mp4 or m4a,and the Dolby Vision MP4 file generated by the above process is tested to be perfectly compatible with Apple devices.
### 
**For Mac or Linux:**

```
> ffmpeg -i $1 -c copy -vbsf hevc_mp4toannexb -f hevc -y -an video.tmp.hevc;
> ffmpeg -i $1 -c copy -y -vn audio.tmp.aac; #Can not be omitted
> mp4muxer -i video.tmp.hevc -o $2.tmp.mp4 --dvh1flag 0 --dv-profile 5 --mpeg4-comp-brand mp42,iso6,isom,msdh,dby1 --overwrite;
> mp4box -add "$2.tmp.mp4#video" -add "audio.tmp.aac" -new $2.mp4;
```

**For Windows:**
```
@echo off
for %%i in (%*) do (
ffmpeg -y -i %%i.ts -map 0:a -c copy %%i.aac && ffmpeg -y -i %%i.ts -c copy -vbsf hevc_mp4toannexb -f hevc %%i.hevc && mp4muxer -i %%i.hevc -o %%i.hevc.mp4 --dvh1flag 0 --dv-profile 5 --mpeg4-comp-brand mp42,iso6,isom,msdh,dby1 --overwrite  && mp4box -inter 500 -noprog -add %%i.hevc.mp4#1:name= -add %%i.aac#1:name=:lang=chi -brand mp42isom -ab iso6 -ab msdh -ab dby1 -new MUX_%%i.mp4
)
pause.
```
**Requirements**

-   [ffmpeg](https://ffmpeg.org/download.html) (>=5.0)
    Read track info, extract stream
-   [mp4box](https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/) (>=2.1)
    Mux video, audio, subtitle together
-   [mp4muxer](https://github.com/DolbyLaboratories/dlb_mp4base/tree/master/bin)
    Mux ES to DoVi mp4

 Please ensure the version of these software, or the output may not be correct!
--- end body ---

None