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

Add patch fixing up segment muxer #9

Closed
wants to merge 2 commits into from

Conversation

JustAMan
Copy link
Contributor

@JustAMan JustAMan commented Oct 2, 2019

This should close jellyfin/jellyfin#1694.
Also it provides us the means to add more patches in the future if we wanted to.

This patch was sent to upstream (so we won't have to maintain our custom ffmpeg forever), initial thread is here: http://ffmpeg.org/pipermail/ffmpeg-devel/2019-October/250920.html

@JustAMan JustAMan requested a review from a team October 2, 2019 10:18
@JustAMan JustAMan requested review from a team and Bond-009 October 2, 2019 11:17
Copy link
Member

@nvllsvm nvllsvm left a comment

Choose a reason for hiding this comment

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

Add a link to the request to add this upstream. We shouldn't be maintaining/requiring a fork of ffmpeg.

@JustAMan
Copy link
Contributor Author

JustAMan commented Oct 2, 2019

Add a link to the request to add this upstream. We shouldn't be maintaining/requiring a fork of ffmpeg.

I have already sent this patch to ffmpeg-devel list: http://ffmpeg.org/pipermail/ffmpeg-devel/2019-October/250920.html

This wasn't processed yet, though, and I don't think it would become a part of ffmpeg release in a few weeks, so still makes sense for us to patch our ffmpeg instance faster.

@EraYaN
Copy link
Member

EraYaN commented Oct 2, 2019

This seems to work very nicely on Windows too. my seek to 300.5 seems to get rounded or truncated to 300.3. But that feels close enough.

startInfo.Arguments = string.Format("-report -loglevel warning -hide_banner -progress pipe:2 -vsync passthrough -noaccurate_seek -copyts -ss 300.5 -i \"{0}\" -c:v libx264 -preset veryfast -b:v 80M -segment_time 10 -map 0 -segment_list pipe:1 -segment_list_type csv -f ssegment \"{1}\"", _sourceFile, _outputFilenameFormat);

ChunkServer project output:

[MAIN] Progress: 302.57, Speed: 0.0 fps (5250x), IsEnd: False
[MAIN] Progress: 303.48, Speed: 56.8 fps (2780x), IsEnd: False
[MAIN] Progress: 304.61, Speed: 53.7 fps (1840x), IsEnd: False
[MAIN] Progress: 307.68, Speed: 75.0 fps (1420x), IsEnd: False
[MAIN] Progress: 310.37, Speed: 85.1 fps (1160x), IsEnd: False
[MAIN] Progress: 311.88, Speed: 82.1 fps (97.4x), IsEnd: False
[MAIN] Progress: 313.51, Speed: 81.5 fps (84.6x), IsEnd: False
Created segment F:\Users\Erwin\Videos\segments_test\segment-MAIN-000000000000.ts for timestamps 300.30 to 311.35 for a length of 11.05 with hash C8D56E6478F73EC9
[MAIN] Progress: 314.64, Speed: 77.6 fps (74.3x), IsEnd: False
[MAIN] Progress: 316.32, Speed: 78.1 fps (66.7x), IsEnd: False
[MAIN] Progress: 317.98, Speed: 76.9 fps (59.8x), IsEnd: False
[MAIN] Progress: 319.49, Speed: 76.4 fps (54.8x), IsEnd: False
[MAIN] Progress: 321.05, Speed: 76.2 fps (50.7x), IsEnd: False
[MAIN] Progress: 322.49, Speed: 75.7 fps (47.2x), IsEnd: False
Created segment F:\Users\Erwin\Videos\segments_test\segment-MAIN-000000000001.ts for timestamps 311.35 to 320.49 for a length of 9.13 with hash A5C08F6B5E5AE177
[MAIN] Progress: 323.69, Speed: 74.1 fps (43.9x), IsEnd: False
[MAIN] Progress: 325.11, Speed: 73.8 fps (41.3x), IsEnd: False
[MAIN] Progress: 326.64, Speed: 73.6 fps (390x), IsEnd: False
[MAIN] Progress: 328.87, Speed: 75.6 fps (370x), IsEnd: False
[MAIN] Progress: 330.58, Speed: 75.8 fps (35.2x), IsEnd: False
[MAIN] Progress: 332.02, Speed: 75.5 fps (33.6x), IsEnd: False
Created segment F:\Users\Erwin\Videos\segments_test\segment-MAIN-000000000002.ts for timestamps 320.49 to 330.83 for a length of 10.34 with hash 674139D5093511B3
[MAIN] Progress: 333.12, Speed: 74.3 fps (32.1x), IsEnd: False
[MAIN] Progress: 334.63, Speed: 74.3 fps (30.7x), IsEnd: False
[MAIN] Progress: 336.22, Speed: 74.1 fps (29.4x), IsEnd: False
[MAIN] Progress: 337.78, Speed: 74.2 fps (28.3x), IsEnd: False
[MAIN] Progress: 339.12, Speed: 73.7 fps (27.3x), IsEnd: False
[MAIN] Progress: 341.04, Speed: 74.4 fps (26.4x), IsEnd: False
[MAIN] Progress: 342.67, Speed: 74.5 fps (25.5x), IsEnd: False
Created segment F:\Users\Erwin\Videos\segments_test\segment-MAIN-000000000003.ts for timestamps 330.83 to 340.80 for a length of 9.97 with hash 7E1881863CFBE656
[MAIN] Progress: 344.09, Speed: 74.3 fps (24.7x), IsEnd: False
[MAIN] Progress: 345.41, Speed: 73.8 fps (23.9x), IsEnd: False
[MAIN] Progress: 346.59, Speed: 73.2 fps (23.2x), IsEnd: False
[MAIN] Progress: 347.95, Speed: 72.9 fps (22.5x), IsEnd: False
[MAIN] Progress: 349.75, Speed: 73.1 fps (21.8x), IsEnd: False
[MAIN] Progress: 351.22, Speed: 73.0 fps (21.2x), IsEnd: False
[MAIN] Progress: 352.87, Speed: 73.1 fps (20.7x), IsEnd: False
Gracefully quitting ffmpeg process...
Created segment F:\Users\Erwin\Videos\segments_test\segment-MAIN-000000000004.ts for timestamps 340.80 to 351.06 for a length of 10.26 with hash D350775CC84B0370
Created segment F:\Users\Erwin\Videos\segments_test\segment-MAIN-000000000005.ts for timestamps 351.06 to 352.31 for a length of 1.25 with hash B0F20E21812B2394
[MAIN] Progress: 352.95, Speed: 71.6 fps (20.3x), IsEnd: True
Done. Press any key to exit.

@nvllsvm
Copy link
Member

nvllsvm commented Oct 2, 2019

@JustAMan awesome. Please add that link to the commit message and I'll approve.

You might as well just combine both commits while you're doing that.

@JustAMan
Copy link
Contributor Author

JustAMan commented Oct 2, 2019

@nvllsvm PR description updated

Copy link
Member

@joshuaboniface joshuaboniface left a comment

Choose a reason for hiding this comment

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

Approving as-is. That said:

Based on our Matrix discussions, I don't think we're going to try to port this fix to every possible Linux, Windows, or OSX. This would involve a lot of packaging overhead that I don't think we have time for.

So, that means that this issue will be fixed with our debian-ffmpeg .deb packages, and in the Docker build (I believe this is simple to port in right @nvllsvm?). But other distros will either need to extract the ffmpeg from here, or deal with the bug until our patch is merged upstream.

Given that we're not moving to static builds, I might also want to move the patch into the proper Debian location and have dpkg-buildpackage handle it, instead of this current docker-build.sh-level patching. That depends on how we're going to integrate this with the Docker build though.

@joshuaboniface
Copy link
Member

I'm going to obsolete this PR by implement this as a Debian patch and then having the Dockerfile for Docker builds import the patch.

@JustAMan
Copy link
Contributor Author

JustAMan commented Oct 2, 2019

Re-implemented in #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Video playback will end prematurely
5 participants