Open Brainiarc7 opened 3 months ago
I believe there is a problem with parsing HEVC with slices in TS, at least some hardware encoders. I think I've seen something similar previously using Nvidia encoded HEVC with slices turned on. From what I recall repackaging the input as fMP4 didn't have an issue so there was something specific in the interaction of TS + HEVC with slices. Turning off slices in the encoder by using a different preset also didn't have any issues. But I never had a chance to dig into it beyond that.
A file to reproduce the problem would really help though.
I'll request for permission on the streams sample, thank you.
On Thu, 7 Mar 2024, 20:04 Cosmin Stejerean, @.***> wrote:
I believe there is a problem with parsing HEVC with slices in TS, at least some hardware encoders. I think I've seen something similar previously using Nvidia encoded HEVC with slices turned on. From what I recall repackaging the input as fMP4 didn't have an issue so there was something specific in the interaction of TS + HEVC with slices. Turning off slices in the encoder by using a different preset also didn't have any issues. But I never had a chance to dig into it beyond that.
A file to reproduce the problem would really help though.
— Reply to this email directly, view it on GitHub https://github.com/shaka-project/shaka-packager/issues/1363#issuecomment-1984016747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR7NB56BIZYWHQU6WHIOBLYXCM3DAVCNFSM6AAAAABELBWXQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBUGAYTMNZUG4 . You are receiving this because you authored the thread.Message ID: @.***>
See the linked sample, @cosmin
Confirm you have access to the media sample.
@Brainiarc7 unfortunately I was traveling last week with minimal connectivity and I was not able to download the file. I tried a couple of times but it eventually timed out before the download completed (as the file was a few hundred MB). I'm back to proper internet but the download link has expired. Could you please re-share it?
Here goes, @cosmin . Thank you!
@Brainiarc7 thank you, I was able to download the sample and can repro the problem locally. I'll follow up once I determine what the problem is.
Ok, doing a little digging through the debugger I believe the problem lies within EsParserH26x::EmitFrame
It pops the current_timing_desc
from timing_desc_list_
which works for the single slice per frame case, however when multiple slices are being used the TimingDesc
has already been consumed it ends up returning false in the
if (current_timing_desc.pts == kNoTimestamp)
return false;
which then results in the errors seen
es_parser_h26x.cc:276] Failure while parsing Mpeg2TS: EmitFrame(current_access_unit_position_, next_access_unit_position_ - current_access_unit_position_, current_video_slice_info_.is_key_frame, current_video_slice_info_.pps_id)
es_parser_h26x.cc:255] Failure while parsing Mpeg2TS: EmitCurrentAccessUnit()
I believe this might require some structural changes to es_parser_h26x.cc
to handle the case of multiple slices per access unit before calling EmitFrame.
System info
Operating System: Ubuntu 22.04LTS Shaka Packager Version: git tip master
Issue and steps to reproduce the problem:
Packaging any UDP input from a Teradek encoder errors out with:
If I re-encode the input stream on the fly via
ffmpeg
, shaka-packager works without a problem. Softvelum's Nimble streamer is also able to package this content on the fly without transcoding, only Shaka, for some reason, rejects it.I cannot share the stream specifics here as it's copy-righted.
Any pointers?