Jump to content

Anyway to tweak transcoding quality?


x-cimo

Recommended Posts

I've been playing with Emby and Plex on the same computer, I will always prefer opensource and feature wise the both meet my needs.

 

The only things that is holding me back to go Emby is that Plex seem to produce sharper video (possibly because they let you choose Prefer Higher quality encoding, rather than speed).

The other option missing from Emby is to stream the original (no transcode) content, which seem pretty effective for local network/high quality, yet use less CPU. Hope to see this in emby!

 

Is there anyway to modify some files to change the ffmpeg setting?

 

Thank for your hard work, it's pretty impressive!

Edited by x-cimo
  • Like 1
Link to comment
Share on other sites

Hi, thanks. We do always stream at original quality, whenever the device allows.

 

What encoding setting in particular would you like to customize?

Link to comment
Share on other sites

The option which affect picture quality are:

 

-preset and -crf 

 

This seems to be the config for ffmpeg from the transcode log

Emby-Server\ffmpeg\20160410\ffmpeg.exe -ss 00:04:28.357 -fflags +genpts -i file:"abc.M2TS" -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -force_key_frames "expr:gte(t,n_forced*5)" -copyts -avoid_negative_ts disabled -start_at_zero -pix_fmt yuv420p -preset superfast -crf 23 -b:v 19360000 -maxrate 19360000 -bufsize 38720000 -vsync -1 -profile:v high -level 51 -map_metadata -1 -threads 0 -codec:a:0 libmp3lame -ac 2 -ab 640000 -af "aresample=async=1,volume=2" -y "337fdce40e4eba82050c8a5cc0b15a85.mkv"

Current presets in descending order of speed are: ultrafast,superfastveryfastfasterfastmediumslowslowerveryslowplacebo. The default preset is medium.

 

As for the "Original" quality, I am not sure why but the option is missing from both Chrome webbrower or the Emby Android app, where it's available in both when using Plex. Might be worth having a look.

 

Thanks!

Edited by x-cimo
  • Like 1
Link to comment
Share on other sites

I can see you're on the ball; the fields are already in the beta; Thank you.

 

Going back to the "Original quality" or, remux vs transcode.

 

I am a C dev myself and decided to dig into it. I clearly was seeing transcoding, but like you said emby support remux only (copy video stream).

 

In fact, I have cloned master, pointed it to the same media and stepped through the code, it ended up in the remux mode.

 

I really don't why the release instance is doing transcode instead of remux knowing that:

I am using the same browser

I am using the same media

I am using all the default setting in 60Mbps mode

 

Remuxing:

D:\ffmpeg\bin\ffmpeg.exe -fflags +genpts -i file:"\\FS\Movie.M2TS" -map 0:0 -map 0:1 -map -0:s -codec:v:0 copy -copyts -avoid_negative_ts disabled -start_at_zero -map_metadata -1 -threads 0 -codec:a:0 libmp3lame -ac 2 -ab 640000 -af "aresample=async=1,volume=2" -y "C:\Users\aa\Desktop\Emby-master\MediaBrowser.Server.Mono\bin\Debug\ProgramData-Server\transcoding-temp\0bb17e00e7a33e4aa973c8482e95f78b.mkv"

 

Transcoding:

D:\ffmpeg\20160410\ffmpeg.exe -fflags +genpts -i file:"\\FS\Movie.M2TS" -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -force_key_frames "expr:gte(t,n_forced*5)" -copyts -avoid_negative_ts disabled -start_at_zero -pix_fmt yuv420p -preset superfast -crf 23 -b:v 29701869 -maxrate 29701869 -bufsize 59403738 -vsync -1 -profile:v high -level 41 -map_metadata -1 -threads 0 -codec:a:0 libmp3lame -ac 2 -ab 640000 -af "aresample=async=1,volume=2" -y "C:\Users\Administrator\AppData\Roaming\Emby-Server\transcoding-temp\d3338298789bc1e038c020c35ad394b3.mkv"

 

Let me know if you have some ideas

 

Here is a diff of the json from both log:

 

http://tlrobinson.net/projects/javascript-fun/jsondiff/#%7B%22d%22%3A%7B%22a%22%3A%22%7B%5C%22Protocol%5C%22%3A%5C%22File%5C%22%2C%5C%22Id%5C%22%3A%5C%22%5C%22%2C%5C%22Path%5C%22%3A%5C%22%5C%5C%5C%5C%5C%5C%5C%5CFS%5C%5C%5C%5CMovie.M2TS%5C%22%2C%5C%22Type%5C%22%3A%5C%22Default%5C%22%2C%5C%22Container%5C%22%3A%5C%22M2TS%5C%22%2C%5C%22Name%5C%22%3A%5C%221080P%2FH264%2FAC3%5C%22%2C%5C%22ETag%5C%22%3A%5C%223ee94bfc5890f076919b753165551a21%5C%22%2C%5C%22RunTimeTicks%5C%22%3A58338660000%2C%5C%22ReadAtNativeFramerate%5C%22%3Afalse%2C%5C%22SupportsTranscoding%5C%22%3Atrue%2C%5C%22SupportsDirectStream%5C%22%3Atrue%2C%5C%22SupportsDirectPlay%5C%22%3Atrue%2C%5C%22RequiresOpening%5C%22%3Afalse%2C%5C%22RequiresClosing%5C%22%3Afalse%2C%5C%22VideoType%5C%22%3A%5C%22VideoFile%5C%22%2C%5C%22MediaStreams%5C%22%3A%5B%7B%5C%22Codec%5C%22%3A%5C%22h264%5C%22%2C%5C%22CodecTag%5C%22%3A%5C%22HDMV%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221001%2F48000%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22BitRate%5C%22%3A29701820%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Height%5C%22%3A1080%2C%5C%22Width%5C%22%3A1920%2C%5C%22AverageFrameRate%5C%22%3A23.97602%2C%5C%22RealFrameRate%5C%22%3A23.97602%2C%5C%22Profile%5C%22%3A%5C%22High%5C%22%2C%5C%22Type%5C%22%3A%5C%22Video%5C%22%2C%5C%22AspectRatio%5C%22%3A%5C%2216%3A9%5C%22%2C%5C%22Index%5C%22%3A0%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22PixelFormat%5C%22%3A%5C%22yuv420p%5C%22%2C%5C%22Level%5C%22%3A41%2C%5C%22IsAnamorphic%5C%22%3Afalse%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22ac3%5C%22%2C%5C%22CodecTag%5C%22%3A%5C%22AC-3%5C%22%2C%5C%22Language%5C%22%3A%5C%22fra%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F48000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Fra%20Dolby%20Digital%206%20ch%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22BitRate%5C%22%3A640000%2C%5C%22Channels%5C%22%3A6%2C%5C%22SampleRate%5C%22%3A48000%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Audio%5C%22%2C%5C%22Index%5C%22%3A1%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22dca%5C%22%2C%5C%22Language%5C%22%3A%5C%22eng%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F48000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Eng%20DTS-HD%20MA%206%20ch%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22BitRate%5C%22%3A1536000%2C%5C%22Channels%5C%22%3A6%2C%5C%22SampleRate%5C%22%3A48000%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Profile%5C%22%3A%5C%22DTS-HD%20MA%5C%22%2C%5C%22Type%5C%22%3A%5C%22Audio%5C%22%2C%5C%22Index%5C%22%3A2%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22pgssub%5C%22%2C%5C%22Language%5C%22%3A%5C%22fra%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Fra%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Subtitle%5C%22%2C%5C%22Index%5C%22%3A3%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22pgssub%5C%22%2C%5C%22Language%5C%22%3A%5C%22fra%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Fra%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Subtitle%5C%22%2C%5C%22Index%5C%22%3A4%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22pgssub%5C%22%2C%5C%22Language%5C%22%3A%5C%22eng%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Eng%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Subtitle%5C%22%2C%5C%22Index%5C%22%3A5%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22pgssub%5C%22%2C%5C%22Language%5C%22%3A%5C%22eng%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Eng%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Subtitle%5C%22%2C%5C%22Index%5C%22%3A6%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%5D%2C%5C%22PlayableStreamFileNames%5C%22%3A%5B%5D%2C%5C%22Formats%5C%22%3A%5B%5D%2C%5C%22Bitrate%5C%22%3A29701820%2C%5C%22RequiredHttpHeaders%5C%22%3A%7B%7D%7D%5Cn%22%2C%22b%22%3A%22%7B%5C%22Protocol%5C%22%3A%5C%22File%5C%22%2C%5C%22Id%5C%22%3A%5C%22e9b77c80dd0704837503231b083bea19%5C%22%2C%5C%22Path%5C%22%3A%5C%22%5C%5C%5C%5C%5C%5C%5C%5CFS%5C%5C%5C%5CMovie.M2TS%5C%22%2C%5C%22Type%5C%22%3A%5C%22Default%5C%22%2C%5C%22Container%5C%22%3A%5C%22M2TS%5C%22%2C%5C%22Name%5C%22%3A%5C%221080P%2FH264%2FAC3%5C%22%2C%5C%22ETag%5C%22%3A%5C%223ee94bfc5890f076919b753165551a21%5C%22%2C%5C%22RunTimeTicks%5C%22%3A58338560000%2C%5C%22ReadAtNativeFramerate%5C%22%3Afalse%2C%5C%22SupportsTranscoding%5C%22%3Atrue%2C%5C%22SupportsDirectStream%5C%22%3Atrue%2C%5C%22SupportsDirectPlay%5C%22%3Atrue%2C%5C%22RequiresOpening%5C%22%3Afalse%2C%5C%22RequiresClosing%5C%22%3Afalse%2C%5C%22VideoType%5C%22%3A%5C%22VideoFile%5C%22%2C%5C%22MediaStreams%5C%22%3A%5B%7B%5C%22Codec%5C%22%3A%5C%22h264%5C%22%2C%5C%22CodecTag%5C%22%3A%5C%22HDMV%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221001%2F48000%5C%22%2C%5C%22NalLengthSize%5C%22%3A%5C%220%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsAVC%5C%22%3Afalse%2C%5C%22BitRate%5C%22%3A29701869%2C%5C%22BitDepth%5C%22%3A8%2C%5C%22RefFrames%5C%22%3A2%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Height%5C%22%3A1080%2C%5C%22Width%5C%22%3A1920%2C%5C%22AverageFrameRate%5C%22%3A23.97602%2C%5C%22RealFrameRate%5C%22%3A23.97602%2C%5C%22Profile%5C%22%3A%5C%22High%5C%22%2C%5C%22Type%5C%22%3A%5C%22Video%5C%22%2C%5C%22AspectRatio%5C%22%3A%5C%2216%3A9%5C%22%2C%5C%22Index%5C%22%3A0%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22PixelFormat%5C%22%3A%5C%22yuv420p%5C%22%2C%5C%22Level%5C%22%3A41%2C%5C%22IsAnamorphic%5C%22%3Afalse%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22ac3%5C%22%2C%5C%22CodecTag%5C%22%3A%5C%22AC-3%5C%22%2C%5C%22Language%5C%22%3A%5C%22fra%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F48000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Fra%20Dolby%20Digital%205.1%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22ChannelLayout%5C%22%3A%5C%225.1%5C%22%2C%5C%22BitRate%5C%22%3A640000%2C%5C%22Channels%5C%22%3A6%2C%5C%22SampleRate%5C%22%3A48000%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Audio%5C%22%2C%5C%22Index%5C%22%3A1%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22dca%5C%22%2C%5C%22Language%5C%22%3A%5C%22eng%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F48000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Eng%20DTS-HD%20MA%207.1%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22ChannelLayout%5C%22%3A%5C%227.1%5C%22%2C%5C%22BitDepth%5C%22%3A24%2C%5C%22Channels%5C%22%3A8%2C%5C%22SampleRate%5C%22%3A48000%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Profile%5C%22%3A%5C%22DTS-HD%20MA%5C%22%2C%5C%22Type%5C%22%3A%5C%22Audio%5C%22%2C%5C%22Index%5C%22%3A2%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22pgssub%5C%22%2C%5C%22Language%5C%22%3A%5C%22fra%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Fra%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Subtitle%5C%22%2C%5C%22Index%5C%22%3A3%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22pgssub%5C%22%2C%5C%22Language%5C%22%3A%5C%22fra%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Fra%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Subtitle%5C%22%2C%5C%22Index%5C%22%3A4%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22pgssub%5C%22%2C%5C%22Language%5C%22%3A%5C%22eng%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Eng%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Subtitle%5C%22%2C%5C%22Index%5C%22%3A5%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%2C%7B%5C%22Codec%5C%22%3A%5C%22pgssub%5C%22%2C%5C%22Language%5C%22%3A%5C%22eng%5C%22%2C%5C%22TimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22CodecTimeBase%5C%22%3A%5C%221%2F90000%5C%22%2C%5C%22DisplayTitle%5C%22%3A%5C%22Eng%5C%22%2C%5C%22IsInterlaced%5C%22%3Afalse%2C%5C%22IsDefault%5C%22%3Afalse%2C%5C%22IsForced%5C%22%3Afalse%2C%5C%22Type%5C%22%3A%5C%22Subtitle%5C%22%2C%5C%22Index%5C%22%3A6%2C%5C%22IsExternal%5C%22%3Afalse%2C%5C%22IsTextSubtitleStream%5C%22%3Afalse%2C%5C%22SupportsExternalStream%5C%22%3Afalse%2C%5C%22Level%5C%22%3A0%7D%5D%2C%5C%22PlayableStreamFileNames%5C%22%3A%5B%5D%2C%5C%22Formats%5C%22%3A%5B%5D%2C%5C%22Bitrate%5C%22%3A29701869%2C%5C%22RequiredHttpHeaders%5C%22%3A%7B%7D%7D%22%7D%7D

Link to comment
Share on other sites

Thanks, looked at the logs, and right now I'm not sure. It would require deeper investigation. Perhaps there was a change that I made recently that I'm just forgetting about that would cause a difference between the two. If I can think of anything I'll let you know.

Link to comment
Share on other sites

I have both running 3.1.141-beta, same issue, so it's not something you change, its something with my environment.  I'll keep digging. 

Link to comment
Share on other sites

CBers

So are SUPERFAST and 23 the correct defaults for these 2 options ??

 

Shouldn't "H264 encoding preset" be set to AUTO ??

 

I don't get a lot, if any, transcoding/remuxing, but I know friends and family do, so just trying to get a steer on these new settings.

 

Thanks @@x-cimo and Luke.

Link to comment
Share on other sites

So are SUPERFAST and 23 the correct defaults for these 2 options ??

 

Shouldn't "H264 encoding preset" be set to AUTO ??

 

I don't get a lot, if any, transcoding/remuxing, but I know friends and family do, so just trying to get a steer on these new settings.

 

Thanks @@x-cimo and Luke.

 

 

I am quite good at noticing quality issue (noise etc) and the old default (SUPERFAST) was just not very sharp. Most of my movies are Blu-rays and should be very sharp.

 

I have played with this setting last night and moving from SUPERFAST to SLOW, and quality improvement is day and night. I played both (original and the transcode) side by side and they were very close (MUCH better than the SUPERFAST) setting.

 

I am not yet sure what "Auto" does; however the ability to change this setting can produce great improvement if the source is good.

 

ffmpeg "defaults" are MEDIUM and 23.

 

I would recommend to play with the settings.

Edited by x-cimo
  • Like 1
Link to comment
Share on other sites

I found the issue, however I am not sure why it's doing that.

 

I could not reproduce the issue initially because I was debugging MediaBrowser.Server.Mono, instead of MediaBrowser.ServerApplication (which is the app running on my Windows server).

 

As soon as I switched to ServerApplication, my stream started to transcode instead of remux.

 

The culprit is "IsAVC":false, Luke, if you have another look at the logs I sent you, you will see that both http request are the same but for some reason the json on the transcode one has "IsAVC":false extra.

 

With this field, the function protected virtual bool CanStreamCopyVideo(StreamState state) return FALSE because of:

if (string.Equals("h264", videoStream.Codec, StringComparison.OrdinalIgnoreCase))
{
 if (videoStream.IsAVC.HasValue && !videoStream.IsAVC.Value)
 {
   Logger.Debug("Cannot stream copy video. Stream is marked as not AVC");
   return false;
  }
}

I don't know where the "IsAVC":false is coming from,  or what AVC is.

Link to comment
Share on other sites

Both my host are windows; both are using the same version of ffmpeg. 

 

I don't remember where I got ffmpeg from, I tried too many things.

 

On the same host (my debugger), the mono project works fine but the ServerApplication dosen't

 

Still trying to trace that one back

Link to comment
Share on other sites

For the remux the IsAVC return null, and for the Transcode IsAVC return false.  I think that is coming from the SQLite DB, and it's possible there was a mismatch in ffmpeg version.

 

I will get the latest version off ffmpeg and reset the DB. I'm not sure if the movie is actually AVC or not, reguardless, the remux "copy" work fine on the file.

 

I wonder if that is actually true. Logger.Debug("Cannot stream copy video. Stream is marked as not AVC");

 

Will keep looking tomorrow.

 

Thanks

Link to comment
Share on other sites

I wonder if that is actually true. Logger.Debug("Cannot stream copy video. Stream is marked as not AVC");

 

It is true for some devices, but others can probably handle it. So it might need to be something that becomes conditional per app.

Link to comment
Share on other sites

Last thing for tonight.

 

I downloaded the latest ffmepg from the recommanded site, I also resetted all the setting / db.

 

AVC is false..

 

For what it's worth, VLC media player say this about the codec:

Codec: H264 - MPEG-4 AVC (part 10) (h264).

 

Either the file is AVC and not reported as AVC (seems like it?) or it's not AVC and chrome can play it nevertheless.

 

Another solution would be to do like Plex and have a "Original" option as a bitrate choice and force a copy.

Link to comment
Share on other sites

spent some time with ffprobe, and ffmpeg source code

 

Looks like my streams are not AVC; so I tend to agree that your proposed solution is probably the best ( stating AVC support within the profile, rather than forcing everybody in the current code path ).

 

Chrome and android app can play Not AVC streams just fine.

Link to comment
Share on other sites

Guest asrequested

Are these settings supposed to apply to records, too? Because I've just tested two recordings, one with CRF at 40 and one with CRF 18, encoding set to fast and QS enabled. There was no difference in the recordings. File size remained the same, pretty much uncompressed. I'll test with QS disabled, and see if that makes a difference.

 

Update:

 

Here's the info for a show I recorded with the CRF 18, encoding fast and hardware acceleration set to none. I believe the bitrate should be much lower, right?

 

57d45c1275c2b_Snapshot_245.jpg

 

Changing the CRF to 51 raised the bitrate

 

57d45e0137336_Snapshot_246.jpg

 

Update 2:

 

Set CRF to 1.... No change. Changing from fast to superfast also yields nothing. So either it isn't working or it only works for streaming. 

Edited by Doofus
Link to comment
Share on other sites

I could be wrong about that but I would not expect the bitrate or size to change much. What change is the quality of the encoding.

 

However by looking at the transcode log at the ffmpeg command you should see the preset change accoeding to what you choose. If they are not changing something is not working for post transcoding.

Link to comment
Share on other sites

Guest asrequested

I could be wrong about that but I would not expect the bitrate or size to change much. What change is the quality of the encoding.

 

However by looking at the transcode log at the ffmpeg command you should see the preset change accoeding to what you choose. If they are not changing something is not working for post transcoding.

 

 

No matter what I did, the quality and size didn't change at all. With the original settings the file size was half of the original. Now it's back at that same level. That is to say it's not compressed at all, and there should be compression. That is the purpose of using the h264 codec. The compression is the only reason I have it set to convert to MP4.

 

57d4ecf0a6dfd_Snapshot_248.jpg

Edited by Doofus
Link to comment
Share on other sites

puithove

It doesn't seem to be using these configurable params for the recording conversion.  I think @@Luke would need to add that.

 

You can see the ffmpeg commandline used in the logs.  Here is the commandline from a test recording after I changed the params.  No difference:

 

/usr/bin/ffmpeg -fflags +genpts -async 1 -vsync -1 -re -i "/tmp-disk/emby/transcoding-temp/8c09d62a499e44b89b509bae38454c18.ts" -t 01:25:11.732 -sn -codec:v:0 libx264 -force_key_frames "expr:gte(t,n_forced*5)"  -vf "yadif=0:-1:0" -pix_fmt yuv420p -preset superfast -crf 23 -b:v 25000000 -maxrate 25000000 -bufsize (25000000*2) -vsync -1 -profile:v high -level 41 -map_metadata -1 -threads 0 -codec:a:0 aac -strict experimental -ab 320000 -y "/share/media-pub/recordings/emby/Weather Center Live/Weather Center Live 2001-10-14.mkv"

Edited by puithove
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...