我有一个特殊m2ts格式的视频文件,是在专用软件上播放的,这个文件的参数跟一般的m2ts文件有点不同:
1. 帧数不可见
2. tbr:90k , tbc:180k
需请高人指点,如何通过ffmpeg或同类的工具,将普通的mp4文件转换成参数一模一样的m2ts格式。
您可以先给出些建议。如果您确实是这方面的专家大神,能给出专业意见的,且需要进一步的分析真实样本文件的,我们可再进一步沟通是否做个小专项解决这个问题。
这个特殊格式文件的具体信息如下:
Input #0, mpegts, from 'RealSample.m2t':
Duration: 00:07:51.64, start: 1390.366000, bitrate: 8211 kb/s
Program 1
Stream #0:0[0x12d]: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080, 90k tbr, 90k tbn, 180k tbc
Stream #0:1[0x12e]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, mono, fltp, 128 kb/s
General
ID : 0 (0x0)
Complete name : C:\Temp\RealSample.m2t
Format : MPEG-TS
File size : 462 MiB
Duration : 7 min 51 s
Overall bit rate mode : Variable
Overall bit rate : 8 210 kb/s
Video
ID : 301 (0x12D)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L4
Format settings : 1 Ref Frames
Format settings, CABAC : No
Format settings, Reference fra : 1 frame
Format settings, GOP : M=1, N=6
Codec ID : 27
Duration : 7 min 51 s
Bit rate : 7 675 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Stream size : 431 MiB (93%)
Audio
ID : 302 (0x12E)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 7 min 51 s
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 1 channel
Sampling rate : 48.0 kHz
Frame rate : 41.667 FPS (1152 SPF)
Compression mode : Lossy
Delay relative to video : 21 ms
Stream size : 7.20 MiB (2%)
以下是我已经尝试过的转换参数,但在专用的播播放器上效果不好,怀疑是有部分视频(如帧率、tbr、tbc等)参数不一致造成的。
ffmpeg32.exe -i test1.mp4 -vsync cfr -vcodec h264 -profile:v baseline -level 4.0 -refs 1 -keyint_min 1 -g 6 -x264opts force-cfr=1 -crf 18 -r 28 -ab 128000 -ar 48000 -r:a 41.667 test2.m2t