mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-02 18:47:18 -05:00 
			
		
		
		
	update mjpeg stream detection
This commit is contained in:
		
							parent
							
								
									9fa6868af3
								
							
						
					
					
						commit
						1f63a30ee7
					
				@ -1190,11 +1190,6 @@ namespace MediaBrowser.Controller.MediaEncoding
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (type == MediaStreamType.Video)
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                streams = streams.Where(i => !string.Equals(i.Codec, "mjpeg", StringComparison.OrdinalIgnoreCase)).ToList();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (returnFirstIfNoIndex && type == MediaStreamType.Audio)
 | 
					            if (returnFirstIfNoIndex && type == MediaStreamType.Audio)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return streams.FirstOrDefault(i => i.Channels.HasValue && i.Channels.Value > 0) ??
 | 
					                return streams.FirstOrDefault(i => i.Channels.HasValue && i.Channels.Value > 0) ??
 | 
				
			||||||
 | 
				
			|||||||
@ -558,13 +558,36 @@ namespace MediaBrowser.MediaEncoding.Probing
 | 
				
			|||||||
                    ? MediaStreamType.EmbeddedImage
 | 
					                    ? MediaStreamType.EmbeddedImage
 | 
				
			||||||
                    : MediaStreamType.Video;
 | 
					                    : MediaStreamType.Video;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                stream.AverageFrameRate = GetFrameRate(streamInfo.avg_frame_rate);
 | 
				
			||||||
 | 
					                stream.RealFrameRate = GetFrameRate(streamInfo.r_frame_rate);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (isAudio || string.Equals(stream.Codec, "gif", StringComparison.OrdinalIgnoreCase) ||
 | 
				
			||||||
 | 
					                    string.Equals(stream.Codec, "png", StringComparison.OrdinalIgnoreCase))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    stream.Type = MediaStreamType.EmbeddedImage;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else if (string.Equals(stream.Codec, "mjpeg", StringComparison.OrdinalIgnoreCase))
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    // How to differentiate between video and embedded image?
 | 
				
			||||||
 | 
					                    // The only difference I've seen thus far is presence of codec tag, also embedded images have high (unusual) framerates 
 | 
				
			||||||
 | 
					                    if (!string.IsNullOrWhiteSpace(stream.CodecTag))
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        stream.Type = MediaStreamType.Video;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        stream.Type = MediaStreamType.EmbeddedImage;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    stream.Type = MediaStreamType.Video;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stream.Width = streamInfo.width;
 | 
					                stream.Width = streamInfo.width;
 | 
				
			||||||
                stream.Height = streamInfo.height;
 | 
					                stream.Height = streamInfo.height;
 | 
				
			||||||
                stream.AspectRatio = GetAspectRatio(streamInfo);
 | 
					                stream.AspectRatio = GetAspectRatio(streamInfo);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                stream.AverageFrameRate = GetFrameRate(streamInfo.avg_frame_rate);
 | 
					 | 
				
			||||||
                stream.RealFrameRate = GetFrameRate(streamInfo.r_frame_rate);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (streamInfo.bits_per_sample > 0)
 | 
					                if (streamInfo.bits_per_sample > 0)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    stream.BitDepth = streamInfo.bits_per_sample;
 | 
					                    stream.BitDepth = streamInfo.bits_per_sample;
 | 
				
			||||||
 | 
				
			|||||||
@ -36,6 +36,7 @@ namespace MediaBrowser.Model.LiveTv
 | 
				
			|||||||
            MediaLocationsCreated = new string[] { };
 | 
					            MediaLocationsCreated = new string[] { };
 | 
				
			||||||
            RecordingEncodingFormat = "mp4";
 | 
					            RecordingEncodingFormat = "mp4";
 | 
				
			||||||
            RecordingPostProcessorArguments = "\"{path}\"";
 | 
					            RecordingPostProcessorArguments = "\"{path}\"";
 | 
				
			||||||
 | 
					            EnableRecordingEncoding = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -322,6 +322,9 @@ namespace MediaBrowser.Model.Net
 | 
				
			|||||||
                throw new ArgumentNullException("mimeType");
 | 
					                throw new ArgumentNullException("mimeType");
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // handle text/html; charset=UTF-8
 | 
				
			||||||
 | 
					            mimeType = mimeType.Split(';')[0];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            string result;
 | 
					            string result;
 | 
				
			||||||
            if (ExtensionLookup.TryGetValue(mimeType, out result))
 | 
					            if (ExtensionLookup.TryGetValue(mimeType, out result))
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user