gpac / gpac

GPAC Ultramedia OSS for Video Streaming & Next-Gen Multimedia Transcoding, Packaging & Delivery
https://gpac.io
GNU Lesser General Public License v2.1
2.77k stars 532 forks source link

DASHing file: Internal Service Error #1553

Closed chanof closed 4 years ago

chanof commented 4 years ago

Hello, in order to upgrading the os to Ubuntu 18.04 LTS I get an issue about MP4Box version 1.0.0-rev156-gbcbdbdbf4-master

The command:

MP4Box -dash-live 2000 -subdur 4000 -segment-timeline -profile dashavc264:live -subsegs-per-sidx -1 -mpd-refresh 8 -time-shift 16 -min-buffer 2000 -url-template -insert-utc -dash-ctx ../../live/log.txt -out ../../live/manifest.mpd ../current/output_1080.mp4#video ../current/output_720.mp4#video ../current/output_360.mp4#video ../current/output_180.mp4#video ../current/output_audio.mp4#audio

Give me this kind of errors:

[Dasher] No template assigned, using $File$_dash$FS$$Time$ [MPD] Generating MPD at time 2020-07-26T14:31:18.051Z [Dasher] AS0 Rep 1 segment 1 done 1986 ms before UTC due time [Dasher] AS0 Rep 2 segment 1 done 1986 ms before UTC due time [Dasher] AS0 Rep 3 segment 1 done 1986 ms before UTC due time [Dasher] AS0 Rep 4 segment 1 done 1986 ms before UTC due time [Dasher] updated period DID1 duration 2000 MPD time 2000 [MPD] Generating MPD at time 2020-07-26T14:31:18.053Z [Dasher] AS0 Rep 5 segment 1 done 1980 ms before UTC due time [Dasher] removing segment output_1080_dash0.m4s [Dasher] purging segment output_1080_dash0.m4s for AS 0 rep 1 but segment list is empty! [Dasher] No timeline entry after currently removed segment, cannot update start time [Dasher] removing segment output_720_dash0.m4s [Dasher] purging segment output_720_dash0.m4s for AS 0 rep 2 but segment list is empty! [Dasher] removing segment output_360_dash0.m4s [Dasher] purging segment output_360_dash0.m4s for AS 0 rep 3 but segment list is empty! [Dasher] removing segment output_180_dash0.m4s [Dasher] purging segment output_180_dash0.m4s for AS 0 rep 4 but segment list is empty! [Dasher] updated period DID1 duration 3583 MPD time 3583 [MPD] Generating MPD at time 2020-07-26T14:31:18.055Z [Dasher] AS0 Rep 1 segment 2 done 3983 ms before UTC due time#2 1.88s (93.75 %) AS#1.3(V) seg #2 1.88s (93.75 %) AS#1.4(V) seg #2 1.88s (93.75 %) AS#2.1(A) seg #2 0.16s (7.97 %) / MPD 3.88s 1 % [Dasher] AS0 Rep 2 segment 2 done 3983 ms before UTC due time [Dasher] AS0 Rep 3 segment 2 done 3983 ms before UTC due time [Dasher] AS0 Rep 4 segment 2 done 3983 ms before UTC due time [Dasher] removing segment output_audio_dash0.m4s#1.2(V) seg #3 0.00s (0.00 %) AS#1.3(V) seg #3 0.00s (0.00 %) AS#1.4(V) done (3 segs) AS#2.1(A) seg #2 0.23s (11.46 %) [Dasher] purging segment output_audio_dash0.m4s for AS 0 rep 5 but segment list is empty! [Dasher] No timeline entry after currently removed segment, cannot update start time [Dasher] updated period DID1 duration 4000 MPD time 4000 [MPD] Generating MPD at time 2020-07-26T14:31:18.056Z [Dasher] Adaptation sets in period are of unequal duration min 3.39 max 6 seconds [Dasher] removing segment output_1080_dash24576.m4s [Dasher] purging segment output_1080_dash24576.m4s for AS 0 rep 1 but segment list is empty! [Dasher] removing segment output_720_dash24576.m4s [Dasher] purging segment output_720_dash24576.m4s for AS 0 rep 2 but segment list is empty! [Dasher] removing segment output_360_dash24576.m4s [Dasher] purging segment output_360_dash24576.m4s for AS 0 rep 3 but segment list is empty! [Dasher] updated period DID1 duration 6000 MPD time 6000 [MPD] Generating MPD at time 2020-07-26T14:31:18.058Z [Dasher] AS0 Rep 5 segment 2 done 3973 ms before UTC due time [Dasher] Adaptation sets in period are of unequal duration min 3.993 max 6 seconds [Dasher] updated period DID1 duration 6000 MPD time 6000 [MPD] Generating MPD at time 2020-07-26T14:31:18.059Z [Filter] dasher not responding properly: 100000 consecutive process with no packet discarded or sent, but 5 packets pending discarding all inputs and notifying end of stream on all outputs Error DASHing file: Internal Service Error Live DASH-ing - press 'q' to quit, 's' to save context and quit [DASH] generation called too early by 5627 ms Error DASHing file: End Of Stream / File Live DASH-ing - press 'q' to quit, 's' to save context and quit [DASH] generation called too early by 5591 ms Error DASHing file: End Of Stream / File Live DASH-ing - press 'q' to quit, 's' to save context and quit [DASH] generation called too early by 5554 ms Error DASHing file: End Of Stream / File Live DASH-ing - press 'q' to quit, 's' to save context and quit [DASH] generation called too early by 5519 ms Error DASHing file: End Of Stream / File Live DASH-ing - press 'q' to quit, 's' to save context and quit

I think that it could be an install issue, since the command worked in the preview os/configuration, but also the GPAC revision upgrade could metter. I can't understand these errors:

[Filter] dasher not responding properly: 100000 consecutive process with no packet discarded or sent, but 5 packets pending discarding all inputs and notifying end of stream on all outputs Error DASHing file: Internal Service Error

I observe the same issue on OSX Mojave

May ask help to understand and fix what is going on? Thank you

Gian

chanof commented 4 years ago

By downgrading to Ubuntu 16.04 and following the GPAC Build guide I got the same result, so may be the issue inside my command? Due to revision changing, I understand that is happen only with multiple adaptation sets, not with only one

jeanlf commented 4 years ago

we had a bug assigning a wrong value for time-shift (/1000), should now be fixed. However the issue at the end of the session is strange and I cannot reproduce it, it is source-related. Could you upload your test files somewhere ?

chanof commented 4 years ago

Hi! yes http://www.unknow.tv/incoming/output_180.mp4 http://www.unknow.tv/incoming/output_360.mp4 http://www.unknow.tv/incoming/output_720.mp4 http://www.unknow.tv/incoming/output_1080.mp4 http://www.unknow.tv/incoming/output_audio.mp4

Using GPAC tag 0.8.0 I get no errors

This is the ffmpeg coding responsible for 1080 adaptation set

Before the master track encoding there is the audio encoding:

#AUDIO ENCODING
for f in *.mp4; 
do
NAME=$(echo "$f" | cut -d'.' -f1) 
ffmpeg -y -i "$f" -c copy -video_track_timescale 90k -c:a aac -b:a 384k -ar 44100 -ac 2 -shortest -af aresample=async=1 ../buffer/${NAME}_buffer.mp4
done

1080 encoding process:

#ENCODING MASTER TRACK
ffmpeg -f concat -safe 0 -y -i list.txt -loop 1 -i ../logo/logo.png -c:a copy -c:v libx264 -x264opts keyint=$GOP:min-keyint=$GOP:no-scenecut -bf 0 -r $FPSC -b:v 4800k -maxrate 9600k -bufsize 19200k -profile:v main -crf 22 -filter_complex "[0:v][1:v]overlay=main_w-overlay_w-10:10,scale=1920:1080,setsar=1" -t $TOTDUR 1080set.mp4 

#EXTRACTING AUDIO FROM MASTER VIDEO TRACK
ffmpeg -y -i 1080set.mp4 -c copy -vn ../output/output_audio.mp4

#REMOVE AUDIO FROM MASTER VIDEO TRACK
ffmpeg -y -i 1080set.mp4 -c copy -an ../output/output_1080.mp4

Thanks for your work!

jeanlf commented 4 years ago

This is now fixed, thanks for the detailed report.

anthnyprschka commented 1 year ago

@jeanlf I am getting the same error with GPAC release 2.2.1 when running MP4Box -dash 1000 -profile live -mpd-refresh 15 -dynamic "sample.mp4" -out live.mpd:

[Dasher] Segment 1 duration 5.26667 more than 3/2 DASH duration, consider reencoding or using segment timeline
[Dasher] AS-1 Rep 1 segment 1 done 5196 ms before UTC due time
[Dasher] updated period DID1 duration 5266 MPD time 52663s 34 %
[Dasher] First CTS 80896 in segment 2 drifting by 4.26667 (more than half a segment duration) from segment time, consider reencoding or using segment timeline
[Dasher] Segment 2 duration 5.06667 more than 3/2 DASH duration, consider reencoding or using segment timeline
[Dasher] AS-1 Rep 1 segment 2 done 10227 ms before UTC due time
[Dasher] removing segment sample_dash1.m4s 68 %
[Dasher] updated period DID1 duration 10333 MPD time 10333

It's removing the generated m4s files for some reason.

Streaming the file with MP4Box -dash 1000 -frag 1000 -rap -segment-name segment_ "sample.mp4" works fine but I wanna do it dynamic so I can push new mp4 files as they arrive at the server to the live stream (like this issue: https://github.com/gpac/gpac/issues/1252).

Any help would be very appreciated!