I'm currently using ffmpeg -ss xx:xx -to yy:yy -i input -c copy output
to cut some files and it works fine with .ts and .mp4, but it can't handle .tp files. Here's what I get:
[mpegts @ 0x198acd0] PES packet size mismatch
[mpegts @ 0x198acd0] Packet corrupt (stream = 3, dts = 1256896925).
[mpegts @ 0x198acd0] stream 5 : no PTS found at end of file, duration not set
[mpegts @ 0x198acd0] Could not find codec parameters for stream 1 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x198acd0] Could not find codec parameters for stream 2 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x198acd0] Could not find codec parameters for stream 4 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'input.tp':
Duration: 01:18:04.18, start: 9281.617389, bitrate: 19391 kb/s
Program 2
Stream #0:0[0x21]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 17400 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Side data:
cpb: bitrate max/min/avg: 17400000/0/0 buffer size: 3997696 vbv_delay: N/A
Stream #0:1[0x1100]: Unknown: none ([11][0][0][0] / 0x000B)
Stream #0:2[0x501]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:3[0x24](kor): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
Program 99
Stream #0:4[0x1200]: Unknown: none ([11][0][0][0] / 0x000B)
No Program
Stream #0:5[0x25]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
[NULL @ 0x19aa4d0] Unable to find a suitable output format for 'output.tp'
output.tp: Invalid argument
What's the problem here?
答案1
We may select the format manually by adding -f mpegts
:
ffmpeg -f mpegts -ss xx:xx -to yy:yy -i input.tp -c copy -f mpegts output.tp
FFmpeg error is:
Unable to find a suitable output format for 'output.tp'
It means that FFmpeg can't select the format (automatically) for the file with the .tp
extension.
The reason is that .tp
extension is not a standard file extension (for FFmpeg).
FFmpeg recognizes that the input file is TS file, but we may add -f mpegts
before the -i
for helping FFmpeg identifying the input format.
Note:
I am not sure if your .tp
file is fully compatible with MPEG-TS format (compatible with .ts
file).
My answer assumes the format is compatible, but you may still get some errors.