锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置:锐英源 / 开源技术 / ffmpeg / ffmpeg提取图像失败-临时目录问题和版本问题
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

ffmpeg提取图像失败-临时目录问题和版本问题

There was always no bitmap (null) available.总是没有可用的(无效的)位图。

So when I debugged your code I found out that the temp file is always empty (length=0)?!? 所以当我调试代码时发现临时文件总是空的(length= 0)? ! ?

However the mpeg file information is correct and available. 但是mpeg文件信息是正确的并且是可用的。

Why no data?为什么没有数据?

Did you try to execute the ffmpeg.exe command directly? I think that's the first way to start debugging. If that doesn't work, there's something wrong with the video data or even the ffmpeg.exe executables. It could also be a problem with privileges. Do you run your code with a different user than when trying ffmpeg.exe from command line directly? And is there definitely a file created with length zero before it is accessed or doesn't executing ffmpeg.exe create any output at all?

你试着直接执行ffmpeg.exe命令?我认为这是开始调试的首选方法。如果这也不起作用,则ffmpeg.exe的执行和视频数据可能出错,它也可能是特权问题。你在一个不同的用户下运行你的代码时,试过直接从命令行运行ffmpeg.exe吗?有之前创建的长度为零文件随后被访问或ffmpeg.exe不执行任何输出吗?

PS: For debugging - the Execute() method should return a sting containing the command-line output of ffmpeg.exe. Try saving it to a variable and check it out for error messages

PS:调试——Execute()方法应该返回一个包含ffmpeg.exe命令行输出的字符串。尝试保存到变量并且检查错误的消息 。

Thanks's for reply. I do not know why but I changed the temp directory to another harddisk e.g. "D:\". Now it's working. Unfortunately the FFMPEG.exe is very, very slow due to writing to harddisk ... But nevertheless, it works

感谢你的回复。我不知道为什么但我改变了“D:\”临时目录到另一个硬盘。现在可以工作了,遗憾的是,FFMPEG.exe是由于硬盘原因运行非常缓慢,…但是不管怎样,它可以运行了


Hej, for speed, I don't know if that really is because of the harddisk because finding the frame takes quite a while before it can be extracted and written to the disc. If that's not the case and it is the disc slowing you down, you can use the DLLs directly with pinvoke - I wrote an article about that here: Invoke FFmpeg to export frames

Hej,好速度,我真的不知道这是硬盘原因,因为找到帧需要相当长一段时间,才能提取并写入磁盘。如果不是这样的话,你的硬盘运行慢导致的慢,可以使用dll直接调用pinvoke——关于这一点我写了一篇文章:调用FFmpeg输出帧

Yeah, I get the same result as him. 是的,我也遇到过这种情况。 temp file is empty. String using Execute is blank. 临时文件是空的。使用执行字符串是空的。

debugging the program says cmdParams is set to: 调试程序说CMD PARAMS设置为:
cmdParams "-hide_banner -ss 00:00:20 -i C:\\b.mp4 -r 1 -t 1 -f image2 c:\\temp\tno0241.tmp"

If I try a similar string in an unelevated command prompt like so: 如果我在unelevated命令提示符尝试类似的字符串,就象这样:
C:\ffmpeg.exe -hide_banner -ss 00:00:20 -i C:\b.mp4 -r 1 -t 1 -f image2 C:\temp\tno0241.tmp

It works fine 它可以正常工作!

think I found something that might cause this problem. Could it be that you are using a the "shared" version of ffmpeg (not the "static" one) and that the ffmpeg.exe is not in the same directory as your debug binary? In that case the working directory is the one your code is running at and thus ffmpeg.exe cannot avcodec-57.dll and the other DLLs.

我发现一些可能会导致这个问题的原因,有没有可能你使用的ffmpeg.exe“共享”版本(不是“静态”)调试二进制不是在同一个目录?在这种情况下,工作目录是一个代码在运行,因此ffmpeg.exe不能运行avcodec-57.dll和其他dll。

If that's the case, there are three solutions to this: 如果是这样的话,有三个解决方案:
1.Place all ffmpeg.exe files in the folder of your binary ffmpeg.exe文件二进制文件的文件夹
2.Change the Execute() method to set the working directory to the directory of the ffmpeg.exe 改变Execute()方法来设置ffmpeg.exe的工作目录
3.Use the static version of ffmeg 使用ffmeg的静态版本

友情链接
版权所有 Copyright(c)2004-2021 锐英源软件
公司注册号:410105000449586 豫ICP备08007559号 最佳分辨率 1024*768
地址:郑州大学北校区院(文化路97号院)内