TiVo Community Forum banner

AVCHD (.mts) to Tivo, preferably lossless

6044 Views 33 Replies 8 Participants Last post by  ragu0012
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%)
See less See more
1 - 20 of 34 Posts
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.
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?
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.

HTML:
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...
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.
I'll look into qt-faststart. However, my mp4 is well under 4 GB.
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.
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
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?

HTML:
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
See less See more
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?
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?
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.
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
See less See more
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.
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
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
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
See less See more
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.
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.

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.
But, will letting pyTivo transcode the video give the best possible results?
1 - 20 of 34 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top