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

Option to resize 198p to 360p during concat #4

Closed
wlerin opened this issue Jan 1, 2017 · 1 comment
Closed

Option to resize 198p to 360p during concat #4

wlerin opened this issue Jan 1, 2017 · 1 comment

Comments

@wlerin
Copy link
Owner

wlerin commented Jan 1, 2017

The most common resolutions are 360p and 198p. Add an --aggressive (or just --resize) option to concat to resize 198p videos to 360p, in order to reduce the number of output videos.

The Problem:
Occasionally, during times of high network congestion or for whatever other reason, showroom streams get reduced from 360p to 198p. Such streams are blocky and almost unwatchable, and usually don't last very long. However, the audio is still intact. Unfortunately, they can't be merged with 360p streams without being re-scaled (and losing data).

The Old Solution:
When I originally wrote concat.py, I opted to keep 360p and 198p separate rather than rescale in order to preserve as much of the original video data as possible. However... occasionally this results in a single stream getting split into 10+ videos of alternating 360p and 198p, and it's not like rescaling is going to make the video look noticeably worse.

The New Solution:
Add a --resize option to concat.py to complement the --generate and --merge options, and an --aggressive option that runs all three (--both will still only run --generate and --merge). --resize will work as follows:

  • scan the directory for 198p files
  • rename each 198p to resized/{filename}_198p.mp4
  • rescale each 198p to 360p (giving the new file the old name) w/ -crf 18

Occasionally streams also come in 396p and 720p, but these are rare (720p has only been seen once) and usually differ in other ways (e.g. 396p have lower frame rates), so this option will not affect them.

@wlerin wlerin self-assigned this Jan 1, 2017
wlerin added a commit that referenced this issue Jan 1, 2017
wlerin added a commit that referenced this issue Jan 1, 2017
wlerin added a commit that referenced this issue Jan 2, 2017
* Resize Videos (Issue #4)

* Resize Videos (Issue #4)

* Option to set resize bitrate

* Fix bitrate option (N.B. test before pushing)
@wlerin
Copy link
Owner Author

wlerin commented Jan 2, 2017

Instead of using -crf 18, added --bitrate option to specify the target bitrate for resized videos (defaults to 300k). Otherwise the new feature works as described above.

@wlerin wlerin closed this as completed Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant