我使用ffmpeg.exe将视频文件转换为flv格式.为此,我使用Windows服务在后台运行转换过程.当试图通过Windows服务转换大文件(我在文件大小> 14MB时遇到它)时,它会卡在启动进程的行(即process.start();).
但是,当我尝试直接从命令提示符执行ffmpeg.exe时,它解决了任何问题.
我的代码在Windows服务是为如下:
private Thread WorkerThread;
protected override void OnStart(string[] args)
{
WorkerThread = new Thread(new ThreadStart(StartHandlingVideo));
WorkerThread.Start();
}
protected override void OnStop()
{
WorkerThread.Abort();
}
private void StartHandlingVideo()
{
FilArgs = string.Format("-i {0} -ar 22050 -qscale 1 {1}", InputFile, OutputFile);
Process proc;
proc = new Process();
try
{
proc.StartInfo.FileName = spath + "\\ffmpeg\\ffmpeg.exe";
proc.StartInfo.Arguments = FilArgs;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = false; …Run Code Online (Sandbox Code Playgroud) 我正在尝试在我的专有图像/视频处理管道(从相机原始到最终JPEG/MPEG)中的图像上应用图像锐化2D滤镜内核(拉普拉斯算子).我计划用2D图像阵列对这个拉普拉斯内核进行2D卷积以锐化图像.我的问题是: -
应用此图像锐化滤镜以获得最佳输出图像质量的最合适色彩空间是什么
a)我应该在RGB空间中的每个分量(R,G和B)上应用此滤波器吗?
要么
b)我应该在YUV空间中应用它还是仅在Y组件上应用它(或者它是否也应用在U和V组件上)?
任何指针都会很有用.
编辑:我在这里问过这个,因为我打算以编程方式,我自己.没有外部工具.
谢谢.
-广告.
我正在使用OpenGL,Ffmpeg和SDL播放视频,目前正在优化获取帧,解码帧,将它们从YUV转换为RGB,将它们上传到纹理并在四边形上显示纹理的过程.这些阶段中的每一个都由单独的线程执行,并且它们被写入由SDL互斥体和条件控制的共享缓冲区(除了上传和显示纹理,因为它们需要在相同的上下文中).
我让播放器在单独的线程上使用解码,转换和OpenGL上下文工作正常但是我意识到因为视频是每秒25帧,我只从缓冲区获得转换后的帧,将其上传到OpenGL并将其绑定/显示OpenGL线程中有40毫秒.由于这个40ms的间隙,渲染循环绕过大约6-10次,没有显示它显示的每一帧的下一帧.
因此我决定为纹理设置一个缓冲区也是一个好主意,并设置一个纹理数组,用glGenTextures()和我需要的glParameters等创建和初始化.
当自最后一帧刷新以来还没有40ms时,运行一个方法,该方法从转换缓冲区中获取下一个转换后的帧,并通过绑定它然后调用glTexSubImage2D()将其上传到纹理缓冲区中的下一个自由纹理.当自最后一帧刷新以来已经过了40ms,运行了一个单独的方法,它从纹理缓冲区中抓取下一个GLuint纹理并将其与glBindTexture()绑定.因此,我只是将之前正在完成的工作(从转换缓冲区,上传,显示中获取)拆分为单独的方法(从转换缓冲区中获取,上传到纹理缓冲区|并从纹理缓冲区中获取,显示)以利用40ms之间的浪费时间刷新.
这听起来合理吗?因为当跑步时,视频一直以零星的方式停止,有时大约4帧被播放(假设每40ms)但是然后有2秒的间隙,然后显示1帧,然后是3秒的间隙而且视频完全无法观看.
代码几乎与我如何管理从解码缓冲区中获取解码帧的转换线程,将它们从YUV转换为RGB然后将它们放入转换缓冲区,因此无法看到大量瓶颈可能存在的位置.
瓶颈可能在OpenGL方面吗?事实是我将新的图像数据存储到10个不同的纹理这个问题就像从纹理缓冲区中抓取新纹理一样,原始数据在视频内存上的内存位置方面可能距离最后一个数百万英里. ?这是我唯一的尝试答案,但我不太了解OpenGL如何在内部工作,这就是我在这里发帖的原因.
有人有什么想法吗?
我正在尝试使用 AVFoundation 从图像创建视频。关于这种方法已经有多个线程,但我相信它们中的许多都与我在这里面临的问题相同。
视频在 iPhone 上可以正常播放,但不能在 VLC 上播放,例如在 Facebook 和 Vimeo 上也不能正常播放(有时某些帧不同步)。VLC 说视频的帧速率是 0.58 fps,但它应该超过 24 对吧?
有谁知道是什么导致了这种行为?
这是用于创建视频的代码:
self.videoWriter = [[AVAssetWriter alloc] initWithURL:[NSURL fileURLWithPath:videoOutputPath] fileType:AVFileTypeMPEG4 error:&error];
// Codec compression settings
NSDictionary *videoSettings = @{
AVVideoCodecKey : AVVideoCodecH264,
AVVideoWidthKey : @(self.videoSize.width),
AVVideoHeightKey : @(self.videoSize.height),
AVVideoCompressionPropertiesKey : @{
AVVideoAverageBitRateKey : @(20000*1000), // 20 000 kbits/s
AVVideoProfileLevelKey : AVVideoProfileLevelH264High40,
AVVideoMaxKeyFrameIntervalKey : @(1)
}
};
AVAssetWriterInput* videoWriterInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings];
AVAssetWriterInputPixelBufferAdaptor *adaptor = [AVAssetWriterInputPixelBufferAdaptor
assetWriterInputPixelBufferAdaptorWithAssetWriterInput:videoWriterInput
sourcePixelBufferAttributes:nil];
videoWriterInput.expectsMediaDataInRealTime = NO;
[self.videoWriter addInput:videoWriterInput];
[self.videoWriter …Run Code Online (Sandbox Code Playgroud) 我正在使用两个特征描述符,HOG和LBP进行人员检测.到目前为止,我使用简单的连接组合了这两个功能.但它有时会显示由于大矢量引起的问题.这是我的代码.
%extract features from negative and positive images
[HOGpos,HOGneg] = features(pathPos, pathNeg);
% loading and labeling each training example
HOG_featV = HOGfeature(fpos,fneg);
% get label of training data from HOG
HOGlabel = cell2mat(HOG_featV(2,:));
% get the feature vector value from HOG
HOGfeatureVector = HOG_featV(3,:)';
C = cell2mat(HOGfeatureVector); % each row of P correspond to a training example
%extract features from LBP
[LBPpos,LBPneg] = LBPfeatures(pathPos, pathNeg);
% loading and labeling each training example
LBP_featV = loadingV(LBPpos, LBPneg);
% get label of …Run Code Online (Sandbox Code Playgroud) 嘿,我现在能够通过执行以下命令行从我的MP4视频中获取缩略图:
[Sets Per-file main options time_off start time offset]
|| [The # of start time offsets]
|| || [Sets input video file option]
|| || || [Video file name here]
|| || || || [Sets video option to # of video frames to record]
|| || || || || [Asking for the first frame]
|| || || || || || [Name of the captured video frame]
|| || || || || || ||
\/ \/ \/ \/ \/ \/ \/ …Run Code Online (Sandbox Code Playgroud) 我一直在研究使用最新技术在iOS上进行视频处理的最佳方法,并得到了一些不同的结果.似乎有办法用Core Image,OpenGL和一些开源框架来做到这一点.我想避开开源选项,以便我可以了解幕后发生的事情,所以问题是:
iOS上预先录制的视频处理(滤镜,亮度,对比度等)的最佳选择是什么?
我知道Core Image有很多很棒的内置过滤器,并且有一个相对简单的API,但我没有找到任何有关如何将视频分解为图像然后重新编码的资源.对此主题的任何帮助都非常有用,谢谢.
我正在尝试为视频添加顶部和底部部分,就像我们对图像模因所做的一样。我正在使用ffmpeg和imagemagick,但是没有内置选项可以执行此任务。假设我有一个视频,我需要在整个视频中添加这样的标题。我怎样才能做到这一点?
ffmpeg imagemagick video-processing video-editing imagemagick-convert
我是网络视频渲染的新手.所以我想在开始开发之前询问我应该阅读哪些信息资源?后端技术是:ASP.NET MVC,Azure.
主要问题是:主持视频的最佳方式是什么?例如,我可以将它们保存在站点文件系统中.好/坏?
提前致谢.
我正在尝试集成Video -Trimming https://github.com/knowledge4life/k4l-video-trimmer并面临以下错误.我试图按照各种帖子的建议改变proguard.但是还没有成功.请帮忙.谢谢.
02-15 21:59:20.843 5421-5679/? E/AndroidRuntime: FATAL EXCEPTION: pool-8-thread-2
Process: com.abc.main, PID: 5421
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.coremedia.iso.boxes.FileTypeBox
at com.b.a.g.a(Unknown Source)
at com.b.a.a.a(Unknown Source)
at com.d.a.d.r(Unknown Source)
at com.d.a.d.hasNext(Unknown Source)
at com.d.a.c.e$1.hasNext(Unknown Source)
at com.b.a.d.a(Unknown Source)
at com.d.a.a.b.a.a.a(Unknown Source)
at life.knowledge4.videotrimmer.b.b.a(Unknown Source)
at life.knowledge4.videotrimmer.b.b.a(Unknown Source)
at life.knowledge4.videotrimmer.K4LVideoTrimmer$3.a(Unknown Source)
at life.knowledge4.videotrimmer.b.a$a.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: com.coremedia.iso.boxes.FileTypeBox
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at java.lang.Class.forName(Class.java:285)
at com.b.a.g.a(Unknown Source)
at …Run Code Online (Sandbox Code Playgroud) video-processing ×10
ffmpeg ×3
video ×2
.net ×1
android ×1
asp.net ×1
asp.net-mvc ×1
avfoundation ×1
c# ×1
core-image ×1
frame-rate ×1
image ×1
imagemagick ×1
ios ×1
matlab ×1
opengl ×1
textures ×1