tdiguy 99 Posted December 15, 2019 Posted December 15, 2019 I finally sat down and came up with a comparison showing conversion file sizes, for hevc 4mbps with hardware acceleration on and with it off. Its really weird that the one with hardware acceleration on is even larger than the original file that is stored as .ts format and the same content with hw acceleration off is significantly smaller than the .ts file. Log files attached. emby-hw-off.txt emby-hwon.txt
PenkethBoy 2068 Posted December 15, 2019 Posted December 15, 2019 with HW On - the bitrate of the ts file is "only" 2.5mbps - so you are increasing the bitrate to 4mpbs - which will increase the file size.... with HW off - the output bitrate is significantly lower than - in the sub 1mbps range - are you sure you set that one to 4mbps? either way the final file size is dependant (mostly) on the output bitrate when using the same input file for comparison - which you can see in your logs Also the encoder via software (cpu) is always smaller than a HW encode although significantly slower
tdiguy 99 Posted December 15, 2019 Author Posted December 15, 2019 (edited) with HW On - the bitrate of the ts file is "only" 2.5mbps - so you are increasing the bitrate to 4mpbs - which will increase the file size.... with HW off - the output bitrate is significantly lower than - in the sub 1mbps range - are you sure you set that one to 4mbps? either way the final file size is dependant (mostly) on the output bitrate when using the same input file for comparison - which you can see in your logs Also the encoder via software (cpu) is always smaller than a HW encode although significantly slower The only setting difference between the 2 files is turning hardware acceleration on or off. There isnt a option to have the bitrate lower than 1.5 in emby. Is it normally expected that the difference in file sizes would be so noticeable between using hardware acceleration or software? I will run another round and keep the setting on keep original for bitrate to see how that lands. Edited December 15, 2019 by tdiguy
PenkethBoy 2068 Posted December 15, 2019 Posted December 15, 2019 the 2.5mbps is the bitrate of the TS file you recorded - i.e the source bitrate - nothing to do with Emby other than its getting it as the starting point Maybe Emby using software encoding is not honoring the final output you are setting at 4mbps for the cpu - and thats why its below 1mbps in the converted file
tdiguy 99 Posted December 15, 2019 Author Posted December 15, 2019 Here is a comparison with the bitrate left at original and turning hardware acceleration on and off. emby-HWOFF.txt emby-hwon.txt
tdiguy 99 Posted December 15, 2019 Author Posted December 15, 2019 Looks like leaving the setting for keep original is the trick for this. With hardware acceleration on and bitrate at original it is a significantly smaller file. Previous comparison is still very odd to me on how that worked out.
Happy2Play 9780 Posted December 15, 2019 Posted December 15, 2019 (edited) But you can not compare HWOFF conversion to h264 and HWON conversion to h265. HWON 12:22:07.316 Stream mapping:12:22:07.316 Stream #0:0 (mpeg2video) -> deinterlace_vaapi (graph 0)12:22:07.316 deinterlace_vaapi (graph 0) -> Stream #0:0 (hevc_vaapi)12:22:07.316 Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))12:22:07.316 Stream #0:2 -> #0:2 (ac3 (native) -> aac (native)) HWOFF 12:31:58.697 Stream mapping:12:31:58.697 Stream #0:0 (mpeg2video) -> yadif (graph 0)12:31:58.697 yadif (graph 0) -> Stream #0:0 (libx264)12:31:58.697 Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))12:31:58.697 Stream #0:2 -> #0:2 (ac3 (native) -> aac (native)) from logs in post 5. Edited December 15, 2019 by Happy2Play
Happy2Play 9780 Posted December 15, 2019 Posted December 15, 2019 Logs from post 1 ON looks like it achieved 4mb bitrate 10:55:55.722 10:55:55.728 frame= 6784 fps= 30 q=-0.0 Lsize= 110869kB time=00:03:46.29 bitrate=4013.6kbits/s dup=175 drop=0 throttle=off speed= 1x 10:55:55.728 video:94645kB audio:15942kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.255392% OFF looks like software only achieved 734kb bitrate 11:07:01.765 11:07:01.769 frame= 6784 fps= 30 q=-0.0 Lsize= 20295kB time=00:03:46.25 bitrate= 734.8kbits/s dup=174 drop=0 throttle=off speed=0.995x 11:07:01.769 video:4047kB audio:15942kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 1.529747%
tdiguy 99 Posted December 15, 2019 Author Posted December 15, 2019 (edited) But you can not compare HWOFF conversion to h264 and HWON conversion to h265. HWON 12:22:07.316 Stream mapping: 12:22:07.316 Stream #0:0 (mpeg2video) -> deinterlace_vaapi (graph 0) 12:22:07.316 deinterlace_vaapi (graph 0) -> Stream #0:0 (hevc_vaapi) 12:22:07.316 Stream #0:1 -> #0:1 (ac3 (native) -> aac (native)) 12:22:07.316 Stream #0:2 -> #0:2 (ac3 (native) -> aac (native)) HWOFF 12:31:58.697 Stream mapping: 12:31:58.697 Stream #0:0 (mpeg2video) -> yadif (graph 0) 12:31:58.697 yadif (graph 0) -> Stream #0:0 (libx264) 12:31:58.697 Stream #0:1 -> #0:1 (ac3 (native) -> aac (native)) 12:31:58.697 Stream #0:2 -> #0:2 (ac3 (native) -> aac (native)) from logs in post 5. Odd, they should both be hevc that was the setting used anyway. Looking at the log i wonder if i did screw that up though. Either way leaving bitrate at original seems like it resolved what i thought was an issue, who knew broadcast tv was such low bitrate. Edited December 15, 2019 by tdiguy
tdiguy 99 Posted December 15, 2019 Author Posted December 15, 2019 Thank you guys for the input on this. I am starting to convert everything over to hevc and using hardware acceleration takes a huge load off my limited cpu.
Guest asrequested Posted December 15, 2019 Posted December 15, 2019 I very much doubt that HEVC encoding is going to be possible with the CPU on a lot of systems. And probably isn't being allowed in the emby server.
Luke 42077 Posted December 15, 2019 Posted December 15, 2019 Logs from post 1 ON looks like it achieved 4mb bitrate 10:55:55.722 10:55:55.728 frame= 6784 fps= 30 q=-0.0 Lsize= 110869kB time=00:03:46.29 bitrate=4013.6kbits/s dup=175 drop=0 throttle=off speed= 1x 10:55:55.728 video:94645kB audio:15942kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.255392% OFF looks like software only achieved 734kb bitrate 11:07:01.765 11:07:01.769 frame= 6784 fps= 30 q=-0.0 Lsize= 20295kB time=00:03:46.25 bitrate= 734.8kbits/s dup=174 drop=0 throttle=off speed=0.995x 11:07:01.769 video:4047kB audio:15942kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 1.529747% With hwa ON, the hwa encoder is doing a better job of staying close to the max requested quality. The software encoder at times will drop to lower bitrates. This is the reason for the difference.
tdiguy 99 Posted December 15, 2019 Author Posted December 15, 2019 I very much doubt that HEVC encoding is going to be possible with the CPU on a lot of systems. And probably isn't being allowed in the emby server. Not for nothing but: https://www.newegg.com/asrock-j3455b-itx-mini-itx/p/N82E16813157727?Item=N82E16813157727 My 70$ cpu / mobo combo supports hardware hevc which i bought in 2017 and my mi box 3 devices ( not the newer s version ) also support hevc hardware acceleration. Only device i have that does not support hardware hevc is my rpi3, that device stopped at h264. I would bet that even though hevc is only now starting to get popular that it is likely supported in a lot of devices.
Guest asrequested Posted December 15, 2019 Posted December 15, 2019 You missed my point. It converted using software not hardware, and HEVC is implemented for that. There are no settings for hardware encoding, yet. https://emby.media/community/index.php?/topic/78984-hardware-encode-not-working/?p=803823
tdiguy 99 Posted December 15, 2019 Author Posted December 15, 2019 (edited) You missed my point. It converted using software not hardware, and HEVC is implemented for that. There are no settings for hardware encoding, yet. https://emby.media/community/index.php?/topic/78984-hardware-encode-not-working/?p=803823 I see, interesting. The cpu on my emby server is sitting at a leisurely 30% right now converting my all my libraries over to hevc with conversions set at full speed. Makes me think the gpu must be doing a vast majority of the work. Reading the other thread i am not sure if that issue was just with docker or not. A little snip from the current conversion: Emby Server version: 4.3.0.30 {"Protocol":"File","Id":"573652f9b2b07b8a8102afc3444e7210","Path":"/media/emby/Recordings/TV/Truth Behind the Moon Landing/Season 1/Truth Behind the Moon Landing S01E06 The Hollywood Conspiracy.mp4","Type":"Default","Container":"mp4","Size":724748298,"Name":"Truth Behind the Moon Landing S01E06 The Hollywood Conspiracy","IsRemote":false,"RunTimeTicks":38362500000,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":false,"MediaStreams":[{"Codec":"h264","CodecTag":"avc1","Language":"und","TimeBase":"1/60000","CodecTimeBase":"1001/120000","VideoRange":"SDR","DisplayTitle":"480p H264","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"BitRate":1115175,"BitDepth":8,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":404,"Width":720,"AverageFrameRate":59.94006,"RealFrameRate":59.94006,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuv420p","Level":41,"IsAnamorphic":false},{"Codec":"aac","CodecTag":"mp4a","Language":"eng","TimeBase":"1/48000","CodecTimeBase":"1/48000","DisplayTitle":"English AAC 5.1 (Default)","DisplayLanguage":"English","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":384644,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Profile":"LC","Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","Level":0}],"Formats":[],"Bitrate":1511368,"RequiredHttpHeaders":{},"ReadAtNativeFramerate":false} Affected codecs: >>>>>> VAAPI Intel Corporation Device 23173 - H.264 (AVC) Adapter #0: 'Intel Corporation Device 23173' Id:23173 (Driver: Intel i965 driver for Intel® Broxton - 2.3.0, Vendor: Intel Corporation) Frame Sizes: max 4096x4096 Color Formats: NV12 Profiles: Constrained Baseline Profile (Level 6), Main Profile (Level 6), High Profile (Level 6) >>>>>> VAAPI Intel Corporation Device 23173 - H.265 (HEVC) Adapter #0: 'Intel Corporation Device 23173' Id:23173 (Driver: Intel i965 driver for Intel® Broxton - 2.3.0, Vendor: Intel Corporation) Frame Sizes: 32x32...4096x4096 Color Formats: NV12, P010 Profiles: Main Profile (Level 6 (Main)) >>>>>> FindVideoDecoder - MediaType: h264, Mode: Automatic Info FindVideoDecoder - Checking: 'VAAPI Intel Corporation Device 23173 - H.264 (AVC)' (Priority: 60) Info FindVideoDecoder - Check successful - selecting 'VAAPI Intel Corporation Device 23173 - H.264 (AVC)' >>>>>> FindVideoEncoder - Media: hevc, UseHardwareCodecs: True, Mode: Automatic Info FindVideoEncoder - Checking: 'VAAPI Intel Corporation Device 23173 - H.265 (HEVC)' (Priority: 60) Info Encoder supports input stream Info FindVideoEncoder - Check successful - selecting 'VAAPI Intel Corporation Device 23173 - H.265 (HEVC)' /opt/emby-server/bin/ffmpeg -loglevel +timing -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -f mp4 -i file:"/media/emby/Recordings/TV/Truth Behind the Moon Landing/Season 1/Truth Behind the Moon Landing S01E06 The Hollywood Conspiracy.mp4" -map 0:0 -map 0:1 -sn -c:v:0 hevc_vaapi -force_key_frames "expr:gte(t,n_forced*5)" -b:v:0 2787938 -maxrate 2787938 -bufsize 5575876 -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 copy -metadata:s:a:0 language=eng -disposition:a:0 default -y "/media/emby/transcoding/52/23053/6bc8fc80-e46f-4ea2-8237-df20e09aabf6.mp4" 15:52:31.176 ffmpeg version 4.3.0-emby_2019_11_09 Copyright © 2000-2019 the FFmpeg developers and softworkz for Emby LLC 15:52:31.176 built with gcc 8.3.0 (crosstool-NG 1.24.0) 15:52:31.176 Execution Date: 2019-12-15 15:52:31 15:52:31.353 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:/media/emby/Recordings/TV/Truth Behind the Moon Landing/Season 1/Truth Behind the Moon Landing S01E06 The Hollywood Conspiracy.mp4': 15:52:31.353 Metadata: 15:52:31.353 major_brand : isom 15:52:31.353 minor_version : 512 15:52:31.353 compatible_brands: isomiso2avc1mp41 15:52:31.353 encoder : Lavf58.12.100 15:52:31.353 Duration: 01:03:56.25, start: 0.000000, bitrate: 1511 kb/s 15:52:31.353 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x404 [sAR 404:405 DAR 16:9], 1115 kb/s, Level 41, 59.94 fps, 59.94 tbr, 60k tbn, 119.88 tbc (default) 15:52:31.353 Metadata: 15:52:31.353 handler_name : VideoHandler 15:52:31.353 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default) 15:52:31.353 Metadata: 15:52:31.353 handler_name : SoundHandler 15:52:31.364 Stream mapping: 15:52:31.365 Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_vaapi)) 15:52:31.365 Stream #0:1 -> #0:1 (copy) 15:52:31.365 Press [q] to stop, [?] for help 15:52:31.388 Output #0, mp4, to '/media/emby/transcoding/52/23053/6bc8fc80-e46f-4ea2-8237-df20e09aabf6.mp4': 15:52:31.389 Metadata: 15:52:31.389 encoder : Lavf58.31.104 15:52:31.389 Stream #0:0: Video: hevc (hevc_vaapi) (Main) (hev1 / 0x31766568), vaapi_vld, 720x404 [sAR 404:405 DAR 16:9], q=-1--1, 2787 kb/s, 59.94 fps, 60k tbn, 59.94 tbc (default) 15:52:31.389 Metadata: 15:52:31.389 encoder : Lavc58.56.101 hevc_vaapi 15:52:31.389 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default) 15:52:31.883 frame= 76 fps=0.0 q=-0.0 size= 256kB time=00:00:01.32 bitrate=1585.8kbits/s throttle=off speed=2.55x 15:52:32.393 frame= 158 fps=154 q=-0.0 size= 768kB time=00:00:02.66 bitrate=2359.4kbits/s throttle=off speed=2.59x 15:52:32.914 frame= 229 fps=148 q=-0.0 size= 1280kB time=00:00:03.88 bitrate=2700.7kbits/s throttle=off speed=2.51x 15:52:33.415 frame= 296 fps=144 q=-0.0 size= 1792kB time=00:00:04.97 bitrate=2953.4kbits/s throttle=off speed=2.42x 15:52:33.931 frame= 365 fps=142 q=-0.0 size= 2048kB time=00:00:06.12 bitrate=2740.2kbits/s throttle=off speed=2.39x 15:52:34.439 frame= 433 fps=141 q=-0.0 size= 2560kB time=00:00:07.27 bitrate=2882.9kbits/s throttle=off speed=2.37x 15:52:34.943 frame= 502 fps=140 q=-0.0 size= 3072kB time=00:00:08.42 bitrate=2986.5kbits/s throttle=off speed=2.36x 15:52:35.449 frame= 574 fps=141 q=-0.0 size= 3328kB time=00:00:09.64 bitrate=2827.4kbits/s throttle=off speed=2.36x 15:52:35.956 frame= 644 fps=140 q=-0.0 size= 3840kB time=00:00:10.77 bitrate=2920.0kbits/s throttle=off speed=2.35x 15:52:36.470 frame= 715 fps=140 q=-0.0 size= 4352kB time=00:00:11.98 bitrate=2973.6kbits/s throttle=off speed=2.35x 15:52:36.989 frame= 787 fps=140 q=-0.0 size= 4864kB time=00:00:13.18 bitrate=3022.3kbits/s throttle=off speed=2.34x 15:52:37.492 frame= 860 fps=140 q=-0.0 size= 5376kB time=00:00:14.37 bitrate=3062.9kbits/s throttle=off speed=2.35x 15:52:37.997 frame= 922 fps=139 q=-0.0 size= 5632kB time=00:00:15.44 bitrate=2987.2kbits/s throttle=off speed=2.33x Edited December 15, 2019 by tdiguy
Jdiesel 1431 Posted December 15, 2019 Posted December 15, 2019 I would hold off on converting your entire library until there is a bit more control over the final quality. https://emby.media/community/index.php?/topic/78984-hardware-encode-not-working/?p=803450
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