Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging input to TS for HLS produces negative timestamps which are then unsupported #1290

Open
Hudayberdyyev opened this issue Oct 19, 2023 · 1 comment
Labels
component: HLS The issue involves HLS output type: bug Something isn't working correctly
Milestone

Comments

@Hudayberdyyev
Copy link

Hudayberdyyev commented Oct 19, 2023

System info

Operating System: macOS Soroma, Ubuntu 20.04.

Shaka Packager Version: v2.6.1-634af65-release

Issue and steps to reproduce the problem

Packager Command:

packager \
'in=video_360p.mp4,stream=audio,segment_template=audio/$Number$.aac,playlist_name=audio/main.m3u8,hls_group_id=audio,hls_name=ENGLISH' \
  'in=video_360p.mp4,stream=video,segment_template=360p/$Number$.ts,playlist_name=360p/main.m3u8' \
  --segment_duration 6 \
  --hls_master_playlist_output master.m3u8

Extra steps to reproduce the problem?
(1) Download attached video file
https://github.com/shaka-project/shaka-packager/assets/72361135/ce3bb1de-83f8-46d7-bbac-47cd08dc3b7d
(2) Try to run command above, inside folder where video downloaded:

What is the expected result?
I should get folders: 360p, audio and master.m3u8 file as a transcoded HLS video.

What happens instead?

I've got an error like below:

[1019/174447:INFO:demuxer.cc(89)] Demuxer::Run() on file 'video_360p.mp4'.
[1019/174447:INFO:demuxer.cc(155)] Initialize Demuxer for file 'video_360p.mp4'.
[1019/174447:ERROR:pes_packet_generator.cc(91)] Seeing negative timestamp (9000,-6000) after applying offset 9000. Please check if it is expected. Adjust --transport_stream_timestamp_offset_ms if needed.
[1019/174447:ERROR:demuxer.cc(356)] Failed to process sample 256 11 (MUXER_FAILURE): Failed to add sample to PesPacketGenerator.
[1019/174447:ERROR:mp4_media_parser.cc(889)] Failed to process the sample.
[1019/174447:ERROR:packager_main.cc(554)] Packaging Error: 8 (PARSER_FAILURE): Cannot parse media file video_360p.mp4

Which references to this code.

And I found a solution like below by providing transport_stream_timestamp_offset_ms as 167:

packager --transport_stream_timestamp_offset_ms 167 \
'in=video_360p.mp4,stream=audio,segment_template=audio/$Number$.aac,playlist_name=audio/main.m3u8,hls_group_id=audio,hls_name=ENGLISH' \
  'in=video_360p.mp4,stream=video,segment_template=360p/$Number$.ts,playlist_name=360p/main.m3u8' \
  --segment_duration 6 \
  --hls_master_playlist_output master.m3u8

But I don't understand why ? Can anyone explain what happened here ? And how can i calculate the value of this option to get a successfully transcode process for another videos like this ?
Thanks in advance!

@Hudayberdyyev
Copy link
Author

Can anyone help me with this problem ?
If something is unclear, I will be happy to explain in more detail.

@cosmin cosmin changed the title (PARSER_FAILURE): Cannot parse media file Packaging input to TS for HLS produces negative timestamps which are then unsupported Apr 29, 2024
@cosmin cosmin added type: bug Something isn't working correctly component: HLS The issue involves HLS output labels Apr 29, 2024
@github-actions github-actions bot added this to the v3.1 milestone Apr 29, 2024
@cosmin cosmin removed this from the v3.1 milestone May 7, 2024
@github-actions github-actions bot added this to the v3.2 milestone May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: HLS The issue involves HLS output type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

2 participants