Cayars - Setup walk through and some tips and tricks

Thanks for all the help so far! That worked beautifully for the tangled rip. Then I ripped the next one and it’s smaller, but not that much smaller. When i ran media info on the 2 rips on the first video stream section it says English 4 156 kb/s on the smaller one, and 16Mb/s on the bigger one. Why the drastic difference is size, with the same settings?

It all comes down to how well the original was encoded and what kind of space limitations they had on the disc.

@cayars A Question this time not about the Script :wink:
Are you still using your Setup with Drivepool and Snapraid?
What kind of Backup are you using?

Running Drivepool and Snapraid on my Setup (about 30TB)
Now got my Hands on a Free DAS with about same Capacity - would like to use it as Backup.
Will create a second Pool on the same Drivepool installation. Then planing to use some kind of Sync (robocopy or different Tool) to Sync between those Pools.
Any better Idea about Backup?

Yes still using both DrivePool and SnapRaid.

No whatever you do, don’t use the Free DAS system. Pack it up and send it to me instead. LOL
Kidding aside, that system would be fine for a backup. Basically anything with free space can be used as your backup.

Nothing wrong with RoboCopy at all and it will do exactly what’s needed. I’ve used it a lot myself over the years.

@cayars

I want to identify mp4 movies in my library that are not web optimized and then remux them to correct things.

These listings in your original post seem to be what I need, but the links are dead.

Any updated links? I scanned the thread, but may have missed them.

EDIT: When I click on the link in the original post, they go to the “Oops” page. When I click on the links that I copied into this message they work. Weird…

Thanks.

@cayars, I’ve run into some odd with your scripts.

I transcode my media “manually” (not using your scripts) via HandBrakeCLI then I pass the resulting MP4 through your scripts. The transcode that I do gets me the quality that I need and a file size that I really like, and it also leaves me with a file that’s pretty much as I need it.

At that stage, can you tell me what running it through your scripts actually does for me? From what I understand, the settings I’m using with HandBrake are ALREADY relocating the MOOV Atom even though your script says that it’s doing that.

When I’m finished passing the files through your scripts, I see in Plex where I have “Has 64k Bits” showing Yes, but I can’t actually stream the content to any client that wants to play it back via Direct Play. So, the scripts are doing something that is causing problems with the client.

Thoughts?

Some additional thoughts / notes:

First, it’s “Has 64bit Offsets” show Yes, not what I wrote in my last post.

Second, If I pass a working MP4 (with optimizations for web in place) through your scripts WITHOUT allowing the MOOV Atom to be relocated, the file shows that it is no longer web optimized and won’t stream at all.

What is the conversion that’s taking place in your scripts based on how I’m using them? More importantly, where can I potentially make a configuration change to fix this?

ftp://ayars.tv seens to be down for me, or i am doing something wrong…

There is any mirror for the scripts that someone can offer?

I would like to download the scripts as well but am unable to find an active link to them.

HI,
Question about the Script
got ios-audio set to True
Problem now: Got a Show with 2 Channel dts
This would be converted to only 2 Channel aac - but i would like to have it 2 Channel dts + 2 Channel aac
Any Chance for this?

im still waiting for a reply…

@cayars

Carlo, any thoughts on my previous post? I’m trying to better understand what your scripts are doing to the audio that is causing ALL of my Plex clients to not be able to handle them in Direct Play mode any more.

FWIW: It’s ONLY the Plex clients. Playing via DLNA, Emby, or any other video program works perfectly fine with the raw file. Using the Plex clients, I -HAVE- to transcode them in order for the Plex clients to play them. If I stream the MP4 that I get after processing with HandBrake, it plays just fine in Direct Play mode.

Also, this is a problem that cropped up with a Plex Client update that no one on the Plex team will acknowledge. Clearly, something changed but I can’t get anyone to even respond to my requests to look at it.

My MAX-H264 is set to 4.0 and my CRF is set to 20. The ios audio filter is set to dynaudionorm. Most of the settings I have are defaults and the ones I changed are mostly not directly related to processing (things like whether to delete the original after processing or not).

Sorry @ember1205 I haven’t been around here much at all lately. Work, play and other hobbies (as well as not using Plex as my main server anymore) have kept me away. :slight_smile:

Honestly if you are using Handbrake first then the only thing these scripts will do if using the defaults as I set them is to create a 2 channel audio stream if needed. Of course it will handle subtitles as well.

I don’t use Handbrake myself as it’s destructive to audio tracks and subs and things. It does do a good job with the video however, but not any better than ffmpeg IMHO so I don’t see the point of using it.

It sounds like you have a Plex issue as the files generated should be standard files and have been used for years and with many different platforms besides Plex as well.

Thanks for the reply, @cayars.

I had absolutely no issues with any of my media that had been processed through your scripts until earlier this year when the various Plex clients were updated. My main viewing is via the Android app on a fairly new Sony 4K Smart TV (higher end, true Android). Anything processed through your scripts will now “die” somewhere before the first minute of playback and tell me that the connection to the server isn’t fast enough to stream. I can play back using Emby, DLNA, Plex for Kodi, etc. in full resolution without transcoding and there are no issues. It’s only Plex that falls on its face.

This happens on ANY Plex client, but the problem immediately goes away if I switch to a transcoded version of the file. Alternately, I can play back the media processed ONLY by HandBrake and NOT passed through your scripts without issue.

You may recall that my preference for transcoding with HandBrake is because of the significant drop in file size that I am able to achieve compared to using your scripts. My sample movie was Avatar which went from about 48G ‘raw’ to about 8G w/ Handbrake while your scripts were at least double that size.

If I were to take a guess I’d say it’s a sound issue and not a video issue. This would go with issues I’ve seen with Plex as well.

Can you post mediainfo text reports of both files? I’d like to see the difference in the audio tracks.

Carlo

This one will not play (post-processed by HandBrake and then your scripts):

General
Complete name                            : /mnt/videos1/Movies/Toy Story 3 (2010)/Toy Story 3 (2010).m4v
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 3.67 GiB
Duration                                 : 1 h 42 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 123 kb/s
Movie name                               : Toy Story 3 (Disc 1)
Writing application                      : Lavf57.71.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1 h 42 min
Bit rate                                 : 4 478 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 23.976 FPS
Minimum frame rate                       : 11.989 FPS
Maximum frame rate                       : 23.981 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.090
Stream size                              : 3.21 GiB (87%)
Writing library                          : x264 core 148
Encoding settings                        : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=25000 / vbv_bufsize=31250 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Menus                                    : 5

Audio #1
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 160 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 117 MiB (3%)
Language                                 : English
Default                                  : Yes
Alternate group                          : 1
Menus                                    : 5

Audio #2
ID                                       : 3
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 42 min
Duration_LastFrame                       : -5 ms
Bit rate mode                            : Variable
Bit rate                                 : 250 kb/s
Maximum bit rate                         : 256 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 184 MiB (5%)
Language                                 : English
Default                                  : No
Alternate group                          : 1
Menus                                    : 5

Audio #3
ID                                       : 4
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Codec ID                                 : ac-3
Duration                                 : 1 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 224 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 164 MiB (4%)
Language                                 : English
Service kind                             : Complete Main
Default                                  : No
Alternate group                          : 1
Menus                                    : 5

Menu #1
ID                                       : 5
Codec ID                                 : text
Duration                                 : 1 h 42 min
Language                                 : English
Menu For                                 : 1,2,3,4
00:00:00.000                             : Chapter 1
00:04:53.585                             : Chapter 2
00:06:20.255                             : Chapter 3
00:11:37.488                             : Chapter 4
00:15:17.291                             : Chapter 5
00:18:34.280                             : Chapter 6
00:19:23.954                             : Chapter 7
00:26:17.201                             : Chapter 8
00:28:59.529                             : Chapter 9
00:31:47.823                             : Chapter 10
00:33:22.334                             : Chapter 11
00:35:50.065                             : Chapter 12
00:37:30.123                             : Chapter 13
00:40:11.326                             : Chapter 14
00:41:12.637                             : Chapter 15
00:43:37.490                             : Chapter 16
00:44:49.270                             : Chapter 17
00:48:19.522                             : Chapter 18
00:52:28.062                             : Chapter 19
00:53:52.020                             : Chapter 20
00:57:12.095                             : Chapter 21
00:58:20.706                             : Chapter 22
01:01:10.000                             : Chapter 23
01:02:06.640                             : Chapter 24
01:02:57.107                             : Chapter 25
01:06:35.033                             : Chapter 26
01:11:21.736                             : Chapter 27
01:15:57.344                             : Chapter 28
01:17:35.818                             : Chapter 29
01:19:43.320                             : Chapter 30
01:23:02.060                             : Chapter 31
01:24:59.595                             : Chapter 32
01:28:15.582                             : Chapter 33
01:34:18.278                             : Chapter 34
Bit rate mode                            : VBR

Menu #2
00:00:00.000                             : Chapter 1
00:04:53.585                             : Chapter 2
00:06:20.255                             : Chapter 3
00:11:37.488                             : Chapter 4
00:15:17.291                             : Chapter 5
00:18:34.280                             : Chapter 6
00:19:23.954                             : Chapter 7
00:26:17.201                             : Chapter 8
00:28:59.529                             : Chapter 9
00:31:47.823                             : Chapter 10
00:33:22.334                             : Chapter 11
00:35:50.065                             : Chapter 12
00:37:30.123                             : Chapter 13
00:40:11.326                             : Chapter 14
00:41:12.637                             : Chapter 15
00:43:37.490                             : Chapter 16
00:44:49.270                             : Chapter 17
00:48:19.522                             : Chapter 18
00:52:28.062                             : Chapter 19
00:53:52.020                             : Chapter 20
00:57:12.095                             : Chapter 21
00:58:20.706                             : Chapter 22
01:01:10.000                             : Chapter 23
01:02:06.640                             : Chapter 24
01:02:57.107                             : Chapter 25
01:06:35.033                             : Chapter 26
01:11:21.736                             : Chapter 27
01:15:57.344                             : Chapter 28
01:17:35.818                             : Chapter 29
01:19:43.320                             : Chapter 30
01:23:02.060                             : Chapter 31
01:24:59.595                             : Chapter 32
01:28:15.582                             : Chapter 33
01:34:18.278                             : Chapter 34

This one will play (post-processed by HandBrake only):

General
Complete name                            : /mnt/videos1/Movies/Toy Story 3 (2010)/Toy Story 3 (2010).mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/iso2/avc1/mp41)
File size                                : 3.79 GiB
Duration                                 : 1 h 42 min
Overall bit rate                         : 5 287 kb/s
Movie name                               : Toy Story 3 (Disc 1)
Encoded date                             : UTC 2018-11-27 06:40:04
Tagged date                              : UTC 2018-11-27 06:40:04
Writing application                      : HandBrake 1.1.2 2018090700

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1 h 42 min
Bit rate                                 : 4 478 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 23.976 (24000/1001) FPS
Minimum frame rate                       : 23.974 FPS
Maximum frame rate                       : 23.981 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.090
Stream size                              : 3.21 GiB (85%)
Writing library                          : x264 core 152
Encoding settings                        : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=18 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=25000 / vbv_bufsize=31250 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : UTC 2018-11-27 06:40:04
Tagged date                              : UTC 2018-11-27 06:40:04
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Menus                                    : 4

Audio #1
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 160 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 117 MiB (3%)
Title                                    : Stereo / Stereo
Language                                 : English
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 2018-11-27 06:40:04
Tagged date                              : UTC 2018-11-27 06:40:04
Fallback From                            : 3
Menus                                    : 4

Audio #2
ID                                       : 3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Codec ID                                 : ac-3
Duration                                 : 1 h 42 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 469 MiB (12%)
Title                                    : Surround / Surround
Language                                 : English
Service kind                             : Complete Main
Default                                  : Inherited From: 2
Alternate group                          : 1
Encoded date                             : UTC 2018-11-27 06:40:04
Tagged date                              : UTC 2018-11-27 06:40:04
Fallback To                              : 2

Menu
ID                                       : 4
Codec ID                                 : text
Duration                                 : 1 h 42 min
Language                                 : English
Encoded date                             : UTC 2018-11-27 06:40:04
Tagged date                              : UTC 2018-11-27 06:40:04
Menu For                                 : 1,2
00:00:00.000                             : Chapter 1
00:04:53.585                             : Chapter 2
00:06:20.255                             : Chapter 3
00:11:37.488                             : Chapter 4
00:15:17.291                             : Chapter 5
00:18:34.280                             : Chapter 6
00:19:23.954                             : Chapter 7
00:26:17.201                             : Chapter 8
00:28:59.529                             : Chapter 9
00:31:47.823                             : Chapter 10
00:33:22.334                             : Chapter 11
00:35:50.065                             : Chapter 12
00:37:30.123                             : Chapter 13
00:40:11.326                             : Chapter 14
00:41:12.637                             : Chapter 15
00:43:37.490                             : Chapter 16
00:44:49.270                             : Chapter 17
00:48:19.522                             : Chapter 18
00:52:28.062                             : Chapter 19
00:53:52.020                             : Chapter 20
00:57:12.095                             : Chapter 21
00:58:20.706                             : Chapter 22
01:01:10.000                             : Chapter 23
01:02:06.640                             : Chapter 24
01:02:57.107                             : Chapter 25
01:06:35.033                             : Chapter 26
01:11:21.736                             : Chapter 27
01:15:57.344                             : Chapter 28
01:17:35.818                             : Chapter 29
01:19:43.320                             : Chapter 30
01:23:02.060                             : Chapter 31
01:24:59.595                             : Chapter 32
01:28:15.582                             : Chapter 33
01:34:18.278                             : Chapter 34
Bit rate mode                            : VBR

When you play this back what is the reason Plex said it needs to transcode?
What does that section of the log look like?

Plex doesn’t state anything about needing to transcode…

Start the movie and it “clocks” for longer than normal. The movie starts playing and then it freezes (about 10 seconds or so in, usually). Plex then throws an error that says “Your connection to the server is not fast enough to stream this video. Check your network or try a lower quality.”

This error happens on EVERY title that I have passed through both HandBrake AND your scripts, but to NONE of them that have passed through only HandBrake.

If I opt to play a lower quality, which puts the system into transcoding mode, it plays absolutely fine.

If I play the EXACT same content through Plex for Kodi, Emby, or ANY OTHER client, it plays absolutely fine. The issue is the Plex CLIENT and it’s consistent across ALL DEVICES (Android, Android TV, iOS, and FireStick).

When it hangs, if I leave it alone, it will start playing again on its own after a minute or two. But it hangs again after another 5-10 seconds. It’s like the client believes it’s getting information “out of order” or isn’t cacheing enough information to keep the playback going.

@cayars, I’m curious to know if you are not using Plex as your main server anymore, what are you using? Why the change?

My OS drive failed on me two weeks ago and I didn’t have a backup image! I have to set everything up from the beginning and I used this forum years ago. I remember a few stuff and wrote some notes down, but some steps appear obsolete or no longer necessary.