Hi, 

I'm trying to use mp4box to generate growing and timeshiftable dash output that can be played in browser (currently trying shaka/video.js).

Application generating mp4 source is ffmpeg with empty_moov+omit_tfhd_offset+frag_keyframe+default_base_moof movflags set (25 frame GOP) and tried various other settings.

Currently using node-gpac-dash to serve the dash content and a small node.js based webserver for the video.js/shaka test page.

The result is playing back ok in chrome but mp4box doesn't seem to be handling the growing mp4 file, so the browser is never able to play beyond the duration of the clip at the time mp4box was run, I've seen suggestions to loop mp4box in shell script or similar eg. issue https://github.com/gpac/gpac/issues/835 but am not clear how to prevent it re-dashing media that was previously dashed or if there's a way to do this natively in mp4box or mp4box.js?

This is the mp4box command (and output below):  ./MP4Box -dash-live 1000 -frag 1000 -profile live -mpd-refresh 1000 -time-shift 7200 -out /opt/node-gpac-dash/dash.mpd /tmp/source.mp4

Live DASH-ing - press 'q' to quit, 's' to save context and quit
[iso file] Box "tmcd" (start 1344) has 2 extra bytes
[IsoMedia] Track 3 is disabled, ignoring track - you may retry by specifying alltk option
[Dasher] No template assigned, using $File$_dash$FS$$Number$
[MPD] Generating MPD at time 2021-02-26T10:18:28.195Z
[Dasher] Segment 1 duration 1.72 more than 3/2 DASH duration, consider reencoding or using segment timeline
[Dasher] AS-1 Rep 1 segment 1 done 1601 ms before UTC due time
[Dasher] updated period DID1 duration 1720 MPD time 1720
[Dasher] First CTS 43000 in segment 2 drifting by 0.72 (more than half a segment duration) from segment time, consider reencoding or using segment timeline
[Dasher] updated period DID1 duration 1880 MPD time 1880
[Dasher] updated period DID1 duration 1920 MPD time 1920
[Dasher] updated period DID1 duration 1920 MPD time 1920
[MPD] Generating MPD at time 2021-02-26T10:18:28.338Z

Slept for 1772 ms before generation, dash cumulated time 1963
Slept for 0 ms before generation, dash cumulated time 1965
Slept for 0 ms before generation, dash cumulated time 1966

etc. (it sleeps forever after this).

In an ideal world I think it would be cleaner not to have to write dash media to the disk (to avoid having to housekeep etc) so wonder if I could use mp4box.js to avoid this step by passing boxes directly to browser over websockets but I think it may have a similar issue and in any case feels like we need to resolve the growing mp4 issue first.

Any Help Appreciated!

James

mp4box with growing .mp4 source
This is a GitHub Issue
repo:gpac
owner:gpac
Title : mp4box with growing .mp4 source
Issue date:

--- start body ---
Hi, 

I'm trying to use mp4box to generate growing and timeshiftable dash output that can be played in browser (currently trying shaka/video.js).

Application generating mp4 source is ffmpeg with empty_moov+omit_tfhd_offset+frag_keyframe+default_base_moof movflags set (25 frame GOP) and tried various other settings.

Currently using node-gpac-dash to serve the dash content and a small node.js based webserver for the video.js/shaka test page.

The result is playing back ok in chrome but mp4box doesn't seem to be handling the growing mp4 file, so the browser is never able to play beyond the duration of the clip at the time mp4box was run, I've seen suggestions to loop mp4box in shell script or similar eg. issue https://github.com/gpac/gpac/issues/835 but am not clear how to prevent it re-dashing media that was previously dashed or if there's a way to do this natively in mp4box or mp4box.js?

This is the mp4box command (and output below):  ./MP4Box -dash-live 1000 -frag 1000 -profile live -mpd-refresh 1000 -time-shift 7200 -out /opt/node-gpac-dash/dash.mpd /tmp/source.mp4

Live DASH-ing - press 'q' to quit, 's' to save context and quit
[iso file] Box "tmcd" (start 1344) has 2 extra bytes
[IsoMedia] Track 3 is disabled, ignoring track - you may retry by specifying alltk option
[Dasher] No template assigned, using $File$_dash$FS$$Number$
[MPD] Generating MPD at time 2021-02-26T10:18:28.195Z
[Dasher] Segment 1 duration 1.72 more than 3/2 DASH duration, consider reencoding or using segment timeline
[Dasher] AS-1 Rep 1 segment 1 done 1601 ms before UTC due time
[Dasher] updated period DID1 duration 1720 MPD time 1720
[Dasher] First CTS 43000 in segment 2 drifting by 0.72 (more than half a segment duration) from segment time, consider reencoding or using segment timeline
[Dasher] updated period DID1 duration 1880 MPD time 1880
[Dasher] updated period DID1 duration 1920 MPD time 1920
[Dasher] updated period DID1 duration 1920 MPD time 1920
[MPD] Generating MPD at time 2021-02-26T10:18:28.338Z

Slept for 1772 ms before generation, dash cumulated time 1963
Slept for 0 ms before generation, dash cumulated time 1965
Slept for 0 ms before generation, dash cumulated time 1966

etc. (it sleeps forever after this).

In an ideal world I think it would be cleaner not to have to write dash media to the disk (to avoid having to housekeep etc) so wonder if I could use mp4box.js to avoid this step by passing boxes directly to browser over websockets but I think it may have a similar issue and in any case feels like we need to resolve the growing mp4 issue first.

Any Help Appreciated!

James

--- end body ---
