我正在尝试实现https://android.googlesource.com/platform/cts/+/jb-mr2-release/tests/tests/media/src/android/media/cts/DecodeEditEncodeTest.java 但通过使用修改源一个视频文件 mp4。mime 类型为 video/avc,比特率 288kbps,iframeinterval 100,宽度:176,高度:144。文件大小为 6MB。当我解码视频并将帧放入输出表面时,我可以将帧保存到位图并查看帧。但是最后,在编码后(使用与原始视频相同的参数),我得到了一个700kb的文件,却看不到视频(可能是文件损坏了)。
extractor = new MediaExtractor();
extractor.SetDataSource(filePath);
for (int i = 0; i < extractor.TrackCount; i++)
{
inputFormat = extractor.GetTrackFormat(i);
string mime = inputFormat.GetString(MediaFormat.KeyMime);
if (mime.StartsWith("video/"))
{
extractor.SelectTrack(i);
mimeType = mime;
break;
}
}
mWidth = inputFormat.GetInteger(MediaFormat.KeyWidth);
mHeight = inputFormat.GetInteger(MediaFormat.KeyHeight);
// Create an encoder format that matches the input format. (Might be able to just
// re-use the format used to generate the video, since we want it to be the same.)
MediaFormat …Run Code Online (Sandbox Code Playgroud) 在更新Visual Studio 2015更新3后,我无法发布到我的web api.错误消息说:
无法从程序集C:\ Program Files(x86)\ MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.Tasks.dll加载"PublishTelemetry"任务.确认声明是否正确,程序集及其所有依赖项是否可用
我想将任何 json 记录到 serilog 属性中。我已经阅读了很多有关 serilog 和 json 的内容,但它是结构化的 json 日志记录,带有消息模板。所以我不想记录这个,而是Log.Info("{@text}",text);想这样做:
var json = "{ \"text\": \"hello\" }"; //a json string or a Json object
Log.Info(json);
Run Code Online (Sandbox Code Playgroud)
主要区别在于,使用第一种方法时,您有一个消息模板,并且始终有一个“文本”属性。我想要具有不同结构的 json,例如如果我有:
var json = "{ \"text\": \"hello\", \"text2\": \"hello2\" }"; //a json string or a Json object
Log.Info(json);
Run Code Online (Sandbox Code Playgroud)
我想获取 2 个属性,即每个 json 属性 1 个属性,而无需定义消息模板。这可能吗?我必须实现自己的 JsonFormatter 吗?
我能够解码mp4视频。如果我使用来配置解码器,则Surface可以在屏幕上看到视频。现在,我要编辑帧(添加黄线甚至更好地重叠小图像)并将视频编码为新视频。不必显示视频,现在我也不在乎性能。(如果在编辑时显示帧,如果编辑功能花费很多时间,我可能会有空隙),那么,您对此有何建议?我是使用GlSurface来配置解码器并使用OpenGl(GLES),还是将其配置为null并以某种方式将其转换Bytebuffer为a Bitmap,对其进行修改,然后将位图编码为字节数组?另外我在Grafika页面中看到,您可以将a Surface与自定义Rederer一起使用并使用OpenGl(GLES)。谢谢