-
-
Notifications
You must be signed in to change notification settings - Fork 412
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 FFmpegHlsOutputBuilder for HLS user #322
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.
Awesome, I think this will be super useful.
I added a few comments. Please take a look.
Also adding @Euklios as he has plans to change FFmpegOutputBuilder, and I want to make sure this doesn't conflict.
* @return {@link FFmpegHlsOutputBuilder} | ||
*/ | ||
public FFmpegHlsOutputBuilder setHlsListSize(int size){ | ||
checkArgument(size>0, "Size cannot be less than 0."); |
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.
Size cannot be less than or equal to zero.
Maybe easier to write, Size must be positive (e.g like here:
ffmpeg-cli-wrapper/src/main/java/net/bramp/ffmpeg/builder/FFmpegOutputBuilder.java
Line 148 in f315cfc
checkArgument(bit_rate > 0, "bit rate must be positive"); |
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 understand, but according to the ffmpeg document
hls_list_size size
Set the maximum number of playlist entries. If set to 0 the list file will contain all the segments. Default value is 5.
So I wrote it like that. What do you think?
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.
Ah, but your code checks it's greater than zero, where your comment says can't be less than zero, so there is a mismatch there.
Seems like it should be checkArgument(size >= 0,...)
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.
Oh, I made a mistake 😥. Thank you
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.
Correct, size == 0
is basically required for VOD, I would add a test for this scenario specifically as well.
src/main/java/net/bramp/ffmpeg/builder/FFmpegHlsOutputBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/net/bramp/ffmpeg/builder/FFmpegHlsOutputBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/net/bramp/ffmpeg/builder/AbstractFFmpegStreamBuilder.java
Outdated
Show resolved
Hide resolved
I just noticed and haven't looked at the implementation yet, but I love the idea. |
Thank you for your response. @Euklios 😁 I don't think there's any difference in the outcome in the simple case. |
src/main/java/net/bramp/ffmpeg/builder/FFmpegHlsOutputBuilder.java
Outdated
Show resolved
Hide resolved
I've thought of several ways, and I think it's better to make I have committed to completing the development, and pass existing tests and newly added tests. and if you have any better opinions, I am always welcome. Please check it. Thank you. 😁 |
Ok, the changes all look good. Thanks a lot of the work. Can we resolve the conflict, then we'll run the github test actions, and we are good to go. |
HI, @bramp |
Thank reply @Euklios And can I know about the future update plan? |
Hi, @bramp
I've been using the HLS format of ffmpeg with
.addExtraArgs()
. But I think it's too uncomfortableSo, I made an
FFmpegHlsOutputBuilder
for HLS user, what do you think?Thank You.
Before
After