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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions plugins/video/transcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@ def tivo_compatible_video(vInfo, tsn, mime=''):
message = (False, 'vCodec %s not compatible' % codec)

break
# Some requests from the TiVo don't have an associated MIME type. In
# that case assume an 'h264' codec is going to be compatible.
if config.is_ts_capable(tsn) and mime == '' and codec == 'h264':
logger.debug('Assuming vCodec %s will be compatible', codec)
break

if codec not in ('mpeg2video', 'mpeg1video'):
message = (False, 'vCodec %s not compatible' % codec)
Expand Down Expand Up @@ -610,9 +615,14 @@ def tivo_compatible_audio(vInfo, inFile, tsn, mime=''):

return message

def tivo_compatible_container(vInfo, inFile, mime=''):
def tivo_compatible_container(vInfo, inFile, tsn, mime=''):
message = (True, '')
container = vInfo.get('container', '')
# Some requests from the TiVo don't have an associated MIME type. In
# that case assume a 'mpegts' container is going to be compatible.
if (config.is_ts_capable(tsn) and mime == '' and container == 'mpegts'):
logger.debug('Assuming container %s will be compatible', container)
return message
if ((mime == 'video/x-tivo-mpeg-ts' and container != 'mpegts') or
(mime in ['video/x-tivo-mpeg', 'video/mpeg', ''] and
(container != 'mpeg' or vInfo['vCodec'] == 'mpeg1video'))):
Expand Down Expand Up @@ -640,7 +650,7 @@ def tivo_compatible(inFile, tsn='', mime=''):
message = amessage
break

cmessage = tivo_compatible_container(vInfo, inFile, mime)
cmessage = tivo_compatible_container(vInfo, inFile, tsn, mime)
if not cmessage[0]:
message = cmessage

Expand Down