Jump to content

Bad transcoding quality


Recommended Posts

Posted

Playing an h264 mkv to Kodi does not require transcoding, and the video looks great. Playing to Chrome ("audio codec not supported") or an Apple TV 4K ("container not supported") produces super pixelated transcode with a lot of banding.

HW acceleration is on, preset is Auto (but "slow" still has an issue), and CRF is 18. 

Chrome:

chrome.thumb.png.659b264065d7245209694d9cb52f5579.png

 

VLC:

vlc.thumb.png.d4d584f83c572a79c0d7758abc3b904a.png

embyserver.txt ffmpeg-transcode-e700d052-af19-4208-8c3e-f0aedca0abf8_1.txt

Happy2Play
Posted

Does this only happen on Interlaced media?

Posted

Another episode says it's not interlaced, and it looks fine in Chrome. The dashboard indicates that it's transcoding, but isn't giving an info icon for the reason. The log filename is "remux" instead of "transcode".

Posted

@karlshea - Thanks for creating a separate issue.

One thing that I can already tell is that your case is totally different from the other one where you had posted before  (https://emby.media/community/index.php?/topic/92331-why-is-my-transcoding-quality-so-bad

  Your Issue Other Issue
Encoder VAAPI HW  libx264 SW
Deinterlacing Yes No
Source vs. output bitrate Roughly Equal Output much lower than source
etc.    

 

 

 

 

 

Back to your issue:

Does your screenshot comparison correspond to the ffmpeg log that you have posted?

For further investigation, could you please install the Diagnostics Plugin?
https://mediabrowser.github.io/Emby.DiagnosticsPlugin/

Thanks

Posted

@softworkz good to know!

Yes, the log and screenshot are both from the first ~10 seconds of the same file.

I've installed the diagnostics plugin.

Posted

When the plugin is installed, there's an additional entry "Codec Parameters":

image.thumb.png.c8654af51ae0fd13c341ef7b049d18e6.png

 

It will look differently in your case but quite similar. What you need is the "H.264 VAAPI Encoder" (similar).

When you click the gear-icon, you'll be able to change a number of settings to adjust the VAAPI hardware encoding quality with which you can play a bit.

Posted

That page is completely blank for me except for the "Codec Parameters" header.

Posted

Ah yea, please go to the "Transcoding" page, choose "Advanced" from the dropdown and save.

Then go back to "Codec Parameters".

Posted

The only hardware encoder that's configurable is "VAAPI 4th Generation Core - H.264 (AVC)". What should I be looking at changing?

Posted
17 hours ago, karlshea said:

The only hardware encoder that's configurable is "VAAPI 4th Generation Core - H.264 (AVC)". What should I be looking at changing?

You can try different different presets.

Posted

What should I be looking at here to fix interlaced videos?

 

image.thumb.png.e5b77ee280ea118c2e2485f67f3d67b9.png

Posted

Sorry, the "Preset" selection is hidden. Don't remember why.

Try different "Compression level" values.

Leave the other two unchanged.

Posted

I tried setting it to "1" and it didn't make a noticeable difference with pixelation during movement.

Posted

Thanks.

Could you please post the ffmpeg log, so we can be sure that the setting has been applied..

Posted

Thanks for the log.

It think I got an idea know about what's probably happening. It seems that the deinterlacing doesn't work correctly and is outputting duplicate frames or even still fields.

Could you please create an EDD file as described here: https://mediabrowser.github.io/Emby.DiagnosticsPlugin/#generating-edd-files

Just run like for 30s, after stopping it takes a while, then you'll see the edd file.

Posted

Thanks. 

The output HLS segments haven't been analyzed.

Die you check "Media Analysis"?

image.png.511d8626a9e35fdd28bf42834bc5f0c0.png

 

Posted

Yes, I did it again just to be sure:

2020-12-17 18:33:00.390 Info EncodingDiagnostics: ProbeHlsOutput complete
2020-12-17 18:33:00.393 Info App: ProcessRun 'StreamTranscode 67663d': Stopping ffmpeg process with q command for /config/transcoding-temp/1AE268_0.ts
2020-12-17 18:33:00.394 Info EncodingDiagnostics: ProcessRun 'EncodingDiagnostics' Execute: /bin/ffprobe -hide_banner -i "/mnt/chef_multimedia/TV/His Dark Materials/Season 2/His Dark Materials - S02E06 - Malice HDTV-1080p Proper.mkv" -show_format -show_streams -show_frames -print_format json  -read_intervals %+#1000 
2020-12-17 18:33:00.437 Info App: AppendExtraLogData - Read graph file: /config/logs/ffmpeg-transcode-67663d9d-c9da-4728-813c-78d619ea2acd_1graph.txt
2020-12-17 18:33:00.460 Info App: AppendExtraLogData - Deserialized GraphData fileStream: {0:n} bytes Graph Count: 2
2020-12-17 18:33:00.460 Info App: AppendExtraLogData - File Deleted
2020-12-17 18:33:00.567 Info App: ProcessRun 'StreamTranscode 67663d' Process exited with code 0
2020-12-17 18:33:00.576 Info SessionManager: Playback stopped reported by app Emby Web 4.5.4.0 playing Malice. Stopped at 44676 ms
2020-12-17 18:33:00.670 Info Server: http/1.1 Response 204 to 192.168.10.50. Time: 307ms. http://citywall.weil-st.net:8096/emby/Sessions/Playing/Stopped?X-Emby-Client=Emby Web&X-Emby-Device-Name=Chrome&X-Emby-Device-Id=TW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTRfNSkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzc0LjAuMzcyOS4xNjkgU2FmYXJpLzUzNy4zNnwxNTU5NTQzNTk0NTQ4&X-Emby-Client-Version=4.5.4.0
2020-12-17 18:33:00.676 Info PlaybackReporting - EventMonitorEntryPoint: _sessionManager_PlaybackStop : Entered
2020-12-17 18:33:00.676 Info PlaybackReporting - EventMonitorEntryPoint: Saving final duration for Item : TW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTRfNSkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzc0LjAuMzcyOS4xNjkgU2FmYXJpLzUzNy4zNnwxNTU5NTQzNTk0NTQ4-378f394f550b4e4398c5af8ff545cb63-22256
2020-12-17 18:33:00.688 Info PlaybackReporting - EventMonitorEntryPoint: Removing Old Key from playback_trackers : TW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTRfNSkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzc0LjAuMzcyOS4xNjkgU2FmYXJpLzUzNy4zNnwxNTU5NTQzNTk0NTQ4-378f394f550b4e4398c5af8ff545cb63-22256
2020-12-17 18:33:02.137 Info EncodingDiagnostics: ProcessRun 'EncodingDiagnostics' Process exited with code 0

 

diag_7144d375edf24ce1986792dbee481f6c.edd

Posted

Hm ok thanks. I'll need to check the server why it's not working anymore.

  • 3 weeks later...
Posted

Update on this:

I was on an older i3-4160, and it wasn't able to transcode h265 in hardware which meant no 4k using that codec that needed transcoding because software transcode couldn't keep up (which to clarify was not the case for this file).

Tonight I upgraded to an i5-10400 and tried the same file and it looked WAY better. I'm not sure if it's the a newer hardware transcode or different kernel drivers in the new 5.x kernel I needed, but it helped significantly.

Do let me know if I can provide any other information that might help!

Posted
On 1/7/2021 at 2:13 AM, karlshea said:

Update on this:

I was on an older i3-4160, and it wasn't able to transcode h265 in hardware which meant no 4k using that codec that needed transcoding because software transcode couldn't keep up (which to clarify was not the case for this file).

Tonight I upgraded to an i5-10400 and tried the same file and it looked WAY better. I'm not sure if it's the a newer hardware transcode or different kernel drivers in the new 5.x kernel I needed, but it helped significantly.

Do let me know if I can provide any other information that might help!

That's interesting. thanks for the feedback.

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...