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

[HLS] Support Single File TS for HLS. #891

Closed
wants to merge 1 commit into from

Conversation

sr1990
Copy link
Contributor

@sr1990 sr1990 commented Jan 29, 2021

This PR is related to #291.
Example:

../packager 'in=TOS.ts,stream=video,output=tos_video.ts,playlist_name=tos_video.m3u8' \
            'in=TOS.ts,stream=audio,output=tos_audio.ts,playlist_name=tos_audio.m3u8' \
           --hls_master_playlist_output tos.m3u8 

Tested on Exoplayer.

Copy link
Contributor

@kqyang kqyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this feature.

Had a suggestion on using PackedAudio approach instead, which can result in a better and simpler code.

See the inline comments for details.

@@ -1538,6 +1538,13 @@ def testEc3AndHlsSingleSegmentMp4Encrypted(self):
['audio', 'video'], hls=True, test_files=['bear-640x360-ec3.mp4']),
self._GetFlags(encryption=True, output_hls=True))
self._CheckTestResults('ec3-and-hls-single-segment-mp4-encrypted')

def testHlsByterange(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer calling it: testHlsSingleSegmentTs, as "hls-byte-range" could be for mp4 or ts.

@@ -33,12 +33,16 @@
'mp2t_media_parser.h',
'mpeg1_header.cc',
'mpeg1_header.h',
'multi_segment_ts_segmenter.cc',
'multi_segment_ts_segmenter.h',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you align it with the line above it?

}
} else if (output_format == CONTAINER_WEBVTT ||

if (output_format == CONTAINER_WEBVTT ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition should include output_format == CONTAINER_MPEG2TS || too, as TS does not have init segment. Can you also update line 232 too?

@@ -21,7 +23,12 @@ Status TsMuxer::InitializeMuxer() {
if (streams().size() > 1u)
return Status(error::MUXER_FAILURE, "Cannot handle more than one streams.");

segmenter_.reset(new TsSegmenter(options(), muxer_listener()));
if (options().segment_template.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer using the approach in PackedAudio: https://github.com/google/shaka-packager/tree/56908a83a76c85450d6b5834f3aa16e0660f4648/packager/media/formats/packed_audio.

Here is the summary:

I think the code is cleaner and easier to maintain with this structure.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kqyang, thanks for the review. Yes that makes sense. Let me try it out.

@sr1990
Copy link
Contributor Author

sr1990 commented Apr 18, 2021

I had issues with this branch. Creating a new PR and branch at #934

@cosmin
Copy link
Contributor

cosmin commented Feb 15, 2024

Replaced by #934

@cosmin cosmin closed this Feb 15, 2024
joeyparrish pushed a commit that referenced this pull request Feb 23, 2024
This is based on comments at
#891. The muxer is deciding
whether to write to a single file or a segment file based on the
configuration.

Example:
```
../packager 'in=TOS.ts,stream=video,output=tos_video.ts,playlist_name=tos_video.m3u8' \
            'in=TOS.ts,stream=audio,output=tos_audio.ts,playlist_name=tos_audio.m3u8' \
           --hls_master_playlist_output tos.m3u8
```
Tested the content using Exoplayer.

---------

Co-authored-by: Cosmin Stejerean <[email protected]>
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Apr 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants