- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有两个目录的媒体服务器:电影和电视节目。在每个目录中,每个条目都存在于包含视频文件和字幕文件的子目录中。
我在网上搜索并找到了来自 Michelle Sullivan 的优秀 perl 脚本,发布在此处:
#!/usr/bin/perl
use strict;
use warnings;
open DIR, "ls -1 |";
while (<DIR>)
{
chomp;
next if ( -d "$_"); # skip directories
next unless ( -r "$_"); # if it's not readable skip it!
my $file = $_;
open PROBE, "ffprobe -show_streams -of csv '$file' 2>/dev/null|" or die ("Unable to launch ffmpeg for $file! ($!)");
my ($v, $a, $s, @c) = (0,0,0);
while (<PROBE>)
{
my @streaminfo = split(/,/, $_);
push(@c, $streaminfo[2]) if ($streaminfo[5] eq "video");
$a++ if ($streaminfo[5] eq "audio");
$s++ if ($streaminfo[5] eq "subtitle");
}
close PROBE;
$v = scalar @c;
if (scalar @c eq 1 and $c[0] eq "ansi")
{
warn("Text file detected, skipping...\n");
next;
}
warn("$file: Video Streams: $v, Audio Streams: $a, Subtitle Streams: $s, Video Codec(s): " . join (", ", @c) . "\n");
if (scalar @c > 1)
{
warn("$file has more than one video stream, bailing!\n");
next;
}
if ($c[0] eq "hevc")
{
warn("HEVC detected for $file ...converting to AVC...\n");
system("mkdir -p h265");
my @params = ("-hide_banner", "-threads 2");
push(@params, "-map 0") if ($a > 1 or $s > 1 or $v > 1);
push(@params, "-c:a copy") if ($a);
push(@params, "-c:s copy") if ($s);
push(@params, "-c:v libx264 -pix_fmt yuv420p") if ($v);
if (system("mv '$file' 'h265/$file'"))
{
warn("Error moving $file -> h265/$file\n");
next;
}
if (system("ffmpeg -xerror -i 'h265/$file' " . join(" ", @params) . " '$file' 2>/dev/null"))
{
warn("FFMPEG ERROR. Cannot convert $file restoring original...\n");
system("mv 'h265/$file' '$file'");
next;
}
} else {
warn("$file doesn't appear to need converting... Skipping...\n");
}
}
close DIR;
最佳答案
为什么要递归运行?您的意思是要在特定目录下的所有文件上运行它吗?
在这个问题中,我宁愿将生成要处理的文件列表的部分与处理分开。对于一长串文件,我可能会从标准输入中获取这些行:
while( <> ) {
...
}
$ find ... | script
$ script list_of_files.txt
$ find ... -print0 | xargs -0 script
foreach ( @ARGV ) {
...
}
关于macos - 使用ffmpeg将媒体目录从HEVC递归转换为h.264,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36507442/
我正在尝试使用 HEVC HM 引用代码来解码有损失的可扩展 HEVC 文件。但是,在没有损失的情况下,解码器似乎运行良好,但是当我尝试解码损坏的文件(在基本和/或增强数据包中遇到一些损失)时,解码器
容器中的 h.264/HEVC(mp4、mkv....)和 h.265/HEVC 附件 B 原始文件有什么不同?我的意思是关于编解码器、像素格式以及为什么 hevc 附件 B 不能包含音频流? 我研究
有没有办法解析 HEVC 比特流文件? 我希望能够创建一个新的比特流文件,其中选择了从原始比特流文件中选择的最终单位数据包。 编辑:我插入了我的代码。请找到我的比特流文件 here . #librar
我使用 HM-12.0 引用代码创建了一个基本二进制流。所以输出是一个 HEVC 编码的 bin 流(比如 input.bin)。 我有一项任务涉及读取此基本流的 header 。也就是说,我需要从
我正在研究 FFMPEG 中集成的 HEVC 解码器。我实际上是在尝试了解它的流程和工作原理。 我所说的流程是指代码中读取输入 .bin 文件的各种参数的部分。比如它在哪里读取分辨率,它在哪里决定它需
我有一个 HEVC 编码的比特流(.bin 和等效的 .mp4 文件)。我想从比特流中删除一些帧,以查看在丢失特定帧时解码器(或媒体播放器)的行为。 enter image description h
我正在尝试使用 ffmpeg 处理来自 USB 网络摄像头的流式视频数据。该过程涉及将原始数据编码为 hevc 格式。到目前为止,我能够做到。 但现在,我想以 10 秒为单位对处理后的数据进行切片并将
我使用此代码对 .hevc 视频进行编码: ffmpeg -i video.mp4 -vf "scale=650:-1" -c:v libx264 -pix_fmt yuv420p -b:v 150
我想获取 HEVC HM 解码器上的 CU/PU 级别信息。我还想获得一些统计数据,以了解解码不同类型的 CU(帧内、帧间 - 单向/双向)平均需要多少时间。 HM 编码器中现有的调试是不合适的,因为
我尝试使用 AVAssetWriter 将 H264 视频转码为 HEVC,但在 iPhone 6s 上失败了。据推测,iPhone 6s 支持 HEVC 进行转码,而不是实时视频编码。相同的代码适用
有谁知道解码 HEVC 时 Android MediaCodec 支持的分辨率是多少? 通过反复试验,我发现以下工作: 640x272 720x304 960x400 1280x528 1920x80
Win10 在很多方面都做得挺出色,例如自带的视频播放器,就一改之前不中用也不中看的作风,无论是功能还是性能都可圈可点。然而 Win10 的视频播放器也有一个硬伤,那就是在默认情况下,可能是不支持
我正在使用带有 ffmpeg(版本 2.7.2)的 HEVC 编解码器。由于我无法编写单行命令来读取/保存每个 CU 和帧的量化变换系数,我想知道是否有人可以帮助我修改 libavcodec 库中的原
我想知道适用于 iOS 的 Apple Video Encoder 是否支持 hevc (h265) 编解码器的无损压缩?如果是,它的压缩设置是什么? 最佳答案 而某些实现 have a lossle
我在解码 HEVC 时遇到问题使用 avcodec 编码的视频。 修改源代码的一行允许解码mpeg1这不是我需要的。 谢谢 #include #include #include #include
FFMPEG v2.1 及更高版本提供对 HEVC 解码的支持。我尝试了一个基本的输入 bin 流作为它的输入,是的,我得到了一个相应的 YUV 文件。 现在我的问题是,由于我只是将基本流作为输入传递
我尝试将 HEVC 4k 广播转码为 1080p H264。 HEVC 4K 到 HEVC 1080p 可以工作,但是当我尝试将 hevc 到 h264 时,我得到“没有找到支持 NVENC 的设备”
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
我想将 HEVC 编码文件解码为 YUV 文件。 有什么简单的方法可以做到这一点吗?可执行文件会很好,但我会使用易于编译的源代码。 最佳答案 就这么简单(引导假定的 Linux,根据您的需要进行调整)
所以这个问题已经被问过几次了,但我认为我的 C++ 技能太缺乏,无法真正理解答案。我需要的是一种从 HEVC 编码视频开始到具有所有运动 vector 的 CSV 结束的方法。到目前为止,我已经编译并
我是一名优秀的程序员,十分优秀!