veehexx1 12 Posted March 5, 2021 Share Posted March 5, 2021 server: Linux with docker container 4.5.4.0 using AMD athlon 3000g APU (Vega3) HW transcoding, with TVHeadend via native emby m3u. clients: Shield pro 2019 & Windows Emby theatre my test Source file is recorded livetv content at 720x576, from DVB-S2 in the UK This appears to be a problem with any content that is in SD format and gets transcoded. With the source content in SD format and transcoding is used then the client will play back in a 4:3 ratio (480p) and very obvious compression artifacts. there's almost a watermark type effect vertically down the entire left side of the picture area that does not appear in the direct play source. direct play does not exhibit either of these issues, and nore does transcoded HD content (720, 1080 or 4k). This is a bit of a problem as my main TV uses the shield which appears to transcode much more content than my Windows Theater client does and not all freesat UK channels are in HD still. is there anything i can do to improve this behavior? Link to comment Share on other sites More sharing options...
pwhodges 1543 Posted March 5, 2021 Share Posted March 5, 2021 (edited) Have you done anything to the recorded file? What tuner is your stream coming from? I just played back a 720x576 stream (channel 3, ITV, as it happens) in the TS container that Emby saved it in from my HDHomeRun tuner - with transcoding - and it played back correctly. Mine's DVB-T, though, from Freeview. Paul Edited March 5, 2021 by pwhodges Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 5, 2021 Author Share Posted March 5, 2021 tuner is TBS6981. i just picked a random channel; 4seven for my test file. I've been a mythtv user for years without issue, and migrated to emby last weekend so there could be something i've mis-configured or overlooked or something... just tried itv (non-HD) to match your test - same issue. direct play ok, transcoding put it into a forced 4:3. it even looks squashed horizontally. sounds like theres something in the transcoding side with my setup. when all transcoding jobs are compelted i'll try software transcoding to see if that makes a difference... Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 5, 2021 Author Share Posted March 5, 2021 hardware transcoding issue, specifically with h264 (avc). Disabling hw h264 encoding in advanced options makes it scale properly. is there anything i can do to fix that (eg, something at driver level), or is it firmly within hardware and ultimately a dedicated GPU is the only option? if driver setting; bear in mind i'm linux, container and also headless server so cmdline only methods! i am using the latest 20.45 amd drivers rather than kernel. Link to comment Share on other sites More sharing options...
Luke 37336 Posted March 6, 2021 Share Posted March 6, 2021 Hi there, can you please attach an ffmpeg log example? Thanks. Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 6, 2021 Author Share Posted March 6, 2021 (edited) Hi @Luke, I've got 2 sets of info for you. logs for HW encoder enabled (specifically 'VAAPI Device 4098:5592 - H.264 (AVC)' ticked) which has the 4:3 issue, and SW encoder (h.264 AVC unticked) which scales fine. screenshots also taken of direct play from recorded LiveTV, and two for what it looks like with each encoder type. direct play: SW transcode: HW transcode: HW ffmpeg-transcode-6e0d47f1-6282-4136-b3e9-148f1cfd42af_1.txt SW ffmpeg-transcode-163f3ab2-4a63-4f01-b826-ba22e143a927_1.txt Edited March 6, 2021 by veehexx1 Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 10, 2021 Author Share Posted March 10, 2021 any thoughts to what could be the issue? i'm assuming its a software issue but i guess theres not much i can do but wait for the devs to fix... or is it something else like a hardware/driver issue i need to look at more? Link to comment Share on other sites More sharing options...
Carlo 4332 Posted March 12, 2021 Share Posted March 12, 2021 You get the same thing in Theater and Android ATV? What about in a web browser? Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 12, 2021 Author Share Posted March 12, 2021 windows theater: yes; thats where the screenshots were taken from. same experience on android (sheild pro 2019), LG SmartTV (device i originally found the issue on) and browser (win10 firefox) with hw transcoded SD content (as per screenshots). Definately related to the h264 hw encoder on server side. I'm torn on where i think the issue is. based off no one else experiencing this issue (either "me too", or in my searches for similar problems), it seems specific to my setup rather than Emby. But then if it was hardware/driver then i'd expect to see the problem across any h264 encoding like 4k, 1080 or 720p. I've also found very little info online about the Athlon 3000G cpu w/vega3 iGPU as majority seem to be using dGPU's. I am open to buying a dGPU if thats what it needs (likely end up going ebay for nv quadro as single slot is hugely preferable), but i'm looking for something more conclusive than my hunches and guesses on this... Link to comment Share on other sites More sharing options...
Carlo 4332 Posted March 12, 2021 Share Posted March 12, 2021 When I look at the ffmpeg transcode log I do some errors/warnings such as: 18:53:00.563 [mpeg2video @ 0x25491c0] Invalid frame dimensions 0x0. 18:53:00.654 [h264_vaapi @ 0x25723c0] Driver does not support some wanted packed headers (wanted 0xd, found 0). 18:53:00.654 [h264_vaapi @ 0x25723c0] Driver does not support packed sequence headers, but a global header is requested. 18:53:00.654 [h264_vaapi @ 0x25723c0] No global header will be written: this may result in a stream which is not usable for some purposes (e.g. not muxable to some containers). Out of curiosity has you tried to remux the source file and then trying the new file? Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 12, 2021 Author Share Posted March 12, 2021 same issue (assuming i've remuxed correctly). i'm not familiar at all with the correct process but i ran the orginal .ts file through VLC media > convert option. then used the 'Video - h264+mp3 (mp4)' profile. that output mp4 was copied into emby library. HW encode scales to 4:3, SW encode keeps original apsect ratio. Link to comment Share on other sites More sharing options...
Carlo 4332 Posted March 12, 2021 Share Posted March 12, 2021 Would you be able to upload this file somewhere so we can take a look at it and use it to test? If you know how to use ffmpeg I could give you a command line to cut the first 5 minutes which would be good enough for testing. Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 12, 2021 Author Share Posted March 12, 2021 (edited) just uploading the original file now; around 250mb. ffmpeg; sure, while i'm not that familiar with ffmpeg itself, cmdline is fine.. upload completed; https://docs.zoho.com/file/jhtjxd11613bc2ffc4acfb92446d4e5d966de Edited March 12, 2021 by veehexx1 add example file link Link to comment Share on other sites More sharing options...
Carlo 4332 Posted March 12, 2021 Share Posted March 12, 2021 Downloading it now. ffmpeg -i input.mkv -c copy -t 300 output.mkv It can be as simple as that. 300 is seconds in this case so 5 minutes. Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 12, 2021 Author Share Posted March 12, 2021 (edited) tried it with ffmpeg on the emby host (nb: emby is in a docker container on this host), and tested the output.mkv file; same issue with HW encoding rescaling to 4:3. direct play/sw encode at the correct 16:9. Edited March 12, 2021 by veehexx1 Link to comment Share on other sites More sharing options...
Carlo 4332 Posted March 13, 2021 Share Posted March 13, 2021 @ebr I've been trying to force a transcode of this file but can't do it. It shows as 3.35 Mbps when direct playing but even setting shield to 1Mbps it's still direct playing. It direct plays correctly. Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 13, 2021 Author Share Posted March 13, 2021 (edited) @cayars- you tagged/responded to the correct person? Direct play works fine for me too. if i choose, say, 2mbit it will transcode. something sounds off... Edited March 13, 2021 by veehexx1 Link to comment Share on other sites More sharing options...
Carlo 4332 Posted March 13, 2021 Share Posted March 13, 2021 Yea I tagged the dev. I'm trying to reproduce your issue but it plays back correctly for me. Tested on a couple of clients but couldn't get the shield to transcode code it. I'm using an nvidia 1065 so this MAY seem to indicate the issue only happens in VAAPI or similar which I don't have and can't test. Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 13, 2021 Author Share Posted March 13, 2021 (edited) ah, didnt realise ebr was a dev.. probably not useful but this is the output from Dashboard with HW encode enabled and the 4:3 issue; Theater set to 'auto' Quality - correct 16:9: Theater set to '480p - 2mbps', and exhibits the 4:3 issue. Transcode reason states bitrate exceeded. annoyingly all my other hardware is either WAAY to old (nv 210), no iGPU, or probably not worth experimenting with as it so wildly different from original issue? my laptop is linux with i5-5200u with intel gfx (5th gen doesn't do encoding, 6th gen does afaik). gaming pc is windows i5-8600k & nv3090 so would likely show same results as you; nvenc works fine. Edited March 13, 2021 by veehexx1 Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 13, 2021 Author Share Posted March 13, 2021 (edited) span up a new emby server on gamingpc (windows10, i5-8600, nv3090), applied premier key to enable transcoding, copy source example file to it, and retest with hw encoding; problem is not present using nvenc. also tested with the i5-8600k quicksync dx11 encoding (nvenc on decode side) and that too works as expected. Neither of these HW encode tests show the vertical 'highlighted' line as you can see on the left side of the SW & HW transcode screenshots in my original post. so... unless i've overlooked something, that confirms the issue is server side and either linux or VAAPI. Edit: turns out i5-5200u does h264 encoding, just not h265 (that is 6th gen>). Fedora with official rpm & HW transcodes fine. this is pointing to either AMD or container specific issue. guess theres no point trying to get my fedora server working anymore as AMD dont officially support it with their drivers (even though kernel comes with amdgpu modules). time to try my server with a ext usb drive and a properly support distro like ubuntu and retest... Edited March 13, 2021 by veehexx1 1 Link to comment Share on other sites More sharing options...
Carlo 4332 Posted March 13, 2021 Share Posted March 13, 2021 Great info. Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 13, 2021 Author Share Posted March 13, 2021 (edited) same issue with fresh install. ubuntu server 20.20 (non-LTS), amdgpu 20.45 (edit: same with 20.20 driver too), emby server 4.5.4.0, and same issue with HW encoding; 4:3 aspect ratio with the left vertical line. I dont think theres anything more i can do now - i assume you guys have amd vaapi hardware to dev with to confirm if it's an emby issue? Otherwise it looks specific to my hardware/driver bug. i am swaying towards my hardware as if emby/drivers i'd of thought others would be reporting similar issues. Edited March 13, 2021 by veehexx1 Link to comment Share on other sites More sharing options...
Carlo 4332 Posted March 13, 2021 Share Posted March 13, 2021 @softworkz Can you take a look at this please. Link to comment Share on other sites More sharing options...
softworkz 3353 Posted March 13, 2021 Share Posted March 13, 2021 2 hours ago, cayars said: @softworkz Can you take a look at this please. @veehexx1 - The bottom of your log files is missing (the section starting with ======= ExtraData) Link to comment Share on other sites More sharing options...
veehexx1 12 Posted March 13, 2021 Author Share Posted March 13, 2021 that wasn't intentional although logs were grabbed with the transcode in progress. sounds like i should've stopped it before grabbing log files. i'll reproduce from the same example file in a few hours and ensure the new logs contain the ExtraData section. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now