tomaszzmuda / Xabe.FFmpeg

.NET Standard wrapper for FFmpeg. It allows to process media without know how FFmpeg works, and can be used to pass customized arguments to FFmpeg from dotnet core application.

Home Page:https://xabe.net/product/xabe_ffmpeg/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FFmpegDownloader.GetLatestVersion(),The function failed to run on Linux

ckwr opened this issue · comments

commented

await FFmpegDownloader.GetLatestVersion(FFmpegVersion.Official, MetaPath)

Unhandled exception. System.IO.InvalidDataException: Central Directory corrupt.
---> System.IO.IOException: Invalid argument : '/tmp/05a25a8e4b164e62b555756b69bacaef'
at System.IO.Strategies.FileStreamHelpers.ThrowInvalidArgument(SafeFileHandle handle)
at System.IO.Strategies.OSFileStreamStrategy.Seek(Int64 offset, SeekOrigin origin)
at System.IO.Strategies.BufferedFileStreamStrategy.Seek(Int64 offset, SeekOrigin origin)
at System.IO.FileStream.Seek(Int64 offset, SeekOrigin origin)
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
--- End of inner exception stack trace ---
at System.IO.Compression.ZipArchive.ReadEndOfCentralDirectory()
at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode mode, Encoding entryNameEncoding)
at Xabe.FFmpeg.Downloader.FFmpegDownloaderBase.Extract(String ffMpegZipPath, String destinationDir, Func2 filter, Func2 getName)
at Xabe.FFmpeg.Downloader.FFmpegDownloaderBase.Extract(String ffMpegZipPath, String destinationDir)
at Xabe.FFmpeg.Downloader.OfficialFFmpegDownloader.DownloadLatestVersion(FFbinariesVersionInfo latestFFmpegBinaries, String path, IProgress1 progress, Int32 retries) at Xabe.FFmpeg.Downloader.OfficialFFmpegDownloader.GetLatestVersion(String path, IProgress1 progress, Int32 retries)
at Xabe.FFmpeg.Downloader.FFmpegDownloader.GetLatestVersion(FFmpegVersion version, String path, IProgress`1 progress)
at InkScreen.FF.FFmpegCore.DownloadCoreAsync() in /src/InkScreen/FF/FFmpegCore.cs:line 36
at InkScreen.WebApplicationExtend.UseFFmpegAsync(WebApplication app) in /src/InkScreen/WebApplicationExtend.cs:line 11
at Program.

$(String[] args) in /src/InkScreen/Program.cs:line 30
at Program.(String[] args)

I am getting the same exception on Windows. It hangs for a long time as if it is downloading but finally gives this exception. I am thinking it is trying to unzip the downloaded file.

I have since gotten another exception: "Access to the path 'C:\WINDOWS\system32\ffmpeg.exe' is denied." I don't know why it would be trying to put it there since I pointed it to the Assembly.GetEntryAssembly().Location.

I've found one issue with downloading code.
Exceptions was silently catched and process continues: that might have been a problem with "Central Directory corrupt"
I've pushed code to master and deploy it this week but can't reproduce that issue so I'm not 100% sure that it will help

Thanks, Tomasz. I have been able to move past this problem by just copying ffmpeg.exe and ffprobe.exe from the assembly folder of Xabe.FFmpeg to the assembly folder of my app. Currently I'm trying to figure out how to make Xabe.FFmpeg convert from .wav audio to .mp3. I already do this with Laerdal.FFmpeg.Audio for Android and iOS so I know that FFmpeg.exe can do this conversion.