Thanks for the replies. I want to transmux from .ts container to mkv, because with my players (Mediaportal and mpc-hc) mkv's navigate (skip, fforward, rewind) better than ts's. And they're slightly smaller.
The original .ts file is tff interlaced - here's the MediaInfo output (ignoring the audio stream):
Code:
General
ID : 4 (0x4)
Complete name : short.ts
Format : MPEG-TS
File size : 102 MiB
Duration : 2 min 54 s
Overall bit rate mode : Variable
Overall bit rate : 4 889 kb/s
Frame rate : 29.970 FPS
Video
ID : 48 (0x30)
Menu ID : 137 (0x89)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.2
Format settings : CABAC / 2 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 2 frames
Format settings, GOP : M=3, N=15
Codec ID : 27
Duration : 2 min 54 s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Scan type, store method : Interleaved fields
Scan order : Top Field First
I want to do this losslessly, so the mkv has to be interlaced. When I try to losslessly convert to mkv with the command
Code:
ffmpeg -i test.ts -codec copy test.mkv
test.mkv is about 4% the filesize of test.ts, so clearly the video stream hasn't been copied. MediaInfo on test.mkv gives:
Code:
General
Unique ID : 324606370689798789122356525188404692766 (0xF434E9B6C40AEE5451D4E55EC71F471E)
Complete name : short2.mkv
Format : Matroska
Format version : Version 4
File size : 3.87 MiB
Duration : 2 min 54 s
Overall bit rate : 186 kb/s
Frame rate : 29.970 FPS
Writing application : Lavf61.7.100
Writing library : Lavf61.7.100
ErrorDetectionType : Per level 1
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.2
Format settings : CABAC / 2 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 2 frames
Codec ID : V_MPEG4/ISO/AVC
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan type, store method : Separated fields (2 fields per block)
Scan order : Top Field First
Default : No
Forced : No
I've tried to specify tff interlacing with the command:
Code:
ffmpeg -i test.ts -codec copy -flags +ilme+ildct -top 1 -x264opts tff=1 test.mkv
and that gives file test.mkv of the same size as the previous ffmpeg command and with the same MediaInfo output. In other words it doesn't work.
I've also transcoded with command:
Code:
ffmpeg -i test.ts -vf yadif test.mkv
The result test.mkv is progressive and plays fine. But again I'd like to do this losslessly.