So I have been playing around with PyTiVo for some time now as a way to teach myself Python and add some features that I have always wanted. I started thinking it was time to upgrade my main TV to 4K and so i was reviewing all the discussions about 4K video and whether it was possible to get a file uploaded to the Bolt for playback. I prefer an uploaded file over streaming because I really like having all the TiVo trickplay remote control commands that streaming seems to be so poor with.
The PyTivo code is quite versatile in that it handles many files of various configurations quite well. But it is a bear to read through especially if you are new to the language and trying to figure out all the places that might need to be changed to support 4K videos.
I decided to start fresh and do the bare minimum in constructing a very basic ffmpeg command to accomplish this. So my plan was to add code just before the standard command that PyTivo had constructed is issued to ffmpeg. This code checks a few conditions and if they are true, constructs its own ffmpeg bare minimum copy command with no overrides.
I added code that first looked at the first three characters of the TSN of the TiVo requesting the upload. If it was equal to 849, which is the first 3 chars of my Bolt, I then looked at the width and height of the input file. If those were 3840 and 2160 I then substituted the original PyTivo command with a more basic command.
Basically that command is just 'ffmpeg -i input.mkv -c copy -f mpegts -'.
Replace the input.mkv with the full path name, in my example it was:
E:\A.Perfect.Planet.S01E02.HLG.2160p.WEB.H265-GLHF[rartv]\A.Perfect.Planet.S01E02.HLG.2160p.WEB.H265-GLHF.mkv
The files I have tested with load to the Bolt, they play fine, the one that has 5.1 is showing as DolbyD on my audio receiver and the information screen on the TiVo shows 2160p. So far I have uploaded two different videos. This code would probably need tweaking to handle other 4k files that may not have the 3840x2160 dimensions. But this was a proof of concept to see if anything would ever work.
The PyTivo code is quite versatile in that it handles many files of various configurations quite well. But it is a bear to read through especially if you are new to the language and trying to figure out all the places that might need to be changed to support 4K videos.
I decided to start fresh and do the bare minimum in constructing a very basic ffmpeg command to accomplish this. So my plan was to add code just before the standard command that PyTivo had constructed is issued to ffmpeg. This code checks a few conditions and if they are true, constructs its own ffmpeg bare minimum copy command with no overrides.
I added code that first looked at the first three characters of the TSN of the TiVo requesting the upload. If it was equal to 849, which is the first 3 chars of my Bolt, I then looked at the width and height of the input file. If those were 3840 and 2160 I then substituted the original PyTivo command with a more basic command.
Basically that command is just 'ffmpeg -i input.mkv -c copy -f mpegts -'.
Replace the input.mkv with the full path name, in my example it was:
E:\A.Perfect.Planet.S01E02.HLG.2160p.WEB.H265-GLHF[rartv]\A.Perfect.Planet.S01E02.HLG.2160p.WEB.H265-GLHF.mkv
The files I have tested with load to the Bolt, they play fine, the one that has 5.1 is showing as DolbyD on my audio receiver and the information screen on the TiVo shows 2160p. So far I have uploaded two different videos. This code would probably need tweaking to handle other 4k files that may not have the 3840x2160 dimensions. But this was a proof of concept to see if anything would ever work.