pytivo icon indicating copy to clipboard operation
pytivo copied to clipboard

Fix size estimation for MPEG-4 transport streams.

Open mhkrebs opened this issue 5 years ago • 3 comments

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.

mhkrebs avatar Aug 08 '20 14:08 mhkrebs

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

wmcbrine avatar Aug 08 '20 14:08 wmcbrine

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 avatar Aug 08 '20 14:08 mhkrebs

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 avatar Aug 08 '20 14:08 mhkrebs