fengda2870 2020-09-14 15:27 采纳率: 0%
浏览 635
已结题

TS文件无法转换成MP4格式

我从直播流的m3u8中下载下来的TS文件片段,在直播结束之后,使用ffmpeg合成整个文件时

ffmpeg  -f concat -safe 0 -i 1.txt -c copy 1.mp4

无法进行合成。提示如下错误:

[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[NULL @ 0000029825704f80] PPS id out of range: 0
[hevc @ 00000298257ae740] PPS id out of range: 0
[hevc @ 00000298257ae740] Error parsing NAL unit #1.
[concat @ 00000298256d97c0] decoding for stream 0 failed
[concat @ 00000298256d97c0] Could not find codec parameters for stream 0 (Video: hevc ([36][0][0][0] / 0x0024), none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, concat, from '2020-08-26-07-22.txt':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: hevc ([36][0][0][0] / 0x0024), none, 14.99 fps, 14.99 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 134 kb/s
[mp4 @ 0000029825f16700] dimensions not set
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
    Last message repeated 1 times

后来我使用格式工厂,查看TS文件的属性,发现现在的TS文件中Video属性是这样的

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L3.1@Main
Codec ID                                 : 36
Duration                                 : 8 min 47 s
Width                                    : 720 pixels
Height                                   : 1 280 pixels
Display aspect ratio                     : 0.563
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits

而上述异常的TS文件中Video属性却少很多,没有Color space,Width,Height 等属性值。

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Codec ID                                 : 36
Duration                                 : 3 s 938 ms

有没有办法把这些属性直播添加到TS文件中呢?

链接:https://pan.baidu.com/s/1dXQy3TLx8HQd9ZxROV5M0A
提取码:1111

百度网盘中共享出来1个有问题的TS文件,请指教。

  • 写回答

2条回答 默认 最新

  • threenewbee 2020-09-14 15:45
    关注

    Could not find codec parameters for stream 0 (Video: hevc ([36][0][0][0] / 0x0024), none): unspecified size
    数据格式的问题
    解决参考:
    https://blog.csdn.net/weixin_34187822/article/details/85926723

    评论

报告相同问题?

悬赏问题

  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥15 python爬取bilibili校园招聘网站
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件
  • ¥15 不同系统编译兼容问题
  • ¥100 三相直流充电模块对数字电源芯片在物理上它必须具备哪些功能和性能?