Discussion Best setup to convert movies

denzel

Blitz 2nd Class
Original poster
Donor
41
5
Hello,

my movies, series, etc. and they are in different formats, that are not ideal for plex. I was wondering what would be the best setup to convert the movies?
I tried to use the conversion within Plex, but for nearly 30% of the files there is an error that the "conversion is not possible" without further details.

In the forum and wiki I found some information about MP4 Automator (that I didn't find in Plexguide), about mp4 docker scripts for sonarr/radarr, ffmpeg, the sickbeard converter and Plex Optimize. I have no idea what to try or where to start.

So I have 2 questions:
1. How are you guys doing it?
2. Once in a while I download a movie and want to see immediately. A conversion after downloading would delay the time until I can see it. Is there a setup that the existing movies are converted (if necessary) in the background or when the system doesn't use much capacity and replaces the downloaded movie when it is not in use?

Thank you and best regards
 

timetrex

Blitz Sergeant
Staff
105
19
My Movie collection is only for me, so I dont worry about conversion. I just ensure that I have a device that is capable of playing all formats with no issues like the Nivida Shield My house is a transcode free zone..
 

dinklegeta

Blitz 1st Class
74
24
Honestly the best thing is to just get a device and setup that always direct plays the media. Converting my 55+TB library would be a pain in the rear and the quality loss would make me think why I did not just download a version that is more compatible in the first place.

The Shield TV is the best, the new firestick 4K is great cheaper option. Other devices like the Apple TV will probably need third party apps like Infuse or MrMC for newer higher quality media.
 

clinch123

The Newb
69
33
1. There are two ways that you can do this. I utilize both depending on the circumstances. First is too use the MP4 Converter that comes with Sonarr and Radarr setups. Believe it's option 2 not one. There's a wiki page on it. I also use Don Melton's Transcoding script for files you already downloaded. (Link Below) this will require some scripting on your end if you want any sort of automation. A third option would be to use Handbrake Handbrake-CLI directly.

https://github.com/donmelton/video_transcoding

2. If you are transcoding or converting you will need to wait a little. Shouldn't take too long though. Mine ar e usually down in 10-15 minutes for longer movies.
 
  • Like
Reactions: denzel

denzel

Blitz 2nd Class
Original poster
Donor
41
5
1. There are two ways that you can do this. I utilize both depending on the circumstances. First is too use the MP4 Converter that comes with Sonarr and Radarr setups. Believe it's option 2 not one. There's a wiki page on it. I also use Don Melton's Transcoding script for files you already downloaded. (Link Below) this will require some scripting on your end if you want any sort of automation. A third option would be to use Handbrake Handbrake-CLI directly.

https://github.com/donmelton/video_transcoding

2. If you are transcoding or converting you will need to wait a little. Shouldn't take too long though. Mine ar e usually down in 10-15 minutes for longer movies.
This option I like a lot, thank you for sharing!

What command with what parameter did you have good results with Don Melton's Transcoding script?
Is transcode-video --mp4 "/path/to/Movie.mkv" already enought?

Did you try the --quick parameter?
Do I have to add --add-audio all to have the movie in different languages?
 

clinch123

The Newb
69
33
I did use the --quick tag. I didn't see a perceptible loss in quality and it transcoded about 10-15% quick. Since I was transcoding my whole library of 70tb that was a lot of time saved. As far as the audio. I did not use the tag. I haven't come across any issues (there may be but I haven't found them)

The rest of your command is what I used. I'll post my full script when I get home. Not much but just to give an idea
 
  • Like
Reactions: denzel

SirTranceALoT

Blitz Legioner
Staff
288
122
I actually encode all my movies for plex myself. Make em stream ready. For the container I use mp4. Video is H.264 encoded with x264 tmod. I spent about 5 years perfecting the settings for that. Audio is AAC since it can handle 7.1 audio and encoded with LC profile and coreaudio with QAAC, it comes close to DTS qualitywise (audiofanatics actually mesured this). Now immediate conversion as you would want it, isn't possible, unles you don't care about quality. Then again, you can just let plex transcode them. As for TV shows, I usually take the AMZN web-dl's. They're perfectly streamable. In short, it depends on what you're looking for. If you want to watch something quick, try and find a web-dl of the movie you want to watch and then replace it afterwords with a good copy if you wish to archive it. That is going to work a whole lot faster then transcoding. Also, as mentioned, make sure you have a device that is at least direct stream ready. I don't use direct play since my video and audiostreams are compliant with almost every device. Xbox one for example struggles with the containers so I have direct play disabled to fix buffer issues. And a container remux is less demanding then a complete transcode.
 
  • Like
Reactions: denzel

denzel

Blitz 2nd Class
Original poster
Donor
41
5
Sounds like you tried a lot with the settings until you got a good result, my full respect!

immediate conversion as you would want it, isn't possible
You got me wrong, I don't want immediate conversion. I would also like to convert it myself.

I spent about 5 years perfecting the settings for that
Would you like to share what program you use for the encoding? And as a newbie on that field maybe you could tell a little more about the perfect settings to make them stream ready?

One more question, as it needs a lot of capacity, did you rent some kind of server for the encoding?
 

SirTranceALoT

Blitz Legioner
Staff
288
122
Sounds like you tried a lot with the settings until you got a good result, my full respect!
Encoding and video processing has always been a passion How could I get the best possible result and quality at the lowest filesize. That was the main intention that drove it. I actually started with this during the DivX and XViD DVD rips. Man that seems like ages ago now. Why I also got into this is to start an encoding company but never gotten around to that.


You got me wrong, I don't want immediate conversion. I would also like to convert it myself.
OH ok sorry bout that. I must've misread it.


Would you like to share what program you use for the encoding? And as a newbie on that field maybe you could tell a little more about the perfect settings to make them stream ready?
As a gui to encode it all, I'm using megui but the process is done trough various different tools. There's eac3to to extract the streams, x264 tmod for encoding, QAAC for audio encoding and mp4box to mux it into mp4. Megui just combines them. You also need avisynth and ffdshow to render the video. AVIsynth is used as frameserver to pipe it trough x264, do the cropping of the video and such. What settings to use is not easilly explained. A few core ones:
Keep the maxbitrate as low as possible to prevent huge peaks in bitrate. 25000 is what I have set it to.
What defines the quality of a videoframe in x264 is the quantizer. I know a lot of those elite groups know only one route and that is bitrate. Don't fall for that. It's their way of not having to admit that they've been encoding the same way for 15 years and still have not clue of what they're doing. I encoding my streams with CQ mode, not a given bitrate. What it does is it encodes every frame towards a given quality factor. What happens with a given bitrate is that certain frames might need more then that bitrate and others way less so that there's some sort of overkill. Encoding using a quality factor gives every frame the bitrate it needs to guarentee a certain quality.
There are 3 types of frames. I P and B. I frames are uncompressed frames and are used as ref frames. P frames are more compressed frames and use another P or I frame as reference. They store the differense between 2 key frames. B frames are the most compressed and shitty looking ones. What most elite encoders do is pump their encode full of B-frames because it would be more compressed. This is very illogic since they have to toss in a lot of bitrate to compensate for the loss of qualiy. I only use 3 B-frames. You see, th ebitrate an I and P frame needs to look good is way less that the one a B-frame needs. Another bad setting those elite encoders use is IP-ratio and PB-ratio. I mentioned the quality factor right? Well these settings determine how much the quality can fluctuate between thos I P and B frames. Those elite encoders use settings that let the quantizer fluctuate a lot. So compared to the I and P frames, those B-frames look horrible, combining the fact that they use a lot of them,.... well you get my drift. So they compensate trough bitrate wich spikes in those I and P frames. I keep my IP and PB ratio settins tight and low. As a result I have equal quantizer or almos equal over all my frames so all of them have nearly the same quality.

There's a lot more to it but then I'd have to write a book. At the end of it, I get away with 1/4 of the original bluray bitrate. Sometimes less so most of those encodes are between 5.5-8 mbps


One more question, as it needs a lot of capacity, did you rent some kind of server for the encoding?
Yes. I do this on a dedicated server. I use an i7 4770 or i7 3770 for encoding. With my current settings, I encode at roughly 6-8 fps. It depends on the complexit yof the source video. An avarage encode takes about 6 hours to finish. I run these encoding machines virtually with QEMU+KVM. I have two servers: one as a seedbox where I run my encoding machine on and the other one is a plexguide dump that also runs an encoding machine. if I really put my mind to it, I spit out 4 encodes a day or 1 season in 3 days.
 
Last edited:

SirTranceALoT

Blitz Legioner
Staff
288
122
I did some screenshits of the test encode for Venom.





The left one is the bluray, right one is the stream to be used for plex. For those that are interested, this is the x264 output log for the test encode

Code:
[Information] [12/12/2018 8:39:56] Standard error stream
-[Information] [12/12/2018 8:40:07] raw [info]: 1920x800p 1:1 @ 24000/1001 fps (cfr)
-[Information] [12/12/2018 8:40:07] raw [info]: color matrix: bt709
-[Information] [12/12/2018 8:40:07] x264 [info]: using SAR=1/1
-[Information] [12/12/2018 8:40:07] x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
-[Information] [12/12/2018 8:40:07] x264 [info]: profile High, level 4.1
-[Information] [12/12/2018 8:40:07] x264 [info]: cabac=1 ref=5 deblock=1:-3:-3 analyse=0x3:0x113 me=umh subme=9 psy=1 fade_compensate=0.00 psy_rd=1.00:0.00 mixed_ref=1 me_range=48 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=6,10 fast_pskip=0 chroma_qp_offset=-3 threads=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=0 interlaced=0 bluray_compat=0 constrained_intra=0 fgo=0 bframes=2 b_pyramid=0 b_adapt=2 b_bias=0 direct=1 weightb=0 open_gop=0 weightp=2 keyint=46 keyint_min=23 scenecut=99 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=0 crf=20.5000 qcomp=0.60 qpmin=0:0:0 qpmax=50:50:50 qpstep=2 vbv_maxrate=20000 vbv_bufsize=25000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.10 pb_ratio=1.10 aq=3:0.60 aq-sensitivity=10.00 aq-factor=1.00:1.00:1.00 aq2=0 aq3=0
-[Information] [12/12/2018 8:40:07] x264 [info]: started at Wed Dec 12 08:40:05 2018
-[Information] [12/12/2018 8:47:44] x264 [info]: frame I:131   Avg QP:19.02  size:100964
-[Information] [12/12/2018 8:47:44] x264 [info]: frame P:1468  Avg QP:19.34  size: 45388
-[Information] [12/12/2018 8:47:44] x264 [info]: frame B:1641  Avg QP:20.88  size: 19160
-[Information] [12/12/2018 8:47:44] x264 [info]: consecutive B-frames: 11.5% 49.9% 38.5%
-[Information] [12/12/2018 8:47:44] x264 [info]: mb I  I16..4: 17.9% 67.7% 14.4%
-[Information] [12/12/2018 8:47:44] x264 [info]: mb P  I16..4:  4.0% 10.5%  1.3%  P16..4: 44.2% 16.9% 11.7%  0.0%  0.0%    skip:11.4%
-[Information] [12/12/2018 8:47:44] x264 [info]: mb B  I16..4:  0.2%  0.9%  0.2%  B16..8: 42.7%  7.1%  1.7%  direct: 6.4%  skip:40.8%  L0:38.3% L1:53.4% BI: 8.3%
-[Information] [12/12/2018 8:47:44] x264 [info]: 8x8 transform intra:66.9% inter:63.1%
-[Information] [12/12/2018 8:47:44] x264 [info]: coded y,uvDC,uvAC intra: 69.3% 75.0% 54.8% inter: 27.6% 37.7% 16.9%
-[Information] [12/12/2018 8:47:44] x264 [info]: i16 v,h,dc,p: 29% 20% 10% 41%
-[Information] [12/12/2018 8:47:44] x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13%  8%  7% 10% 14% 13% 13% 11% 12%
-[Information] [12/12/2018 8:47:44] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 10%  6% 11% 14% 12% 13%  9% 12%
-[Information] [12/12/2018 8:47:44] x264 [info]: i8c dc,h,v,p: 39% 25% 20% 16%
-[Information] [12/12/2018 8:47:44] x264 [info]: Weighted P-Frames: Y:3.0% UV:1.9%
-[Information] [12/12/2018 8:47:44] x264 [info]: ref P L0: 66.9%  9.9% 12.8%  4.9%  3.3%  2.0%  0.1%
-[Information] [12/12/2018 8:47:44] x264 [info]: ref B L0: 84.1%  8.9%  5.2%  1.8%
-[Information] [12/12/2018 8:47:44] x264 [info]: kb/s:6588.78
-[Information] [12/12/2018 8:47:44] encoded 3240 frames, 7.065 fps, 6588.78 kb/s, 106.14 MB
-[Information] [12/12/2018 8:47:44] x264 [info]: ended at Wed Dec 12 08:47:44 2018
-[Information] [12/12/2018 8:47:44] x264 [info]: encoding duration 0:07:39
What's important in that log is those quantizers for I P and B frames. See how close they are together
Code:
-[Information] [12/12/2018 8:47:44] x264 [info]: frame I:131   Avg QP:19.02  size:100964
-[Information] [12/12/2018 8:47:44] x264 [info]: frame P:1468  Avg QP:19.34  size: 45388
-[Information] [12/12/2018 8:47:44] x264 [info]: frame B:1641  Avg QP:20.88  size: 19160
And this is what those elite groups do

Code:
 x264 [info]: frame I:1268  Avg QP:12.13  size:128178
 x264 [info]: frame P:44629 Avg QP:13.54  size: 57251
 x264 [info]: frame B:115431 Avg QP:14.99  size: 26021
 x264 [info]: consecutive B-frames:  5.5%  6.7% 10.5% 36.7% 14.0% 19.4%  3.2%  3.1%  0.5%  0.4%  0.2
See how the number of B-frames is completaly off the chart?

The final filesize of this test was 106.14 MB and has a bitrate of 6588.78 kb/s (about 6.4g mbps). the final filesize you need to do x50 to have the size of the final encode.
 
Last edited:

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads


Development Donations

 

Members online

Trending