-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add support for skip_encryption stream descriptor #219
Conversation
There was a problem hiding this 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. Look goods to me. I just have one comment.
packager/app/packager_main.cc
Outdated
" Name of the playlist for the stream. Usually ends with '.m3u8'.\n"; | ||
" Name of the playlist for the stream. Usually ends with '.m3u8'.\n" | ||
" - skip_encryption: Optional value which specifies if encryption of\n" | ||
" the stream shall be skipped. By default, if encryption is enabled,\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it clear that it expects a numeric value instead of "true|false", e.g.
skip_encryption: Optional, if set to nonzero, encryption of the stream shall be skipped. ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point! I'll have a go at fixing it.
I'm actually considering if one should allow setting skip_encryption=true, since it perhaps reads a bit better. Let me know if you have any particular preference here!
I also have to mention: Thank you for the friendly and good feedback I've gotten from you during the last few days! :) I personally find it very encouraging!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with both. I am slightly leaning towards 0|1 for consistency since we also use 0|1 in udp options.
I also have to mention: Thank you for the friendly and good feedback I've gotten from you during the last few days! :) I personally find it very encouraging!
No problem. Thanks for your work on improving shaka-packager :-)
f05557a
to
76d22fd
Compare
@sylt Are you still working on this? Are you still interested in completing this pull request? Thanks. |
76d22fd
to
d4b3fac
Compare
Thanks for the reminder! I must have done something wrong or misunderstood something, but I did update the pull-request with your suggestions in March (as in, the diff looked up-to-date when I checked this PR). I thought that github would send some sort of notification of this being done, but maybe that's not the case. Sigh, I need to read up on this :) Anyway, I have rebased my change-set, so the pull-request should be up-to-date now (with your suggestions incorporated). |
d4b3fac
to
d3472f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Github won't send out a notification on updated commits automatically. You'll need to post a message - typically reply on review comments :)
A few more nit comments.
packager/app/test/packager_test.py
Outdated
@@ -593,6 +593,16 @@ def testPackageWithLiveProfileAndKeyRotationAndNonDashIfIop(self): | |||
self.mpd_output, | |||
'bear-640x360-av-live-cenc-rotation-non-iop-golden.mpd') | |||
|
|||
def testPackageWithEncryptionOfOnlyVideoStream(self): | |||
self.packager.Package( | |||
self._GetStreams(['audio', 'video'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer something like
self.packager.Package(self._GetStreams(['audio,skip_encryption=1','video']), ....)
It is more flexible and probably clearer as well.
The changes in _GetStreams is not needed.
packager/app/test/packager_test.py
Outdated
self._GetFlags(encryption=True)) | ||
self._DiffGold(self.output[0], 'bear-640x360-a-golden.mp4') | ||
self._DiffGold(self.output[1], 'bear-640x360-v-cenc-golden.mp4') | ||
self._DiffGold(self.mpd_output, 'bear-640x360-a-clear-v-venc-golden.mpd') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/venc/cenc/
packager/app/test/packager_test.py
Outdated
@@ -593,6 +593,16 @@ def testPackageWithLiveProfileAndKeyRotationAndNonDashIfIop(self): | |||
self.mpd_output, | |||
'bear-640x360-av-live-cenc-rotation-non-iop-golden.mpd') | |||
|
|||
def testPackageWithEncryptionOfOnlyVideoStream(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this function after line 242, i.e. after testPackageWithEncryption?
packager/app/packager_main.cc
Outdated
@@ -107,7 +107,10 @@ const char kUsage[] = | |||
" The group ID for the output stream. For HLS this is used as the\n" | |||
" GROUP-ID attribute for EXT-X-MEDIA.\n" | |||
" - playlist_name: Required for HLS output.\n" | |||
" Name of the playlist for the stream. Usually ends with '.m3u8'.\n"; | |||
" Name of the playlist for the stream. Usually ends with '.m3u8'.\n" | |||
" - skip_encryption: Optional. If this is set to a non-zero value,\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description does not match what is implemented, rephrase it as:
- skip_encryption=0|1: Optional. Default to 0 if not specified. If it is set to 1, ...
d3472f0
to
4418b6c
Compare
This option makes it possible to control encryption for specific streams, i.e. for audio and video separately.
4418b6c
to
dbbf600
Compare
All comments accepted/handled! Much better :) Pull request has been updated. Let's see! |
@sylt LGTM. Thanks for coming up with the idea and working on this! Your contribution is appreciated! |
Will merge once continuous integration tests pass. |
This option makes it possible to control encryption for specific streams, i.e. for audio and video separately.
In my set-up, I want to have the ability to control which tracks gets to be encrypted or not (in my case, I wanted the sound to be in clear). I though that others perhaps wanted this capability as well, hence the pull request.
It's possible though that the maintainers think otherwise :) Let's have a try.