# AVCHD (.mts) to Tivo, preferably lossless



## dr_m (May 29, 2011)

Hi.

I spent hours searching the forums here and elsewhere and can't find a definitive answer to my questions. If they are already answered elsewhere, please point me in the right direction(s). If not, here goes:

I've got some AVCHD video files (.mts extension) recorded on a Sony HDR CX110. I'd like to move these to my Tivo HD for viewing on my TV. I am a Mac user and have the latest pyTivoX installed. I'd like to get the files to the Tivo with no (or as little as possible) transcoding. I'll post mediainfo output below. I've read that pyTivo/streambaby should push the .mts file without transcoding, but that doesn't seem to be the case for me. I've tried de/remuxing the files into mp4s, but these also end up transcoding. I've tried a few different things using ffmpeg, tsMuxer, MP4box, but now I'm just getting confused. Does anyone have a good solution for this?

Anthony

Here is the mediainfo report on the original .mts file: 

General / Container Stream # 1
Total Video Streams for this File -> 1
Total Audio Streams for this File -> 1
Video Codecs Used -> AVC
Audio Codecs Used -> AC3
File Format -> BDAV
Play Time -> 47s 520ms
Total File Size -> 65.6 MiB
Total Stream BitRate -> 11.6 Mbps
Video Stream # 1
Codec (Human Name) -> AVC
Codec Profile -> [email protected]
Frame Width -> 1 440 pixels
Frame Height -> 1 080 pixels
Frame Rate -> 29.970 fps
Total Frames -> 1423
Display Aspect Ratio -> 16/9
Scan Type -> Interlaced
Scan Order -> TFF
Colorimetry -> 4:2:0
Codec Settings (Summary) -> CABAC / 2 Ref Frames
QF (like Gordian Knot) -> 0.233
Codec Settings (CABAC) -> Yes
Video Stream Length -> 47s 480ms
Video Stream BitRate -> 10.9 Mbps
Bit Depth -> 24 bits
Video Stream Size -> 61.5 MiB (94%)
Audio Stream # 1
Codec -> AC-3
Audio Stream Length -> 47s 520ms
Audio Stream BitRate -> 256 Kbps
Audio Stream BitRate Mode -> CBR
Number of Audio Channels -> 2
Audio Channel's Positions -> L R
Sampling Rate -> 48.0 KHz
Audio Stream Delay -> 1s 33ms
Audio Stream Size -> 1.45 MiB (2%)


----------



## wmcbrine (Aug 2, 2003)

You need the very most recent changes to pyTivo to avoid transcoding with this type of file. I don't know if they've made their way into pyTivoX yet.

However, I'd think that a manually remuxed file would work. Note that only pushing (from the web interface), not pulling (from the TiVo), will prevent reencoding.


----------



## dr_m (May 29, 2011)

Thanks for the quick reply. I also suspect that pyTivoX doesn't have the latest code. Maybe I'll try installing pyTivo myself. If I try the manual remuxing method again, what would you recommend? ffmpeg? which options?


----------



## wmcbrine (Aug 2, 2003)

ffmpeg -i file.mts -vcodec copy -acodec copy file.mp4


----------



## dr_m (May 29, 2011)

Not there yet.

I manually installed the latest pyTivo, tried to push the mts file directly, but gave up on that. I remuxed the mts to an mp4 with ffmpeg. This worked and look great played on VLC. However when I push this file to the Tivo, it seems to get stuck at some point in the process. I get a blue light on the Tivo, and it says it is transferring, but it never goes beyond 0:00 in duration. If I try to cancel the download on the Tivo, I get stuck at a please wait screen and then I have to restart the Tivo by unplugging it.

I'm include the pyTivo output in case there are any clues in there.


```
DEBUG:pyTivo.video.transcode:CACHE HIT! /Volumes/MacintoshHD/Users/anthash/Documents/TV_Shows/anjana-piano.mp4
DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, /Volumes/MacintoshHD/Users/anthash/Documents/TV_Shows/anjana-piano.mp4
INFO:pyTivo:192.168.1.8 [30/May/2011 06:48:23] "GET /MyMovies/anjana-piano.mp4?Format=video%2Fmp4 HTTP/1.1" 206 -
INFO:pyTivo.video.video:[30/May/2011 06:48:23] Start sending "/Volumes/MacintoshHD/Users/anthash/Documents/TV_Shows/anjana-piano.mp4" to Downstairs
DEBUG:pyTivo.video.video:"/Volumes/MacintoshHD/Users/anthash/Documents/TV_Shows/anjana-piano.mp4" is tivo compatible
DEBUG:pyTivo.video.qt-faststart:Getting index of top level atoms...
DEBUG:pyTivo.video.qt-faststart:ftyp: 32
DEBUG:pyTivo.video.qt-faststart:free: 8
DEBUG:pyTivo.video.qt-faststart:mdat: 64661145
DEBUG:pyTivo.video.qt-faststart:moov: 41049
INFO:pyTivo.video.qt-faststart:Removing free atom at 32 (8 bytes)
INFO:pyTivo.video.qt-faststart:Patching stco with 2850 entries
INFO:pyTivo.video.qt-faststart:Patching stco with 1486 entries
INFO:pyTivo.video.qt-faststart:Writing output...
```


----------



## moyekj (Jan 24, 2006)

If the mp4 is > 4GB in my past experience pyTivo's qt-faststart procedure fails. Haven't tried newer version though to see if the problem is still there. Only fix is to manually run the original c code version of qt-faststart on the mp4 before attempting a pyTivo push.


----------



## dr_m (May 29, 2011)

I'll look into qt-faststart. However, my mp4 is well under 4 GB.


----------



## dr_m (May 29, 2011)

Well, after a little searching, no luck. That qt-faststart link is to a .exe. I tried a few mac versions, but couldn't get anywhere.


----------



## orangeboy (Apr 19, 2004)

dr_m said:


> Well, after a little searching, no luck. That qt-faststart link is to a .exe. I tried a few mac versions, but couldn't get anywhere.


Try this one: https://github.com/danielgtaylor/qtfaststart


----------



## dr_m (May 29, 2011)

orangeboy, thanks for that. I found that before, but obviously didn't download the right thing. I got it now, ran it, and have a new mp4. However this one isn't transferring either. The Tivo still reads duration 0:00 with the transfer in progress, but it never actually transfers. I have successfully transferred video in the past using pyTivo, but I've never seen this issue.

I'm pasting the pyTivo and mediainfo output below. From what I can see, this file should be compatible with the Tivo, but maybe pyTivo just "thinks" it is. Am I missing something obvious?


```
DEBUG:pyTivo.video.transcode:CACHE HIT! /Volumes/MacintoshHD/Users/anthash/Documents/TV_Shows/anjana-piano-qt.mp4
DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, /Volumes/MacintoshHD/Users/anthash/Documents/TV_Shows/anjana-piano-qt.mp4
INFO:pyTivo:192.168.1.8 [31/May/2011 07:21:58] "GET /MyMovies/anjana-piano-qt.mp4?Format=video%2Fmp4 HTTP/1.1" 206 -
INFO:pyTivo.video.video:[31/May/2011 07:21:58] Start sending "/Volumes/MacintoshHD/Users/anthash/Documents/TV_Shows/anjana-piano-qt.mp4" to Downstairs
DEBUG:pyTivo.video.video:"/Volumes/MacintoshHD/Users/anthash/Documents/TV_Shows/anjana-piano-qt.mp4" is tivo compatible
DEBUG:pyTivo.video.qt-faststart:Getting index of top level atoms...
DEBUG:pyTivo.video.qt-faststart:ftyp: 32
DEBUG:pyTivo.video.qt-faststart:moov: 41049
DEBUG:pyTivo.video.qt-faststart:mdat: 64661145
DEBUG:pyTivo.video.qt-faststart:mp4 already streamable -- copying
```
*** MediaInfo Mac // Plain text file report
2011-05-31 07:30:45 -0400
Information for File: anjana-piano-qt.mp4

General / Container Stream # 1
Total Video Streams for this File -> 1
Total Audio Streams for this File -> 1
Video Codecs Used -> AVC
Audio Codecs Used -> AC3
File Format -> MPEG-4
Play Time -> 47s 552ms
Total File Size -> 61.7 MiB
Total Stream BitRate -> 10.9 Mbps
Encoded with -> Lavf52.50.0

Video Stream # 1
Codec (Human Name) -> AVC
Codec (FourCC) -> avc1
Codec Profile -> [email protected]
Frame Width -> 1 440 pixels
Frame Height -> 1 080 pixels
Frame Rate -> 59.940 fps
Total Frames -> 2850
Display Aspect Ratio -> 16/9
Scan Type -> Interlaced
Scan Order -> TFF
Colorimetry -> 4:2:0
Codec Settings (Summary) -> CABAC / 2 Ref Frames
QF (like Gordian Knot) -> 0.114
Codec Settings (CABAC) -> Yes
Video Stream Length -> 47s 547ms
Video Stream BitRate -> 10.6 Mbps
Video Stream BitRate Mode -> VBR
Bit Depth -> 24 bits
Video Stream Size -> 60.2 MiB (98%)
Date of Original Encoding -> UTC 1970-01-01 00:00:00

Audio Stream # 1
Codec -> AC-3
Codec (FourCC) -> ac-3
Audio Stream Length -> 47s 552ms
Audio Stream BitRate -> 256 Kbps
Audio Stream BitRate Mode -> CBR
Number of Audio Channels -> 2
Audio Channel's Positions -> L R
Sampling Rate -> 48.0 KHz
Bit Depth -> 16 bits
Audio Stream Size -> 1.45 MiB (2%)
Date of Original Encoding -> UTC 1970-01-01 00:00:00


----------



## dr_m (May 29, 2011)

Just found this in another thread: http://www.tivocommunity.com/tivo-vb/showthread.php?t=469434



> For mp4s that are correctly built, they tranfer as is and very fast.
> 
> mp4 container with the first track h.264 video, AVC high profile level 4.1 or lower. Second track audio, ac3 5.1 at 640kbps or less. The file should be muxed into IMSA standard mp4 container optimized for streaming.


Any chance that my mp4 isn't working because it has a 2.0 audio track?


----------



## jcthorne (Jan 28, 2002)

1440x1080 is 4:3 not 16:9 and tivo expects 1080i content to be PAR 1:1 per HD broadcast standards, not anamorphic. This file will likely need to be reencoded for proper playback on a Tivo.

Is the original file really 16:9 aspect when played back correctly?


----------



## jcthorne (Jan 28, 2002)

dr_m said:


> Just found this in another thread: http://www.tivocommunity.com/tivo-vb/showthread.php?t=469434
> 
> Any chance that my mp4 isn't working because it has a 2.0 audio track?


No, AC3 2.0 at 256kbps is fine. I think its the video. Also usually when tivo does not like the audio, it still transfers and plays...in silence.


----------



## dr_m (May 29, 2011)

It really is 16:9, or at least that is how it plays on VLC. This is for both the original mts and the mp4. I did notice something peculiar (although most likely irrelevant): in VLC, the original mts file plays back fine but shows a duration of 00:00, while the mp4 shows the correct duration of 00:47.

I made the mp4 following wmcbrine's suggestion above:
ffmpeg -i file.mts -vcodec copy -acodec copy file.mp4

Below I'm pasting the video stream info for each file. Maybe there is something in there? Why the difference in framerate between the two?

*MTS INFO*
Codec (Human Name) -> AVC
Codec Profile -> [email protected]
Frame Width -> 1 440 pixels
Frame Height -> 1 080 pixels
Frame Rate -> 29.970 fps
Total Frames -> 1423
Display Aspect Ratio -> 16/9
Scan Type -> Interlaced
Scan Order -> TFF
Colorimetry -> 4:2:0
Codec Settings (Summary) -> CABAC / 2 Ref Frames
QF (like Gordian Knot) -> 0.233
Codec Settings (CABAC) -> Yes
Video Stream Length -> 47s 480ms
Video Stream BitRate -> 10.9 Mbps
Bit Depth -> 24 bits
Video Stream Size -> 61.5 MiB (94%)

*
MP4 INFO*
Codec (Human Name) -> AVC
Codec (FourCC) -> avc1
Codec Profile -> [email protected]
Frame Width -> 1 440 pixels
Frame Height -> 1 080 pixels
Frame Rate -> 59.940 fps
Total Frames -> 2850
Display Aspect Ratio -> 16/9
Scan Type -> Interlaced
Scan Order -> TFF
Colorimetry -> 4:2:0
Codec Settings (Summary) -> CABAC / 2 Ref Frames
QF (like Gordian Knot) -> 0.114
Codec Settings (CABAC) -> Yes
Video Stream Length -> 47s 547ms
Video Stream BitRate -> 10.6 Mbps
Video Stream BitRate Mode -> VBR
Bit Depth -> 24 bits
Video Stream Size -> 60.2 MiB (98%)
Date of Original Encoding -> UTC 1970-01-01 00:00:00


----------



## jcthorne (Jan 28, 2002)

Again, 1440 x 1080 is NOT 16:9 aspect ratio. If it is intended to play as such, then the encode is anamorphic and will not play on the tivo at this resolution. Tivo only handles anamorphic video for 480i resolution.

The video will need to be reencoded for tivo to play it.

The 'difference' in frame rate is ffmpeg's inability to build proper mp4 file headers. The video streams themselves are exactly the same, just in different containers.


----------



## dr_m (May 29, 2011)

Thanks jcthorne. What a pain! This AVC-HD format is really turning out to be inconvenient.

Can someone advise (based on the info I've given so far) what would be the best (most lossless) way to reencode for Tivo transfer/playback (preferably using free or open source tools)?

One more thing. Is there a way to crop rather than reencode?

Anthony


----------



## jeff92k7 (Jan 18, 2006)

dr_m said:


> Thanks jcthorne. What a pain! This AVC-HD format is really turning out to be inconvenient.
> 
> Can someone advise (based on the info I've given so far) what would be the best (most lossless) way to reencode for Tivo transfer/playback (preferably using free or open source tools)?
> 
> ...


I've been following your thread as I am very interested in doing something similar. However, my situation is a little different, so it may or may not help you. Also, I'm coming from a "prosumer" perspective rather than a home user, so my view may not be completely relevant.

The AVCHD format seems to be what most camcorders are going to now. There are still some HDV camcorders available, but more and more, camcorders are using the AVCHD format. (I'm talking real cameras, not the litle flip cameras that are nothing more than toys).

Even now, support for editing and converting AVCHD encoded content is not as widespread as it should be. Until it becomes far more common, transcoding AVCHD content will be difficult and time consuming. There are some programs that can convert, but it is certainly not easy and straight forward. Further, it's not helpful that there are different pixel aspect ratios and bitrates within the AVCHD spec. You're running into this with your 1440x1080 16:9 framed content as jcthorne mentioned. Since it's not a square pixel aspect ratio, it sounds like Tivo won't play it.

What I do is to take the AVCHD content from my camera, and dump it into Sony Vegas. I edit my content as needed, and then render out a Sony AVC file in an MP4 container with 1920x1080 60i specs. I think I tried a MainConcept AVC .MP4 format too, which worked okay. Regardless, once it renders (which takes a while), I end up with an .MP4 file that I can push to my tivos using pyTivo. Those files play beautifully.

Now, by editing the content in Vegas, it doesn't matter what pixel ratio (1440x1080, or 1920x1080) or bitrate (24, 17, 12, lower) my camera content is in. Vegas handles it with no problem.

Granted, it does take time to render, but I'm willing to live with it - mainly because I'm used to it. I've been editing video content for years and it's just part of the process. If I want a quick and dirty way to see the raw content on my tv, I plug my camera in directly via HDMI.

Now, this may not apply to you since you use a Mac, and you want to avoid spending money, but nonetheless, it is what I have found to work the best.

I just don't see any way to view the content directly on a tivo without re-encoding it to a properly formatted .MP4 file. Unless TV providers start encoding broadcast content as AVCHD (h.264), then tivo will likely never support the raw files. They will always have to be re-encoded to a format that tivo supports - currently mpeg2 and mp4 (the current digital broadcast standards).

AVCHD is a great format for content producers, but it isn't a good format for consumers (tivo's market) with the exception of AVC encoded Blu-Ray discs.

Jeff


----------



## dr_m (May 29, 2011)

Okay, so back to my original(ish) question: what is the best way to get my video to the Tivo? If I have to reencode it, what is the best method? At this point, I can't just let pyTivo do the transcoding. It thinks it is converting the original mts file into something which can be pushed to the Tivo, but it doesn't work.


----------



## wmcbrine (Aug 2, 2003)

jcthorne said:


> Again, 1440 x 1080 is NOT 16:9 aspect ratio. If it is intended to play as such, then the encode is anamorphic and will not play on the tivo at this resolution.


I don't think that's correct. I _know_ it's not correct for MPEG-2 (think 1280x1080i from DirecTV), but I'll have to test h.264.



dr_m said:


> Okay, so back to my original(ish) question: what is the best way to get my video to the Tivo? If I have to reencode it, what is the best method? At this point, I can't just let pyTivo do the transcoding. It thinks it is converting the original mts file into something which can be pushed to the Tivo, but it doesn't work.


You can let pyTivo do it -- just do it via pulls (from the TiVo) instead of pushes (from the web interface). That will convert it to MPEG-2, which is pretty much guaranteed to work. Alternatively, you can force even a push to do the same, by providing an appropriate metadata line -- something like "Override_vCodec: foo" should do it.


----------



## dr_m (May 29, 2011)

But, will letting pyTivo transcode the video give the best possible results?


----------



## wmcbrine (Aug 2, 2003)

Yes.


----------



## ragu0012 (Sep 3, 2014)

Apologize for the bump, but I have been searching high and low for an answer to this same question in 2017!

Most of my home movies from my Sony Handycam are AVCHD in .mt2s containers. They are 1080i, so I am wondering if pytivo would leave them interlaced so I don't lose quality through deinterlacing.

I am now using Dan's latest (sept 15, 2017) pytivo desktop.

Is pulling these files through the Tivo Bolt the best way to get (as lossless as possible) transfers of my home movies?

If there is a better way to re-encode them on my computer and leave them in a folder for pulling, I am willing to do that if someone has an idea what the best method and settings would be. Thank youl.


----------



## Dan203 (Apr 17, 2000)

PyTivo should pull those without transcoding as long as the TS option is on in the upload tab. (on by default)


----------



## ragu0012 (Sep 3, 2014)

Thanks Dan, I'm a huge fan of your products!

A couple quick questions... (and keep in mind I just downloaded your newest pytivo desktop)
I have an issue where sometimes my pivo media folders show up on my tivo bolt, sometimes not, i can't figure out a rhyme or reason.

Tivo Desktop folder always seems to show up.

I could uninstall tivo desktop if it causes issues to be running both that and pytivo. The only reason I still use Tivo Dektop is because of how it names files, full title including date, whereas in the past pytivo didn't include all that in file naming. But it appears that has been rectified in your pitivo desktop.

But any other ideas why it sometimes shows up and sometimes doesn't? (i leave the service running)

EDIT_ actually there seems to be a larger issue as no file will transfer... blue dot appears, says its transferring, but the video never goes


----------



## Dan203 (Apr 17, 2000)

TiVo Desktop does conflict, so that's likely why you're having issues with the folders showing on your TiVo.

The second issue you describe is a problem with pyTivo Desktop installed in service mode. You have to go into the service and give it credentials to log in as a real user or it can't properly access the ffmpeg.exe when transferring something back to your TiVo. If you don't want to do that you can just reinstall and don't check the service option. (I'm thinking about removing that option anyway as it causes more trouble then it's worth)


----------



## ragu0012 (Sep 3, 2014)

Thanks for the reply. I tried all of the above and it is still acting the same. Here is what I get in the log:


```
INFO:pyTivo:127.0.0.1 [23/Sep/2017 09:44:18] "GET /TiVoConnect?Command=GetLogText&Container=Settings HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:42] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec h264 not compatible, F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:tsn: 8490011902157D4
DEBUG:pyTivo.video.transcode:aspect169: True
DEBUG:pyTivo.video.transcode:optres: False
DEBUG:pyTivo.video.transcode:File=F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts vCodec=h264 vWidth=1920 vHeight=1080 vFps=59.94 millisecs=2311810 TIVO_HEIGHT=2160 TIVO_WIDTH=3840
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:audio_lang: None
DEBUG:pyTivo.video.transcode:set first detected audio stream by default: 0:1
DEBUG:pyTivo.video.transcode:selected audio stream: 0:1
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec h264 not compatible, F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:42] "GET /TiVoConnect?Command=QueryContainer&Container=My%20TiVo%20Recordings&Recurse=Yes&SortOrder=!CaptureDate&ItemCount=8&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-mpeg,video%2F*&SerialNum=8490011902157D4 HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:42] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:42] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:42] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:42] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:42] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:42] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:44] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryContainer&Container=My%20Videos&Recurse=Yes&SortOrder=!CaptureDate&ItemCount=8&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-mpeg,video%2F*&SerialNum=8490011902157D4 HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:45] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:48] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec h264 not compatible, F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:tsn: 8490011902157D4
DEBUG:pyTivo.video.transcode:aspect169: True
DEBUG:pyTivo.video.transcode:optres: False
DEBUG:pyTivo.video.transcode:File=F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts vCodec=h264 vWidth=1920 vHeight=1080 vFps=59.94 millisecs=2311810 TIVO_HEIGHT=2160 TIVO_WIDTH=3840
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:audio_lang: None
DEBUG:pyTivo.video.transcode:set first detected audio stream by default: 0:1
DEBUG:pyTivo.video.transcode:selected audio stream: 0:1
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec h264 not compatible, F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
```


----------



## ragu0012 (Sep 3, 2014)

And additional from the log, noticing it's looking for tivodecode


```
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:48] "GET /TiVoConnect?Command=QueryContainer&Container=My%20TiVo%20Recordings&Recurse=Yes&SortOrder=!CaptureDate&ItemCount=8&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-mpeg,video%2F*&SerialNum=8490011902157D4 HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:48] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:48] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:48] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:48] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:48] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:48] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:49] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg HTTP/1.1" 200 -
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec h264 not compatible, F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:tsn: 8490011902157D4
DEBUG:pyTivo.video.transcode:aspect169: True
DEBUG:pyTivo.video.transcode:optres: False
DEBUG:pyTivo.video.transcode:File=F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts vCodec=h264 vWidth=1920 vHeight=1080 vFps=59.94 millisecs=2311810 TIVO_HEIGHT=2160 TIVO_WIDTH=3840
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:audio_lang: None
DEBUG:pyTivo.video.transcode:set first detected audio stream by default: 0:1
DEBUG:pyTivo.video.transcode:selected audio stream: 0:1
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:TRANSCODE=YES, vCodec h264 not compatible, F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:49] "GET /TiVoConnect?Command=QueryContainer&Container=My%20TiVo%20Recordings&Recurse=Yes&SortOrder=!CaptureDate&ItemCount=1&AnchorItem=%2FMy%2520TiVo%2520Recordings%2F2017-07%2520Home%2520Movies%2520raw.m2ts&AnchorOffset=-1&Filter=x-tivo-container%2Ftivo-videos,x-tivo-container%2Ffolder,video%2Fx-tivo-mpeg,video%2F*&SerialNum=8490011902157D4 HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:49] "GET /TiVoConnect?Command=TVBusQuery&Container=My%20TiVo%20Recordings&File=%2F2017-07%20Home%20Movies%20raw.m2ts&SerialNum=8490011902157D4 HTTP/1.1" 200 -
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:49] "GET /TiVoConnect?Command=QueryFormats&SourceFormat=video%2Fx-tivo-mpeg-ts HTTP/1.1" 200 -
WARNING:pyTivo.config:tivodecode not found
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:45:52] "GET /My%20TiVo%20Recordings/2017-07%20Home%20Movies%20raw.m2ts?Format=video%2Fx-tivo-mpeg-ts HTTP/1.1" 206 -
INFO:pyTivo.video.video:[23/Sep/2017 09:45:52] Start sending "F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts" to Family Room
DEBUG:pyTivo.video.video:"F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts" is tivo compatible
WARNING:pyTivo.config:tivodecode not found
DEBUG:pyTivo.video.transcode:CACHE HIT! F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
DEBUG:pyTivo.video.transcode:TRANSCODE=NO, all compatible, F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts
INFO:pyTivo:192.168.1.102 [23/Sep/2017 09:46:22] "GET /My%20TiVo%20Recordings/2017-07%20Home%20Movies%20raw.m2ts?Format=video%2Fx-tivo-mpeg-ts HTTP/1.1" 206 -
INFO:pyTivo.video.video:[23/Sep/2017 09:46:22] Start sending "F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts" to Family Room
DEBUG:pyTivo.video.video:"F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts" is tivo compatible
INFO:pyTivo.video.video:[Errno 10054] An existing connection was forcibly closed by the remote host
INFO:pyTivo.video.video:[23/Sep/2017 09:46:22] Done sending "F:\My TiVo Recordings\2017-07 Home Movies raw.m2ts" to Family Room, 524288 bytes, 953764905.12 Mb/s
INFO:pyTivo.video.video:[Errno 10054] An existing connection was forcibly closed by the remote host
INFO:pyTivo:[Errno 10054] An existing connection was forcibly closed by the remote host
CopyClose
```


----------



## Dan203 (Apr 17, 2000)

The tivodecode error can be ignored. My version doesn't use it, ot uses tivolibre instead. I just didn't pull out the code that can use tivodecode incase someone preffered to use it instead.

The error about the connection being forceibly closed means the TiVo is rejecting the transfer for some reason. Try rebooting the TiVo and see if that helps.


----------



## ragu0012 (Sep 3, 2014)

Rebooted, and the issue persists for the m2ts file. Is there a file size limit (besides what the DVR will hold?) this file is 4.38 gb.

I tested some other files and successfully transferred an MPEG file, AVC mp4 file, and Xvid MPEG-4 in Avi file.


----------



## ragu0012 (Sep 3, 2014)

Is it necessary to input the path to ffmpeg and more?








'


----------



## Dan203 (Apr 17, 2000)

You're using my version right? If so you should use the settings menu in the Desktop app, not the webpage. Some of the options I added to my version are not exposed on the webpage.

To answer your question... no, you don't need a path. PyTivo looks for it in a "bin" directory if there isn't a path supplied, and that's where I put them in the installer.

Just as a test try disabling the TS option on the upload tab of the setting in the Desktop app. That will force the video to be transcoded to MPEG-2. That will tell you if there is something in the source video causing the issue.


----------



## ragu0012 (Sep 3, 2014)

Yes I'm using yours -- I had just logged into the website to see if there were any funky settings.

Tried disablng TS option, and yes, it did transcode and send the file. Let me know if sending any log info would be helpful.


----------



## Dan203 (Apr 17, 2000)

Based on the error you're getting and the fact that the transcode works I'm guessing there is some encoding parameter in the original video that is simply incompatible with TiVo. Could be something impossible to detect using ffprobe, which is why pyTivo isn't triggering a teanscode on it's own. Things like a spike in the bitrate, a variable frame rate, a long GOP, etc... are things that might trip up the TiVo but aren't guaranteed to be caught by the initial probe. 

One thing you might try... if you're a VideoReDo user try running the original file through QuickStream Fix and then transferring the fixed file. It could potentially correct something that's causing the TiVo to choke. If not then teanscoding is gping to be your only option.


----------



## ragu0012 (Sep 3, 2014)

Sorry it took me a while to have a chance to do this.

I ran Quickstream fix, output file profile H.264 M2TS, and the Tivo does not take it with TS option On.

I am uploading a very small file recorded with that camcorder and if you have any time to took a look let me know. Just download and change extension from jpg to m2ts.

I appreciate all your time and insight.



Dan203 said:


> Based on the error you're getting and the fact that the transcode works I'm guessing there is some encoding parameter in the original video that is simply incompatible with TiVo. Could be something impossible to detect using ffprobe, which is why pyTivo isn't triggering a teanscode on it's own. Things like a spike in the bitrate, a variable frame rate, a long GOP, etc... are things that might trip up the TiVo but aren't guaranteed to be caught by the initial probe.
> 
> One thing you might try... if you're a VideoReDo user try running the original file through QuickStream Fix and then transferring the fixed file. It could potentially correct something that's causing the TiVo to choke. If not then teanscoding is gping to be your only option.


----------

