I don't think MP1 uses ffprobe/ffmpeg (somebody correct me if I'm wrong).What is made differently in MPExt for MP1?
Germany
In fact it does:I don't think MP1 uses ffprobe/ffmpeg (somebody correct me if I'm wrong).
public static Stream ExtractImage(MediaSource source, long position, int? maxWidth, int? maxHeight, string borders, string format)
{
if (!source.Exists)
{
Log.Warn("ExtractImage: Source {0} (resolved to path {1}) doesn't exists", source.GetDebugName(), source.GetPath());
WCFUtil.SetResponseCode(System.Net.HttpStatusCode.NotFound);
return Stream.Null;
}
if (!source.SupportsDirectAccess)
{
Log.Warn("ExtractImage: Extracting images from remote sources isn't supported yet", source.MediaType, source.Id);
WCFUtil.SetResponseCode(System.Net.HttpStatusCode.NotImplemented);
return Stream.Null;
}
// get temporary filename
string filename = String.Format("extract_{0}_{1}.jpg", source.GetUniqueIdentifier(), position);
string tempFile = cache.GetPath(filename);
// maybe it exists in cache, return that then
if (cache.Contains(filename))
{
// if source is newer, cached image needs to be recreated
if (source.GetFileInfo().LastModifiedTime > cache.GetLastModifiedTime(tempFile))
{
cache.Invalidate(filename);
}
else
{
return StreamPostprocessedImage(new ImageMediaSource(tempFile), maxWidth, maxHeight, borders, format);
}
}
// We need to impersonate to access the network drive and check if the thumbnail already exists. However, because
// impersonation is lost when starting a process, we can't start ffmpeg from in here. We need to check whether the
// file is accessible from outside the impersonation context again, and start the ffmpeg process as a different user
// if that is the case.
string fullPath;
using (var context = source.CreateNetworkContext())
{
fullPath = context.RewritePath(source.GetPath());
// stream a pre-existing thumbnail, if possible
if (source.MediaType == WebMediaType.Recording && Path.GetExtension(fullPath).ToLower() == ".ts")
{
var thumbnailFileInfo = new FileInfo(Path.ChangeExtension(fullPath, ".jpg"));
if (thumbnailFileInfo.Exists && thumbnailFileInfo.Length > 0)
return StreamPostprocessedImage(new ImageMediaSource(thumbnailFileInfo.FullName), maxWidth, maxHeight, borders, format);
}
}
// finally, extract the image with ffmpeg if everything else has failed
bool extractResult = ExecuteFFMpegExtraction(source, fullPath, position, tempFile);
if (!extractResult)
{
WCFUtil.SetResponseCode(System.Net.HttpStatusCode.InternalServerError);
return Stream.Null;
}
return StreamPostprocessedImage(new ImageMediaSource(tempFile), maxWidth, maxHeight, borders, format);
}
private static bool ExecuteFFMpegExtraction(MediaSource source, string path, long position, string tempFile)
{
var info = new ProcessStartInfo();
info.Arguments = String.Format("-ss {0} -i \"{1}\" -vframes 1 -vf \"yadif,scale=ih*dar:ih\" -f image2 \"{2}\"", position, path, tempFile);
info.FileName = Configuration.StreamingProfiles.FFMpegPath;
info.CreateNoWindow = true;
info.UseShellExecute = false;
info.RedirectStandardError = Log.IsEnabled(LogLevel.Trace);
info.RedirectStandardOutput = Log.IsEnabled(LogLevel.Trace);
TranscoderProcess proc = new TranscoderProcess();
proc.StartInfo = info;
if (source.NeedsImpersonation)
proc.StartAsUser(Configuration.Services.NetworkImpersonation.Domain, Configuration.Services.NetworkImpersonation.Username, Configuration.Services.NetworkImpersonation.GetPassword());
else
proc.Start();
if (Log.IsEnabled(LogLevel.Trace))
{
Log.Trace("ExtractImage: executing path={0} arguments={1}", info.FileName, info.Arguments);
StreamCopy.AsyncStreamRead(proc.StandardError, l => Log.Trace("ExtractImage: stderr: {0}", l));
StreamCopy.AsyncStreamRead(proc.StandardOutput, l => Log.Trace("ExtractImage: stdout: {0}", l));
}
proc.WaitForExit();
if (!File.Exists(tempFile))
{
Log.Warn("Failed to extract image from {0} with {1} {2}", source.GetDebugName(), info.FileName, info.Arguments);
return false;
}
return true;
}
Germany
Hehe, sounds like a Apple Fan^^ I don't know why Apple safes in the IO, I mean I also have a ultra Slim Samsung Ultrabook and you can just pop a LAN Port out so that it fits into the slim design...Haha, it's easier said than done. It's a Macbook Pro(with Win 10 as VM) that don't have a network port.
So Everything is working except the MediaInfo?Reimport of Movies went fine.
This is the Exception:but the video do not play when using the streaming url in video player in MPiV.
@henso looks also like a small Bug in the TranscodingService[2015-11-01 15:40:01,227] [21749111] [15 ] [ERROR] - MainRequestHandler: Exception:
System.InvalidCastException: Unable to cast object of type 'MediaPortal.Extensions.ResourceProviders.NetworkNeighborhoodResourceProvider.NetworkNeighborhoodResourceAccessor' to type 'MediaPortal.Common.ResourceAccess.INetworkResourceAccessor'.
at MediaPortal.Plugins.Transcoding.Service.Transcoders.FFMpeg.FFMpegCommandline.AddInputOptions(FFMpegTranscodeData& data) in d:\TeamCity\buildAgent\work\7c012272298dd9c7\MediaPortal\Incubator\TranscodingService\Transcoders\FFMpeg\FFMpegCommandline.cs:line 162
at MediaPortal.Plugins.Transcoding.Service.Transcoders.FFMpeg.FFMpegCommandline.InitTranscodingParameters(IResourceAccessor sourceFile, FFMpegTranscodeData& data) in d:\TeamCity\buildAgent\work\7c012272298dd9c7\MediaPortal\Incubator\TranscodingService\Transcoders\FFMpeg\FFMpegCommandline.cs:line 154
at MediaPortal.Plugins.Transcoding.Service.Transcoders.FFMpeg.FFMpegCommandline.ExtractSubtitleFile(VideoTranscoding video, SubtitleStream subtitle, String subtitleEncoding, String targetFilePath) in d:\TeamCity\buildAgent\work\7c012272298dd9c7\MediaPortal\Incubator\TranscodingService\Transcoders\FFMpeg\FFMpegCommandline.cs:line 273
at MediaPortal.Plugins.Transcoding.Service.MediaConverter.GetSubtitle(VideoTranscoding video) in d:\TeamCity\buildAgent\work\7c012272298dd9c7\MediaPortal\Incubator\TranscodingService\MediaConverter.cs:line 1030
at MediaPortal.Plugins.Transcoding.Service.MediaConverter.TranscodeVideoFile(VideoTranscoding video, Double timeStart, Double timeDuration, Boolean waitForBuffer) in d:\TeamCity\buildAgent\work\7c012272298dd9c7\MediaPortal\Incubator\TranscodingService\MediaConverter.cs:line 1289
at MediaPortal.Plugins.Transcoding.Service.MediaConverter.GetMediaStream(BaseTranscoding transcodingInfo, Double timeStart, Double timeDuration, Boolean waitForBuffer) in d:\TeamCity\buildAgent\work\7c012272298dd9c7\MediaPortal\Incubator\TranscodingService\MediaConverter.cs:line 1225
at MediaPortal.Plugins.MP2Extended.ResourceAccess.WSS.stream.Control.RetrieveStream.Process(IHttpRequest request, IHttpResponse response, IHttpSession session) in m:\Programmieren\C#\MediaPortal 2\MediaPortal\Incubator\MP2Extended\ResourceAccess\WSS\stream\Control\RetrieveStream.cs:line 216
at MediaPortal.Plugins.MP2Extended.ResourceAccess.WSS.StreamingServiceStreamHandler.Process(IHttpRequest request, IHttpResponse response, IHttpSession session) in m:\Programmieren\C#\MediaPortal 2\MediaPortal\Incubator\MP2Extended\ResourceAccess\WSS\StreamingServiceStreamHandler.cs:line 54
at MediaPortal.Plugins.MP2Extended.ResourceAccess.StreamingServiceHandler.Process(IHttpRequest request, IHttpResponse response, IHttpSession session) in m:\Programmieren\C#\MediaPortal 2\MediaPortal\Incubator\MP2Extended\ResourceAccess\StreamingServiceHandler.cs:line 35
at MediaPortal.Plugins.MP2Extended.ResourceAccess.MainRequestHandler.Process(IHttpRequest request, IHttpResponse response, IHttpSession session) in m:\Programmieren\C#\MediaPortal 2\MediaPortal\Incubator\MP2Extended\ResourceAccess\MainRequestHandler.cs:line 139
Germany
Germany
OK, but the input is a video file, correct? Video and audio files have no problem.In fact it does
Germany
Thanks! Another try. Line 60 is a nasty oneMuch better, got quite a lot of mediainfo now. It's hard to tell if all is there but I guess audio/subs are not fully correct. Some exceptions in server log.
ah my bad. I thought it is a general problem...OK, but the input is a video file, correct? Video and audio files have no problem.
Hmm, don't really know how to proceed.For images a bug report was posted 4 years ago (https://trac.ffmpeg.org/ticket/819), so I don't think we will see it fixed anytime soon.
There is the possibility to use short file names but if I recall correctly this will not work with network paths.