- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是using this Python library使用图像 (.png) 作为输入以编程方式生成短视频。该视频需要符合其他人创建的另一个视频的规范。
我的输出与其他输出之间的主要区别如下(这些是我希望拥有的媒体属性):
如何实现 VBR?据我了解,ProRes 422 HQ 本身使用无约束 VBR,但我的输出指定了 CBR。
其次,从我的代码中可以看出,我正在尝试遵守 BT.709。然而,我的媒体信息输出并没有指定这一点。我做错了什么?
这是我的代码:
image = ffmpeg.input(input_image, t='00:00:10', framerate='24000/1001', loop='1', probesize='42M')
output = ffmpeg.output(image, output_video,
f='mov',
vcodec='prores_ks',
vprofile='3',
pix_fmt='yuv422p10le',
g='48',
video_track_timescale='24000',
movflags='use_metadata_tags',
timecode='00:00:00:00',
color_primaries='bt709',
color_trc='bt709',
colorspace='bt709',
qcomp='1',
# BT.709 issue solved by adding the bsf option as seen via the line below
bsf='prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709',
vf='scale=in_range=full:in_color_matrix=bt709:out_range=full:out_color_matrix=bt709')
output.run()
这是我的输出生成的媒体信息:
{
"media":{
"@ref":"Redacted",
"track":[
{
"@type":"General",
"VideoCount":"1",
"OtherCount":"1",
"FileExtension":"mov",
"Format":"MPEG-4",
"Format_Profile":"QuickTime",
"CodecID":"qt ",
"CodecID_Version":"0000.02",
"CodecID_Compatible":"qt ",
"FileSize":"196366623",
"Duration":"10.010",
"OverallBitRate":"156936362",
"FrameRate":"23.976",
"FrameCount":"240",
"StreamSize":"2463",
"HeaderSize":"28",
"DataSize":"196364172",
"FooterSize":"2423",
"IsStreamable":"No",
"File_Created_Date":"UTC 2019-12-13 19:26:37.150",
"File_Created_Date_Local":"2019-12-13 19:26:37.150",
"File_Modified_Date":"UTC 2019-12-13 19:27:20.303",
"File_Modified_Date_Local":"2019-12-13 19:27:20.303"
},
{
"@type":"Video",
"StreamOrder":"0",
"ID":"1",
"Format":"ProRes",
"Format_Version":"0",
"Format_Profile":"422 HQ",
"CodecID":"apch",
"Duration":"10.010",
"BitRate_Mode":"CBR",
"BitRate":"156934237",
"Width":"1920",
"Height":"1080",
"Sampled_Width":"1920",
"Sampled_Height":"1080",
"PixelAspectRatio":"1.000",
"DisplayAspectRatio":"1.778",
"Rotation":"0.000",
"FrameRate_Mode":"CFR",
"FrameRate":"23.976",
"FrameCount":"240",
"ColorSpace":"YUV",
"ChromaSubsampling":"4:2:2",
"ScanType":"Progressive",
"Delay":"0.000",
"StreamSize":"196364160",
"Encoded_Library":"Lavc",
"colour_description_present":"Yes",
"colour_description_present_Source":"Stream",
"colour_primaries_Source":"Stream",
"transfer_characteristics_Source":"Stream",
"matrix_coefficients_Source":"Stream"
},
{
"@type":"Other",
"StreamOrder":"1",
"ID":"2",
"Type":"Time code",
"Format":"QuickTime TC",
"Duration":"10.010",
"FrameRate":"23.976",
"TimeCode_FirstFrame":"00:00:00:00",
"TimeCode_Striped":"Yes",
"Language":"en",
"Default":"No"
}
]
}
}
这是我尝试匹配的媒体信息规范:
{
"media":{
"@ref":"Redacted",
"track":[
{
"@type":"General",
"VideoCount":"1",
"OtherCount":"1",
"FileExtension":"mov",
"Format":"MPEG-4",
"Format_Profile":"QuickTime",
"CodecID":"qt ",
"CodecID_Version":"2005.03",
"CodecID_Compatible":"qt ",
"FileSize":"1397430682",
"Duration":"70.737",
"OverallBitRate_Mode":"VBR",
"OverallBitRate":"158042403",
"FrameRate":"23.976",
"FrameCount":"1696",
"StreamSize":"9898",
"HeaderSize":"28",
"DataSize":"1397420796",
"FooterSize":"9858",
"IsStreamable":"No",
"Encoded_Date":"UTC 2019-04-29 22:26:32",
"Tagged_Date":"UTC 2019-04-29 22:26:32",
"File_Created_Date":"UTC 2019-12-12 16:52:57.215",
"File_Created_Date_Local":"2019-12-12 16:52:57.215",
"File_Modified_Date":"UTC 2019-12-12 17:25:58.903",
"File_Modified_Date_Local":"2019-12-12 17:25:58.903",
"Encoded_Application":"DVP Factory r561 (2019-04-25), Host: dvp07"
},
{
"@type":"Video",
"StreamOrder":"0",
"ID":"1",
"Format":"ProRes",
"Format_Version":"0",
"Format_Profile":"422 HQ",
"CodecID":"apch",
"Duration":"70.737",
"Duration_LastFrame":"-0.000",
"BitRate_Mode":"VBR",
"BitRate":"158040381",
"Width":"1920",
"Height":"1080",
"Sampled_Width":"1920",
"Sampled_Height":"1080",
"PixelAspectRatio":"1.000",
"DisplayAspectRatio":"1.778",
"Rotation":"0.000",
"FrameRate_Mode":"CFR",
"FrameRate":"23.976",
"FrameCount":"1696",
"ColorSpace":"YUV",
"ChromaSubsampling":"4:2:2",
"ScanType":"Progressive",
"Delay":"0.000",
"StreamSize":"1397420784",
"Encoded_Library":"agi0",
"Language":"en",
"Encoded_Date":"UTC 2019-04-29 22:26:32",
"Tagged_Date":"UTC 2019-04-29 22:26:32",
"colour_description_present":"Yes",
"colour_description_present_Source":"Container / Stream",
"colour_primaries":"BT.709",
"colour_primaries_Source":"Container",
"colour_primaries_Original_Source":"Stream",
"transfer_characteristics":"BT.709",
"transfer_characteristics_Source":"Container",
"transfer_characteristics_Original_Source":"Stream",
"matrix_coefficients":"BT.709",
"matrix_coefficients_Source":"Container / Stream"
},
{
"@type":"Other",
"StreamOrder":"1",
"ID":"2",
"Type":"Time code",
"Format":"QuickTime TC",
"Duration":"70.737",
"FrameRate":"23.976",
"TimeCode_FirstFrame":"00:00:00:00",
"TimeCode_Striped":"Yes",
"Language":"en",
"extra":{
"Encoded_Date":"UTC 2019-04-29 22:26:32",
"Tagged_Date":"UTC 2019-04-29 22:26:32"
}
}
]
}
}
最佳答案
我找到了解决方案here :
将 q='1'
添加到输出参数列表:
output = ffmpeg.output(image, output_video,
f='mov',
vcodec='prores_ks',
vprofile='3',
q='1',
pix_fmt='yuv422p10le',
g='48',
video_track_timescale='24000',
movflags='use_metadata_tags',
timecode='00:00:00:00',
color_primaries='bt709',
color_trc='bt709',
colorspace='bt709',
qcomp='1',
# BT.709 issue solved by adding the bsf option as seen via the line below
bsf='prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709',
vf='scale=in_range=full:in_color_matrix=bt709:out_range=full:out_color_matrix=bt709')
<小时/>
更新:
llogan 的评论是正确的:“静态图像不需要 VBR”。
对于多个图像,q='1'
标志会生成 VBR 输出。
如果没有 q='1'
,输出视频将为 CBR。
使用 here 中的 5 张 Tiff 图像序列进行测试
我使用以下代码进行测试:
import ffmpeg
input_image = 'seq_01_intro_0200_%04d.tif'
output_video = 'output.mov'
image = ffmpeg.input(input_image, framerate='24000/1001', probesize='42M')
output = ffmpeg.output(image, output_video,
f='mov',
vcodec='prores_ks',
vprofile='3',
pix_fmt='yuv422p10le',
g='48',
q='1',
video_track_timescale='24000',
movflags='use_metadata_tags',
timecode='00:00:00:00',
color_primaries='bt709',
color_trc='bt709',
colorspace='bt709',
qcomp='1',
bsf='prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709',
vf='scale=in_range=full:in_color_matrix=bt709:out_range=full:out_color_matrix=bt709')
output.run()
使用q='1'
(媒体信息输出):
{
"media": {
"@ref": "output.mov",
"track": [
{
"@type": "General",
"VideoCount": "1",
"OtherCount": "1",
"FileExtension": "mov",
"Format": "MPEG-4",
"Format_Profile": "QuickTime",
"CodecID": "qt ",
"CodecID_Version": "0000.02",
"CodecID_Compatible": "qt ",
"FileSize": "4121640",
"Duration": "0.209",
"OverallBitRate_Mode": "VBR",
"OverallBitRate": "157766124",
"FrameRate": "23.976",
"FrameCount": "5",
"StreamSize": "1527",
"HeaderSize": "28",
"DataSize": "4120125",
"FooterSize": "1487",
"IsStreamable": "No",
"File_Created_Date": "UTC 2019-12-14 22:14:12.446",
"File_Created_Date_Local": "2019-12-15 00:14:12.446",
"File_Modified_Date": "UTC 2019-12-14 22:16:14.442",
"File_Modified_Date_Local": "2019-12-15 00:16:14.442"
},
{
"@type": "Video",
"StreamOrder": "0",
"ID": "1",
"Format": "ProRes",
"Format_Version": "0",
"Format_Profile": "422 HQ",
"CodecID": "apch",
"Duration": "0.209",
"BitRate_Mode": "VBR",
"BitRate": "158054127",
"Width": "1280",
"Height": "720",
"Sampled_Width": "1280",
"Sampled_Height": "720",
"PixelAspectRatio": "1.000",
"DisplayAspectRatio": "1.778",
"Rotation": "0.000",
"FrameRate_Mode": "CFR",
"FrameRate": "23.976",
"FrameCount": "5",
"ColorSpace": "YUV",
"ChromaSubsampling": "4:2:2",
"ScanType": "Progressive",
"Delay": "0.000",
"StreamSize": "4120113",
"Encoded_Library": "Lavc",
"colour_description_present": "Yes",
"colour_description_present_Source": "Stream",
"colour_primaries": "BT.709",
"colour_primaries_Source": "Stream",
"transfer_characteristics": "BT.709",
"transfer_characteristics_Source": "Stream",
"matrix_coefficients": "BT.709",
"matrix_coefficients_Source": "Stream"
},
{
"@type": "Other",
"StreamOrder": "1",
"ID": "2",
"Type": "Time code",
"Format": "QuickTime TC",
"Duration": "0.209",
"FrameRate": "23.976",
"TimeCode_FirstFrame": "00:00:00:00",
"TimeCode_Striped": "Yes",
"Language": "en",
"Default": "No"
}
]
}
}
没有q='1'
:
{
"media": {
"@ref": "output.mov",
"track": [
{
"@type": "General",
"VideoCount": "1",
"OtherCount": "1",
"FileExtension": "mov",
"Format": "MPEG-4",
"Format_Profile": "QuickTime",
"CodecID": "qt ",
"CodecID_Version": "0000.02",
"CodecID_Compatible": "qt ",
"FileSize": "2394009",
"Duration": "0.209",
"OverallBitRate": "91636708",
"FrameRate": "23.976",
"FrameCount": "5",
"StreamSize": "1531",
"HeaderSize": "28",
"DataSize": "2392490",
"FooterSize": "1491",
"IsStreamable": "No",
"File_Created_Date": "UTC 2019-12-14 22:14:12.446",
"File_Created_Date_Local": "2019-12-15 00:14:12.446",
"File_Modified_Date": "UTC 2019-12-14 22:22:47.178",
"File_Modified_Date_Local": "2019-12-15 00:22:47.178"
},
{
"@type": "Video",
"StreamOrder": "0",
"ID": "1",
"Format": "ProRes",
"Format_Version": "0",
"Format_Profile": "422 HQ",
"CodecID": "apch",
"Duration": "0.209",
"BitRate_Mode": "CBR",
"BitRate": "91779284",
"Width": "1280",
"Height": "720",
"Sampled_Width": "1280",
"Sampled_Height": "720",
"PixelAspectRatio": "1.000",
"DisplayAspectRatio": "1.778",
"Rotation": "0.000",
"FrameRate_Mode": "CFR",
"FrameRate": "23.976",
"FrameCount": "5",
"ColorSpace": "YUV",
"ChromaSubsampling": "4:2:2",
"ScanType": "Progressive",
"Delay": "0.000",
"StreamSize": "2392478",
"Encoded_Library": "Lavc",
"colour_description_present": "Yes",
"colour_description_present_Source": "Stream",
"colour_primaries": "BT.709",
"colour_primaries_Source": "Stream",
"transfer_characteristics": "BT.709",
"transfer_characteristics_Source": "Stream",
"matrix_coefficients": "BT.709",
"matrix_coefficients_Source": "Stream"
},
{
"@type": "Other",
"StreamOrder": "1",
"ID": "2",
"Type": "Time code",
"Format": "QuickTime TC",
"Duration": "0.209",
"FrameRate": "23.976",
"TimeCode_FirstFrame": "00:00:00:00",
"TimeCode_Striped": "Yes",
"Language": "en",
"Default": "No"
}
]
}
}
如您所见,q='1'
:
"BitRate_Mode": "VBR"
没有q='1'
:
"BitRate_Mode": "CBR",
关于Python FFmpeg : Setting VBR and BT. 709,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59329206/
我正在 iOS 上开发一个视频播放器项目。 它使用 AVFoundation提取 CVPixelBuffer从视频文件中提取,然后将该缓冲区作为纹理发送到 OpenGL。 概念验证代码的灵感来自 Ap
我有一个应用程序可选地需要 BT - 所以我把 在 list 中。 问题是这会过滤掉所有没有 BT 的 Android 设备。 但我需要让它成为可选的!因此,它们应该仍然兼容,以便用户可以从 Go
如果蓝牙配对请求不被接受或取消,我必须为它设置一个超时时间!! It's mentioned that i have to use the timeout defined by Bluetooth s
忘记密码是一件再常见不过的事情了。遇到这样的情况大家也不必太着急和惊慌,我们来具体给大家分析一下。一般情况下宝塔面板忘记用户名和密码的情况不外乎这两种情况: 1、面板刚安装好,不小心关掉了ssh工
宝塔面板如何设置自定义 404 页面?大家知道,默认的 404 页面对搜索引擎不友好,那怎么通过宝塔面板修改默认的 404 页面,使之变成我们自定义的 404 页面呢。 1、进入宝塔面板,找到对应
为android设备的蓝牙名称定义最大长度的目的是什么? I have an android device and I could name the BT with a name of unlimit
我对java很陌生,我有一个任务来实现心跳机制来监控BT芯片的活跃度。 BT芯片每5秒通过uart接口(interface)不断发送一条空消息(只有消息ID,没有内容),必须由java模块读取。如果未
我正在开发一个需要 BT 连接的 Android 应用程序。阅读 Android 开发者页面后,给定的方法(例如 isEnabled())不起作用。错误是无法解析符号isEnabled。导入的库是an
我是 Android 新手。我想开发一个带有操作栏溢出菜单的页面。我的模拟器显示正确。但我在手机中看不到它。 Android 版本为 4.1.2 的手机请帮帮我.... Android list
我已经使用 Apache cordova 为 Android 编写了一个启动器应用程序。它适用于类似信息亭的应用程序,基本上运行良好。 不幸的是有一个问题:在某些情况下,Android 会强制终止我的
目标:我正在尝试将我的 Android 手机连接到附近已配对的蓝牙设备。 问题:我是BT技术的新手。我正在将我的 Android 手机与使用经典蓝牙 API (SPP) 的 BT 设备配对,因为 BT
这只是 Xcode 的一个小错误,还是只有我必须运行一个项目两次才能模拟位置? 最佳答案 在 xcode 中使用位置进行测试的最佳选择是添加 .gpx as belove: 并设置该文件的名称,例如
只要我知道如果 BT 设备符合 MFI,iOS 设备就可以与 BT 设备通信。但我的一些 friend 说苹果在推出BLE设备后不再支持BT设备。我的理解是,如果 BT 设备符合 MFI 标准,iOS
我在从Github托管的bt.matching.find工具箱中实现SIT函数时遇到问题。按照here描述的步骤下载工具箱后,我尝试复制此blog描述的代码。 library(SIT.dates) l
/var/日志/消息: segfault at 0 ip 00007fcd16e5853a sp 00007ffd98e37e58 error 4 in libc-2.24.so[7fcd16dc90
例如:iPhone 上的 Pebble 应用程序允许我浏览已发现的 BT 设备列表,然后配对并连接到 watch 。我知道如何显示 BT 外围设备列表,但我确信无法通过代码进行配对和连接。 所需行为的
在过去一周左右的时间里,我一直在努力反对这个问题。我已经阅读了以下资源: StackOverflow:在没有 Gamekit 的情况下通过蓝牙享受 Bonjour? (3844189) StackOv
我想知道 Tizen 是否支持 BT,如果支持,它是否使用开源 bluez 协议(protocol)? 另外我想知道在 Tizen 中使用蓝牙时从哪里开始挖掘。 提前致谢! 最佳答案 tizen 中的
最近发现很多用户反馈的一些问题与磁盘挂载有关, 1、安装完面板后发现磁盘容量与实际购买容量不符 2、重启服务器后面板无法访问,网站、数据库文件丢失 以上都是因为未挂载磁盘,或挂载操作不当引
我想通过 FFmpeg 为平板电脑和手机编码视频,设置“-bt”选项是否重要?如果我只是跳过此选项,这会影响设备上的视频播放吗? ‘-bt tolerance’ Set video bitrate t
我是一名优秀的程序员,十分优秀!