Comments (21)
It is difficult to handle it properly without knowing why the dts is decreasing. I suggest looking into the root cause - a difference of 17179995184 vs. 17185193584 is significant.
One possible workaround might be to add a fictional offset to adjust the timestamp when seeing a big gap in dts, something like
src/packager/media/formats/mp2t/es_parser_h264.cc&l=317
media_sample->set_dts(current_timing_desc.dts + timestamp_adjustment_);
media_sample->set_pts(current_timing_desc.pts + timestamp_adjustment_);
if(media_sample->dts() < pending_sample_->dts()) {
int64_t gap = pending_sample_->dts() - media_sample->dts();
timestamp_adjustment_ += gap + kEstimatedFrameDuration;
media_sample->set_dts(current_timing_desc.dts + timestamp_adjustment_);
media_sample->set_pts(current_timing_desc.pts + timestamp_adjustment_);
}
That said, I think the best option is still to find the root cause and solve the problem there. The workaround should be avoided if possible.
from shaka-packager.
Yes,
the reason is clear.
The stream is received by DVB-S2 receiver from the satellite. Next is re-streamed to a edash_packager. But sometimes because some transport/encoding errors DTS is decreasing. Why? Who knows. The signal comes from the satellite.
Thank you for the idea.
BRS/
Peyo
from shaka-packager.
@peyoh I have updated https://github.com/kqyang/edash-packager to ignore samples with decreasing timestamp. Can you give it a try? It will be great if you can post logging messages as well. I am interested in seeing what is the timestamp pattern when it happens. Thanks.
from shaka-packager.
got it.
from shaka-packager.
Hi,
with this branch I see some unseen before logs. :)
[0420/122707:INFO:demuxer.cc(60)] Initialize Demuxer for file 'udp://239.204.0.14:7000'.
[0420/122707:ERROR:container_names.cc(1032)] Failure while processing: ReadBits(&reader, 11) == 0x7ff
[0420/122707:ERROR:container_names.cc(1109)] Failure while processing: ValidMpegAudioFrameHeader( buffer + offset, buffer_size - offset, &framesize)
[0420/122707:ERROR:container_names.cc(710)] Failure while processing: ReadBits(&reader, 24) == 1
and
[0421/043107:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/043107:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/043107:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/043107:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/043107:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/043107:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/043107:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/043107:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
from shaka-packager.
You can ignore the errors in container_names.cc - these errors should have been suppressed, sorry for the confusion.
As for the warnings in nalu_reader.cc, it is as a result of #93 fix - the source content is not properly escaped.
Other than that, is it still running? Have you seen errors like "Seeing sample with dts ..."?
from shaka-packager.
Hi KQ,
that's the latest log before exit.
[0421/215952:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/215952:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/220146:WARNING:mpd_builder.cc(1259)] Found a gap of size 119040 > kRoundingErrorGrace (5). The new segment starts at 17704734840 but the previous segment ends at 17704615800.
[0421/230525:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xbf).
[0421/230525:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/230525:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/230525:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/230525:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/230525:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/230525:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xbf).
[0421/230525:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/230525:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/230525:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/230525:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xdf).
[0421/230525:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/230525:WARNING:nalu_reader.cc(55)] Unspecified or reserved nal_unit_type 31 (header 0x7f).
[0421/230525:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/230525:WARNING:nalu_reader.cc(55)] Unspecified or reserved nal_unit_type 31 (header 0x7f).
[0421/230525:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0421/235140:WARNING:mpd_builder.cc(1259)] Found a gap of size 13440 > kRoundingErrorGrace (5). The new segment starts at 18298164600 but the previous segment ends at 18298151160.
[0422/001058:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xff).
[0422/001058:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0422/001058:WARNING:nalu_reader.cc(41)] forbidden_zero_bit shall be equal to 0 (header 0xff).
[0422/001058:WARNING:nalu_reader.cc(311)] Seeing invalid NAL unit. Emulation prevention may not have been applied properly. Assuming it is part of the previous NAL unit.
[0422/005443:WARNING:mpd_builder.cc(1259)] Found a gap of size 26880 > kRoundingErrorGrace (5). The new segment starts at 18638572920 but the previous segment ends at 18638546040.
[0422/094940:WARNING:mpd_builder.cc(1259)] Found a gap of size 15360 > kRoundingErrorGrace (5). The new segment starts at 21527328120 but the previous segment ends at 21527312760.
[0422/115901:WARNING:mpd_builder.cc(1259)] Found a gap of size 3545562936 > kRoundingErrorGrace (5). The new segment starts at 25770763056 but the previous segment ends at 22225200120.
[0422/120435:WARNING:udp_file_posix.cc(112)] UdpFile::Read result -1 11
[0422/120435:WARNING:udp_file_posix.cc(112)] UdpFile::Read result -1 11
[0422/120435:WARNING:udp_file_posix.cc(112)] UdpFile::Read result -1 11
[0422/120435:WARNING:udp_file_posix.cc(112)] UdpFile::Read result -1 11
[0422/120435:INFO:multi_segment_segmenter.cc(37)] MultiSegmentSegmenter outputs init segment: /storage/web/dash/501/edash-video-288.mp4
[0422/120435:INFO:multi_segment_segmenter.cc(43)] MultiSegmentSegmenter does not have index range.
[0422/120435:INFO:multi_segment_segmenter.cc(37)] MultiSegmentSegmenter outputs init segment: /storage/web/dash/501/edash-video-576.mp4
[0422/120435:INFO:multi_segment_segmenter.cc(43)] MultiSegmentSegmenter does not have index range.
[0422/120435:INFO:mp4_muxer.cc(170)] MP4 file '/storage/web/dash/501/edash-video-288.mp4' finalized.
[0422/120435:INFO:mp4_muxer.cc(170)] MP4 file '/storage/web/dash/501/edash-video-576.mp4' finalized.
[0422/120435:INFO:multi_segment_segmenter.cc(37)] MultiSegmentSegmenter outputs init segment: /storage/web/dash/501/edash-video-512.mp4
[0422/120435:INFO:multi_segment_segmenter.cc(43)] MultiSegmentSegmenter does not have index range.
[0422/120435:INFO:multi_segment_segmenter.cc(37)] MultiSegmentSegmenter outputs init segment: /storage/web/dash/501/edash-video-384.mp4
[0422/120435:INFO:multi_segment_segmenter.cc(43)] MultiSegmentSegmenter does not have index range.
[0422/120435:INFO:mp4_muxer.cc(170)] MP4 file '/storage/web/dash/501/edash-video-512.mp4' finalized.
[0422/120435:INFO:multi_segment_segmenter.cc(37)] MultiSegmentSegmenter outputs init segment: /storage/web/dash/501/edash-audio.mp4
[0422/120435:INFO:multi_segment_segmenter.cc(43)] MultiSegmentSegmenter does not have index range.
[0422/120435:INFO:mp4_muxer.cc(170)] MP4 file '/storage/web/dash/501/edash-video-384.mp4' finalized.
[0422/120435:INFO:mp4_muxer.cc(170)] MP4 file '/storage/web/dash/501/edash-audio.mp4' finalized.
from shaka-packager.
Hi KQ,
here are additional logs:
[0426/095141:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 8598842672 <= pending sample dts 8598846272. Sample ignored.
[0426/095141:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 8598840992 <= pending sample dts 8598844592. Sample ignored.
[0426/095141:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 8598840992 <= pending sample dts 8598844592. Sample ignored.
[0426/095141:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 8598846272 <= pending sample dts 8598846272. Sample ignored.
[0426/095141:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 8598844592 <= pending sample dts 8598844592. Sample ignored.
[0426/095141:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 8598844592 <= pending sample dts 8598844592. Sample ignored.
[0426/095141:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 8598844592 <= pending sample dts 8598844592. Sample ignored.
from shaka-packager.
The error in your previous log looks like a network failure:
[0422/120435:WARNING:udp_file_posix.cc(112)] UdpFile::Read result -1 11
[0422/120435:WARNING:udp_file_posix.cc(112)] UdpFile::Read result -1 11
[0422/120435:WARNING:udp_file_posix.cc(112)] UdpFile::Read result -1 11
[0422/120435:WARNING:udp_file_posix.cc(112)] UdpFile::Read result -1 11
From your 2nd log, the code was able to skip some misbehaved samples. Do you see any playback problem?
from shaka-packager.
Hi,
[0427/110833:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 2678400 <= pending sample dts 106459200. Sample ignored.
[0427/110833:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 2682240 <= pending sample dts 106463040. Sample ignored.
[0427/110833:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 2682000 <= pending sample dts 106459200. Sample ignored.
[0427/110833:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 2685840 <= pending sample dts 106463040. Sample ignored.
[0427/110833:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 2682000 <= pending sample dts 106459200. Sample ignored.
[0427/110833:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 2685600 <= pending sample dts 106459200. Sample ignored.
[0427/110833:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 2682000 <= pending sample dts 106459200. Sample ignored.
[0427/110833:WARNING:es_parser_h264.cc(342)] Seeing sample with dts 2685600 <= pending sample dts 106459200. Sample ignored.
With this time difference, I must wait a lot of time before see something.
Seems this is not the right solution.
from shaka-packager.
Em... It is about 20 minutes difference.
What do you expect to see? A continuous playback from sample at 106459200 to sample at 2678400, i.e. treat the sample at 2678400 as the next sample of the sample at 106459200?
from shaka-packager.
Another question:
How does the timestamp progress? Something like (1) or (2)?
(1) A sequence of samples with incorrect timestamp (T-1000 to T-800) are inserted between T+50 and T+51:
T, T+1, T+2, ... T+50, T-1000, T-999, T-998, ... T-801, T-800, T+51, T+52, T+53
(2) T-1000 is the next sample of T+50 (The system adjusts timestamp by 1050):
T, T+1, T+2, ... T+50, T-1000, T-999, T-998, ... T-801, T-800, ...
It will be helpful if you can post the full log.
from shaka-packager.
Hi KQ,
attached file is the log. Not the same as in the previous post, but it's similar.
from shaka-packager.
Ok, so it looks like it is more like case 2 mentioned above. Another solution I have in mind now is to start a new segment when seeing timestamp rolling back. Timeline will be something like:
<SegmentTimeline>
<S t="29865840" d="270000" r="4"/>
<S t="313440" d="270000" r="130"/>
</SegmentTimeline>
It will then be up to player to decide how to handle a timeline like this.
from shaka-packager.
Hi KQ,
can you please explain to me what this line means:
<S t="29865840" d="270000" r="4"/>
Because I'm unable to fully understand it from the spec. I know, that this is not a support forum, but this can help me to implement it properly at the client side.
Peyo
from shaka-packager.
See ISO/IEC 23009-1:2014 5.3.9.6.2 for the semantics of segment timeline. Basically 't' specifies the start time of the segment, and 'd' specifies the duration of the segment, and 'r' specifies the repeat count,
<S t="29865840" d="270000" r="4"/>
is equivalent to
<S t="29865840" d="270000"/>
<S t="30135840" d="270000" r="3"/>
from shaka-packager.
Hi KQ.
I see, that in the standard the only proper solution of this case is to create a new period as you mentioned in #89 . I cannot see any other solution.
The PTS/DTS size is 33 bits, so the maximum continuous incrementing seconds count stored in it is no more than 95443 or a little more than a day. In this case the current SDK without multiple periods support isn't able to play live stream properly more than 95443 seconds. Am I right?
from shaka-packager.
The PTS/DTS size is 33 bits, so the maximum continuous incrementing seconds count stored in it is no more than 95443 or a little more than a day. In this case the current SDK without multiple periods support isn't able to play live stream properly more than 95443 seconds. Am I right?
No, that is not the cause of the problem. Although PTS/DTS is only 33 bits, it should wrap around and restart from 0. Our code handles that internally. We keep an internal base, the actual time stamp is calculated as (base << 33) + pts/dts. Whenever the time stamp wraps around, the internal base is increment by one.
from shaka-packager.
You do that something before fragmenter? Can you show me where?
from shaka-packager.
Sorry for the late reply. Somehow missed your message.
Here is the code to unroll the timestamp:
from shaka-packager.
Closing due to long time of no activity. Feel free to re-open if there is any update.
from shaka-packager.
Related Issues (20)
- Unable to run executable via NPM module on Apple Silicon (even with Rosetta 2 enabled) HOT 1
- ShakaPackager v3 doesn't generate <BaseURL> in MPEG-DASH manifest so that ShakaPlayer cannot play video completely.
- demux error HOT 2
- Packager fails to copy tmp files into place once its done when using a container volume + sshfs mount HOT 8
- Error building shaka packager in windows 10 HOT 2
- NALU length exceeds stream size HOT 2
- error: generic:18 Failed to write playlist HOT 3
- Shaka packager design in document HOT 3
- `ninja -C build pssh-box.py` not working HOT 5
- Packager Adaptation Set Switching values point to representation IDs instead of Adaptation Set IDs. HOT 1
- Error when using long path in input/output (Windows) HOT 4
- Shaka-packager's subtitle output and timing is broken for real-time flows when the input has "gaps/periods" without subtitle streams. HOT 3
- Packager Adaptation Set Switching doesn't work with forced command-line ordering HOT 1
- [DASH] Add content steering support.
- audioSamplingRate in representation is "0" for high sample rates HOT 2
- helpxml removed? HOT 1
- Macro DISALLOW_COPY_AND_ASSIGN include/file.h HOT 5
- For Packaging webm to mpd i am getting (MUXER_FAILURE): Error adding sample to segment: Cluster::AddFrame failed
- Packager doesn't work with macOS Big Sur 11.6 HOT 3
- Local/ Downloaded encrypted videos using Shaka Packager doesn't work on iOS.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shaka-packager.