gpt4 book ai didi

ffmpeg - 使用 ffmpeg 将视频从 .264 转换为 .265 (HEVC)

转载 作者:行者123 更新时间:2023-12-04 11:18:39 42 4
gpt4 key购买 nike

我看到关于这个主题有几个问题,但我仍然遇到错误。我想要做的就是将我库中的视频转换为 HEVC,这样它们占用的空间就更少了。
我试过这个:

ffmpeg -i input.mp4 -c:v libx265 output.mp4

ffmpeg 似乎需要很长时间,并且输出似乎大小合适。该视频将使用 VLC 播放,但图标很奇怪,当我尝试使用 QuickTime 打开它时,我收到错误消息:“无法打开文档“output.mov”。该文件与 QuickTime Player 不兼容。

我不想更改任何花哨的设置。我只是希望文件占用更少的空间,并且质量损失最小或没有。

谢谢!

编辑:
无法保存我放入视频的时间戳。
最初我在终端中使用 exiftool。但是,有时这不适用于视频,所以我会将它们空投到我的 iPhone 上,使用一个名为 Metapho 的应用程序来更改日期,然后再将它们空投回来。 Exiftool 是创建的,但有时我就是无法工作。它将日期更改为 1109212 Aug 2nd 之类的日期。诡异的。底线是,当我进行这些转换时,我真的不想丢失其中的时间戳。

我时间戳的原始文件,在 .264 中
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_original.mov':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2019-10-22T18:48:43.000000Z
encoder : HandBrake 0.10.2 2015060900
com.apple.quicktime.creationdate: 1994-12-25T18:00:00Z
Duration: 00:01:21.27, start: 0.000000, bitrate: 800 kb/s
Chapter #0:0: start 0.000000, end 81.265000
Metadata:
title : Chapter 12
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 710x482 [SAR 58409:65535 DAR 1043348:794715], 634 kb/s, SAR 9172:10291 DAR 404229:307900, 29.95 fps, 29.97 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2019-10-22T18:48:43.000000Z
handler_name : Core Media Video
encoder : 'avc1'
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
Metadata:
creation_time : 2019-10-22T18:48:43.000000Z
handler_name : Core Media Audio
Stream #0:2(und): Data: bin_data (text / 0x74786574), 0 kb/s
Metadata:
creation_time : 2019-10-22T18:48:43.000000Z
handler_name : Core Media Text
At least one output file must be specified

文件转换为 HEVC,没有 -COPYTS 标记
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_original_HEVC.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.29.100
Duration: 00:01:21.30, start: 0.000000, bitrate: 494 kb/s
Chapter #0:0: start 0.000000, end 81.265000
Metadata:
title : Chapter 12
Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, progressive), 710x482 [SAR 9172:10291 DAR 404229:307900], 356 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)
Metadata:
handler_name : Core Media Video
encoder : Lavc58.54.100 libx265
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : Core Media Audio
Stream #0:2(eng): Data: bin_data (text / 0x74786574), 0 kb/s
Metadata:
handler_name : SubtitleHandler
At least one output file must be specified

文件转换为 HEVC,带有 -COPYTS 标记
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_original_HEVC_keepts.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.29.100
Duration: 00:01:21.30, start: 0.000000, bitrate: 494 kb/s
Chapter #0:0: start 0.000000, end 81.265000
Metadata:
title : Chapter 12
Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, progressive), 710x482 [SAR 9172:10291 DAR 404229:307900], 356 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)
Metadata:
handler_name : Core Media Video
encoder : Lavc58.54.100 libx265
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : Core Media Audio
Stream #0:2(eng): Data: bin_data (text / 0x74786574), 0 kb/s
Metadata:
handler_name : SubtitleHandler
At least one output file must be specified

最佳答案

此答案已发布(根据 CC BY-SA 4.0 许可证)作为 commentGyan提问 Convert videos from .264 to .265 (HEVC) with ffmpeg .

x265 运行此命令转换:

ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 output.mp4

关于ffmpeg - 使用 ffmpeg 将视频从 .264 转换为 .265 (HEVC),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58742765/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com