I am trying to package mp4 videos with MP4Box to play with dash.js.

I produce 4 qualities, with commands similar to this:

```
	ffmpeg -i source.mkv -b:v 1000k -filter:v "scale=-2:480" \
		-r 60 -x264opts 'keyint=120:min-keyint=120:no-scenecut' \
		-movflags faststart \
		-an -c:v libx264  \
		-preset fast \
		-profile:v main out-480.mp4
```

I generate 360p, 480p, 720p and 1080p.

Then I use `MP4Box` like this:

```
	MP4Box -dash 2000 -frag 2000 -rap -fps 60 -profile onDemand \
		encoded/out-1080.mp4'#video:id=1080p' \
		encoded/out-720.mp4'#video:id=720p' \
		encoded/out-480.mp4'#video:id=480p' \
		encoded/out-360.mp4'#video:id=360p' \
		encoded/out.m4a'#audio:id=Main:role=main' \
		-out index.mpd

```

With short videos it works, but with longer videos it takes a very long time. I am trying with a 6 hour video, and it's been running for 48h now.

When I start it, it goes up at a decent pace, for example, I just launched it:

```
Dashing P1 AS#1.1(V) seg #398 0.20s (10.15 %) AS#1.2(V) seg #398 0.22s (10.83 %) AS#1.3(V) seg #398 0.22s (10.83 %) AS#1.4(V) seg #398 0.18s (9.17 %) AS#2.1(A) seg #398 0.22s (10.93 %) / MPD 794.22s 4 %
```

and it's at 4% in like a minute.

But after a while it seems to go slower and slower until it takes an hour for a single percent. (this is a general observation, I have not measured it)

When it is running, I see one CPU at 100%.

Is it normal? Can I do something to make it faster? I have a threadripper and a lot of memory (256GB) in my system, can I do anything to leverage that?



```
MP4Box - GPAC version 2.3-DEV-rev121-g71277af55-master
(c) 2000-2023 Telecom Paris distributed under LGPL v2.1+ - http://gpac.io

Please cite our work in your research:
	GPAC Filters: https://doi.org/10.1145/3339825.3394929
	GPAC: https://doi.org/10.1145/1291233.1291452

GPAC Configuration: --prefix=/usr --mandir=/usr/share/man
Features: GPAC_CONFIG_LINUX GPAC_64_BITS GPAC_HAS_IPV6 GPAC_HAS_SSL GPAC_HAS_SOCK_UN GPAC_MINIMAL_ODF GPAC_HAS_QJS GPAC_HAS_FAAD GPAC_HAS_MAD GPAC_HAS_LIBA52 GPAC_HAS_JPEG GPAC_HAS_PNG GPAC_HAS_FFMPEG GPAC_HAS_JP2 GPAC_HAS_THEORA GPAC_HAS_VORBIS GPAC_HAS_LINUX_DVB GPAC_HAS_HTTP2 
```

MP4Box very slow
This is a GitHub Issue
repo:gpac
owner:gpac
Title : MP4Box very slow
Issue date:

--- start body ---
I am trying to package mp4 videos with MP4Box to play with dash.js.

I produce 4 qualities, with commands similar to this:

```
	ffmpeg -i source.mkv -b:v 1000k -filter:v "scale=-2:480" \
		-r 60 -x264opts 'keyint=120:min-keyint=120:no-scenecut' \
		-movflags faststart \
		-an -c:v libx264  \
		-preset fast \
		-profile:v main out-480.mp4
```

I generate 360p, 480p, 720p and 1080p.

Then I use `MP4Box` like this:

```
	MP4Box -dash 2000 -frag 2000 -rap -fps 60 -profile onDemand \
		encoded/out-1080.mp4'#video:id=1080p' \
		encoded/out-720.mp4'#video:id=720p' \
		encoded/out-480.mp4'#video:id=480p' \
		encoded/out-360.mp4'#video:id=360p' \
		encoded/out.m4a'#audio:id=Main:role=main' \
		-out index.mpd

```

With short videos it works, but with longer videos it takes a very long time. I am trying with a 6 hour video, and it's been running for 48h now.

When I start it, it goes up at a decent pace, for example, I just launched it:

```
Dashing P1 AS#1.1(V) seg #398 0.20s (10.15 %) AS#1.2(V) seg #398 0.22s (10.83 %) AS#1.3(V) seg #398 0.22s (10.83 %) AS#1.4(V) seg #398 0.18s (9.17 %) AS#2.1(A) seg #398 0.22s (10.93 %) / MPD 794.22s 4 %
```

and it's at 4% in like a minute.

But after a while it seems to go slower and slower until it takes an hour for a single percent. (this is a general observation, I have not measured it)

When it is running, I see one CPU at 100%.

Is it normal? Can I do something to make it faster? I have a threadripper and a lot of memory (256GB) in my system, can I do anything to leverage that?



```
MP4Box - GPAC version 2.3-DEV-rev121-g71277af55-master
(c) 2000-2023 Telecom Paris distributed under LGPL v2.1+ - http://gpac.io

Please cite our work in your research:
	GPAC Filters: https://doi.org/10.1145/3339825.3394929
	GPAC: https://doi.org/10.1145/1291233.1291452

GPAC Configuration: --prefix=/usr --mandir=/usr/share/man
Features: GPAC_CONFIG_LINUX GPAC_64_BITS GPAC_HAS_IPV6 GPAC_HAS_SSL GPAC_HAS_SOCK_UN GPAC_MINIMAL_ODF GPAC_HAS_QJS GPAC_HAS_FAAD GPAC_HAS_MAD GPAC_HAS_LIBA52 GPAC_HAS_JPEG GPAC_HAS_PNG GPAC_HAS_FFMPEG GPAC_HAS_JP2 GPAC_HAS_THEORA GPAC_HAS_VORBIS GPAC_HAS_LINUX_DVB GPAC_HAS_HTTP2 
```

--- end body ---
