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

Fix size estimation for MPEG-4 transport streams. #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mhkrebs
Copy link

@mhkrebs mhkrebs commented Aug 8, 2020

This can reduce the number of programs that TiVo deletes upon their transfer.

TiVo requests the expected transfer size before it tries to actually transfer
a file, and it does not send a desired MIME type along with that request. When
that MIME type is missing and the vCodec is "h264", tivo_compatible_video()
returned false -- which resulted in __est_size() estimating the size as if it
will transcode the video. And, without also having this fix in
tivo_compatible_container(), that estimated size can be 2-3 times too big
because the bitrate may not reflect what's in the actual file.

… number of

programs that TiVo deletes upon their transfer.

TiVo requests the expected transfer size *before* it tries to actually transfer
a file, and it does not send a desired MIME type along with that request.  When
that MIME type is missing and the vCodec is "h264", tivo_compatible_video()
returned false -- which resulted in __est_size() estimating the size as if it
will transcode the video.  And, without also having this fix in
tivo_compatible_container(), that estimated size can be 2-3 times too big
because the bitrate may not reflect what's in the actual file.
@wmcbrine
Copy link
Owner

wmcbrine commented Aug 8, 2020

It would probably make sense to condition this assumption of compatibility on the model of the requesting TiVo.

@mhkrebs mhkrebs marked this pull request as ready for review August 8, 2020 14:46
@mhkrebs
Copy link
Author

mhkrebs commented Aug 8, 2020

Ah, that makes sense. I was about to suggest that you could fix it in a better way if you want. I was aiming for something simple, and I'm not a huge python user.

BTW, the context for this is in https://www.tivocommunity.com/community/index.php?threads/working-details-of-going-away-soon-space-needed-deletes.560372/

@mhkrebs mhkrebs marked this pull request as draft August 8, 2020 14:53
@mhkrebs
Copy link
Author

mhkrebs commented Aug 8, 2020

Cool, I found that is_ts_capable() function and added a call to that.

Feel free to scrap this all and do something else, of course. :)

@mhkrebs mhkrebs marked this pull request as ready for review August 8, 2020 14:57
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.

2 participants