ffmpeg - TVHeadend 不在 IPTV 流上使用编解码器副本?

标签 ffmpeg dvb

因此,我使用了出色的 TVHeadend,在我的情况下,它是一个 DVB-T 或 IPTV 服务器,可以大量记录一些输入。这是一款很棒的软件,我非常推荐。

但是我在这里有点困惑。所以我在树莓派 4 上设置了一个电视前端,因为我的工作需要录制很多电视节目。我非常感谢 TVheadend 在其他安装上的使用,我的同事也需要使用它,而不是仅使用 CLI 界面(你会看到这很相关)。

因此,当我使用这样的简单 ffmpeg 命令时:

ffmpeg -err_detect ignore_err -i http://mystream -to 00:10:00 -codec copy /media/partage/dvr/test.mp4

我的 cpu 使用率大约为 1% 或 2%。但是当我试图在 tvheadend 中复制它时,cpu 达到 400%,显然这不是相同的行为。

这是我的流配置:

tvheadendconfig

这是 ffmpeg 编解码器复制的结果:
General
Complete name                            : /Volumes/Share/dvr/test2.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 58.3 MiB
Duration                                 : 3mn 20s
Overall bit rate                         : 2 436 Kbps
Writing application                      : Lavf58.20.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.1
Format settings                          : 2 Ref Frames
Format settings, CABAC                   : No
Format settings, ReFrames                : 2 frames
Format settings, GOP                     : M=3, N=50
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 3mn 20s
Bit rate                                 : 2 300 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.100
Stream size                              : 55.0 MiB (94%)
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 3mn 20s
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 44.1 KHz
Frame rate                               : 43.066 fps (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 3.07 MiB (5%)
Language                                 : French
Default                                  : Yes
Alternate group                          : 1

结果与 tvheadend :
General
Complete name                            : /Volumes/Share/dvr/2020-04-01/BFMTV/Edition-speciale-BFMTV2020-04-0121-00.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/iso6/mp41)
File size                                : 8.40 MiB
Duration                                 : 42s 486ms
Overall bit rate                         : 1 659 Kbps
Movie name                               : Edition spéciale
Writing application                      : Lavf58.20.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 40s 512ms
Bit rate                                 : 11.9 Kbps
Nominal bit rate                         : 1 500 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 25.000 fps
Minimum frame rate                       : 13.885 fps
Maximum frame rate                       : 25.014 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.001
Stream size                              : 58.6 KiB (1%)
Writing library                          : x264 core 155 r2917 0a84d98
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=125 / keyint_min=12 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=1500 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=1875 / vbv_bufsize=5625 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 42s 486ms
Bit rate mode                            : Constant
Bit rate                                 : 172 bps
Nominal bit rate                         : 172 Kbps
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 48.0 KHz
Frame rate                               : 46.875 fps (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 915 Bytes (0%)
Language                                 : French
Default                                  : Yes
Alternate group                          : 1

如您所见,Tvheadend 正在制作一个可变比特率和可变帧率文件,这对 Premiere Pro 来说真的很糟糕(这是所有这一切的主要目标)。显然,它正在以对我的工作流程最不利的格式对其进行转码,而我不需要这种格式。

我的 Pi4 在 Raspbian Buster 上,但我也在 libreelec 上尝试过同样不幸的结果。

有人知道吗?

最佳答案

我想我找到了答案。

所以 TvHeadend 使用的是流式传输的 pipe://。因此,根据 ffmpeg 文档,您不能使用 mp4,而只能使用 TS 和 FLV。所以基本上我已经做了一个后期录制过程: ffmpeg -i "%f"-map 0 -c copy/media/partage/dvr/%b
这就是工作,只有 1% 或 2% 的 CPU 使用率。

关于ffmpeg - TVHeadend 不在 IPTV 流上使用编解码器副本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60986749/

相关文章:

FFMPEG:如何只保留图像的上半部分?

android - Mac 为 Android 构建 ffmpeg

linux - linux下MPEG-TS分析和ETR 101 290监控软件

c - 将 dvb url 地址拆分为单独的值

windows - 如何使用 DvbSiparser.h 在 vc++ 中解析 mpeg2 TS?

ios - 编译 ffmpeg 以支持 SPEEX 解码

c++ - 转换为 JPEG 时损坏的 HEIC 图 block

ffmpeg - 如何添加黑帧并保持帧率?

java - 有关Java TV API的指南

c# - 强制 Mpeg 2 解复用器使用 ffdshow 渲染 H 264 数字电视视频