AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1836101
Accepted
NewSites
NewSites
Asked: 2024-03-22 01:04:45 +0800 CST2024-03-22 01:04:45 +0800 CST 2024-03-22 01:04:45 +0800 CST

为什么 Handbrake 会强制降低视频的帧大小?

  • 772

摘要:我有一部几年前从 YouTube 下载的老电影,保存为 flv。我想从中提取一个 13 分钟的剪辑。为此,我使用 ffmpeg 将其转换为 mp4,这样我就可以将其加载到达芬奇中,并在其中提取了剪辑。然后我用Handbrake来压缩它。但当我这样做时,HandBrake 显着减小了帧大小,并且压缩后的剪辑与原始剪辑相比有些模糊。

为什么 HandBrake 会强制减小帧大小,以及如何让它以正确的帧大小输出?

细节:

flv 文件大小为 268 MB,持续时间 107 分钟,帧大小 318x240,帧速率 25:

在此输入图像描述

我用来转换为mp4的ffmpeg命令:

ffmpeg -i input.flv -c copy output.mp4

这花了大约一秒钟的时间。结果是 264 MB:

在此输入图像描述

我将其加载到 DaVinci 中,提取剪辑,然后渲染为 mp4、H.265、318x240、25 fps:

在此输入图像描述

结果是 51.4 MB,13:19 mm:ss。MediaInfo 报告它是 HEVC,我理解这意味着它是 H.265,正如我所要求的:

在此输入图像描述

尺寸与时间的比例比整部电影大得多:

  • 电影:264 MB/107 分钟 = 2.5 MB/分钟。
  • 剪辑:51.4 MB / 13.33 分钟 = 3.9 MB/分钟。

当我在 HandBrake 中加载剪辑时,它告诉我源是 318x240,25 fps。尽管它是 H.265 格式,HandBrake 告诉我它是 H.264 格式。然后,HandBrake 也与它的源信息相矛盾,在“Tracks”下说它是 30 fps,尺寸是 234x174。

在此输入图像描述

========================

在 Handbrake 的“视频”选项卡中,编码器显示为 H.264,帧速率为 30。RF 为 22:

在此输入图像描述

========================

我将其更改为 265 和 25:

在此输入图像描述

========================

“尺寸”选项卡再次显示尺寸为 318x240,但随后又显示:

缩放后的大小和最终存储大小为234x174。我尝试单击几个内容,但无法更改输出大小。

在此输入图像描述

========================

当我运行它时,输出为 22 MB,这很好地减少了文件大小:

  • 压缩剪辑:22 MB / 13.33 分钟。= 1.7 MB/分钟。

但帧大小是234x174:

在此输入图像描述

与原始视频相比,该视频有些模糊,这很可能是由于帧尺寸减小造成的。

原始flv文件: 在此输入图像描述

由Ffmpeg转换的Mp4: 在此输入图像描述

由达芬奇渲染的剪辑。

这可能会为问题提供线索。图像占用的空间小于播放器的整个窗口。达芬奇是否缩小了视频的比例?

在此输入图像描述

由 HandBrake 压缩的剪辑: 在此输入图像描述

为什么 HandBrake 会强制减小帧大小,以及如何让它以正确的帧大小输出?

video
  • 3 3 个回答
  • 37 Views

3 个回答

  • Voted
  1. Best Answer
    music2myear
    2024-03-22T02:04:56+08:002024-03-22T02:04:56+08:00

    Edit from the questioner: I've accepted this answer because it gave me what I needed. But see further details in the additional answer that I've also given.



    It may be helpful to remember that Handbrake is largely a skin for FFMPEG with some relatively user-friendly presets. Your process is currently going FFMPEG > DaVinci > FFMPEG, without any real reason we can see for the additional steps. So skip all of the intermediary steps and just use FFMPEG to clip the video. Here's another question that may cover the basics of your need: https://stackoverflow.com/questions/21420296/how-to-extract-time-accurate-video-segments-with-ffmpeg

    Specify the clip start time with -ss 00:00:00 and the end with -to 00:00:00. Like this example from the question I've linked just above:

    ffmpeg -y -i [INPUT.file] -ss 00:42:42 -to 00:84:84 -codec copy [OUTPUT.file]
    

    Doing this you're removing all the possibility of issues caused by the multiple steps you're currently using.

    • 2
  2. NewSites
    2024-03-22T05:44:19+08:002024-03-22T05:44:19+08:00

    I'm accepting the answer by "music2myear" because it gave me what I needed. But for some reason, it assumed I didn't care about the size of the output file. But I do care about that, which is the reason I was running HandBrake.

    So I changed the codec parameter in that answer. Here is a summary of my results:

    • Clip from DaVinci in H.265: 51.4 MB

    • DaVinci clip then HandBrake: 22.0 MB (blurry)

    • Clip from FFmpeg with -codec copy: 29.5 MB

    • Clip from FFmpeg with -codec:v hevc -codec:a copy: 15.2 MB

    Both FFmpeg results appear to have good quality. The one with codec copy took about a second, the one with hevc, about a minute.

    The result from mFFmpeg with codec hevc gave a very nice reduction in file size:

    • Movie: 264 MB / 107 minutes = 2.5 MB/min.
    • 达芬奇剪辑:51.4 MB / 13.33 分钟。= 3.9 MB/分钟。
    • 来自带编解码器的 FFMpeg 的剪辑hevc:15.2 MB / 13.33 分钟 = 1.1 MB/分钟。

    所以,我不知道为什么 HandBrake(或达芬奇和 HandBrake 的组合)要减小框架尺寸。但我确实有关于如何以正确的帧大小(和有效的文件大小)获得高质量输出的答案,即直接使用 FFmpeg。

    • 1
  3. DrMoishe Pippik
    2024-03-22T01:39:20+08:002024-03-22T01:39:20+08:00

    This is a work-around, rather than an exact answer: do the whole process in a single step using a GUI that gives complete control of how the output is saved.

    Two free, open source, video editors, Shotcut and OpenShot (both available in Linux, and Mac, as well as Windows versions, and both Windows app run under wine, too, on this Ubuntu machine), for example, can open FLV video files, edit them, and save the edited output in various formats and with adjustable resolution and quality. There are many alternative video editors, too.

    OpenShot 导出视频对话框

    The screenshot above is from the OpenShot Export Video dialog, and ShotCut offers even more granular control of output. One selects the segments to edit, applies filters such as Sharpen, if desired, and exports with color gamut (e.g., Broadcast, MPEG or JPEG), resolution, frame rate, compression, etc. under user control, all with a single tool. Neither program is intimidating to use, since reasonable defaults are preset.

    • 0

相关问题

  • 如何使用 Audacity 拉伸较短的音轨以适合较长的视频

  • HTTP 上的视频 - 您能判断视频是正在下载还是正在观看吗?

  • OBS Studio—'无法打开 NVENC 编解码器:功能未实现'

  • 如何用ffmpeg 2.0.2保存TS视频流?

  • 压缩视频可以解码回未压缩的原始格式吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve