Cayars - Setup walk through and some tips and tricks

It seems that the script creates another aac stereo track if it encounters a file it has already processed. The codec for the second stereo track is named ‘copy’.
Had to stop the script after it did about 40 movies and decided to run it again so it could finish the job (this specific dir has ~1000 movies). I was under the impression it would skip the first 40 movies it already converted but now it is doing them all over again?

No don’t run it through a 3rd time. Something is off and we need to figure out if it’s your convert script or Plex.

So let try analyzing the file outside of Plex. What try looking at the file with MediaInfo and see if it says the file is optimized or not.

@UniMatrix80 said:
It seems that the script creates another aac stereo track if it encounters a file it has already processed. The codec for the second stereo track is named ‘copy’.
Had to stop the script after it did about 40 movies and decided to run it again so it could finish the job (this specific dir has ~1000 movies). I was under the impression it would skip the first 40 movies it already converted but now it is doing them all over again?

Yes, I just noticed this myself. Looks like 2.3 version will be needed. :slight_smile: This probably only happens if you are using the newish audio normalization I added in the last version. Prior to that it would not re-process the AAC audio track if it was the first track. I’ll have to look at that and figure out the best way to handle this.

I’m also wanting to add automatic de-interlacing as well. The need to de-interlace was almost an overthought with rips coming from BluRays and online sources that have already processed files but now with Plex DVR anything 480 or 1080 will be interlaced and could use de-interlacing since Plex’s internal de-interlace support is sub-par.

What I’d really love to do is move away from python to Visual C++ since that would give me a lot more control and freedom as to what I can do since I’m a C programmer at heart. If I were to do this I could add comskip, Handbrake (in addition to ffmpeg), de-interlacing as well as a few more goodies if needed/wanted including a GUI or even distributed work across multiple computers. I need to think about this a bit to determine the direction I want to take this in.

But I’ll take a look at the audio copy issue so see if I can get that in 2.3.

Carlo

@cayars said:

@UniMatrix80 said:
It seems that the script creates another aac stereo track if it encounters a file it has already processed. The codec for the second stereo track is named ‘copy’.
Had to stop the script after it did about 40 movies and decided to run it again so it could finish the job (this specific dir has ~1000 movies). I was under the impression it would skip the first 40 movies it already converted but now it is doing them all over again?

Yes, I just noticed this myself. Looks like 2.3 version will be needed. :slight_smile: This probably only happens if you are using the newish audio normalization I added in the last version. Prior to that it would not re-process the AAC audio track if it was the first track. I’ll have to look at that and figure out the best way to handle this.

I’m also wanting to add automatic de-interlacing as well. The need to de-interlace was almost an overthought with rips coming from BluRays and online sources that have already processed files but now with Plex DVR anything 480 or 1080 will be interlaced and could use de-interlacing since Plex’s internal de-interlace support is sub-par.

What I’d really love to do is move away from python to Visual C++ since that would give me a lot more control and freedom as to what I can do since I’m a C programmer at heart. If I were to do this I could add comskip, Handbrake (in addition to ffmpeg), de-interlacing as well as a few more goodies if needed/wanted including a GUI or even distributed work across multiple computers. I need to think about this a bit to determine the direction I want to take this in.

But I’ll take a look at the audio copy issue so see if I can get that in 2.3.

Carlo

Awesome, I’ll wait for that version.
Might also wanna take a look at the audiotracks with no label (shown as ‘unknown’ in Plex). It now sets them to ENG, but mostly these are foreign languages.
Furthermore it seems to skip files every now and then, one filder had ‘%’ in the name wich I guess it can’t handle, but others I can’t see anything out of the ordinary.

Have mentioned it before but will do it again here, thanks alot for the script and your continuing support!

The changing of no label to ENG is a setting you can configure in the ini file so that’s there already.

Sounds like you might be using Python V2 which doesn’t handle unicode chars. Change to Python V3 and it has far better handling of special chars in file names.

@cayars said:
The changing of no label to ENG is a setting you can configure in the ini file so that’s there already.

Sounds like you might be using Python V2 which doesn’t handle unicode chars. Change to Python V3 and it has far better handling of special chars in file names.

Would you be able to use Python v3 with SAB even though in the support page of SAB says it only supports v2?

You can have both installed on your machine. Just leave V2 as the default in your path and in the run.bat use it with the command line to V3 of python.

My run.bat looks like this:
c:\python3\python manual.py -a -i C:\convert1\process

So it forces the use of python3 for these scripts.

@cayars said:
You can have both installed on your machine. Just leave V2 as the default in your path and in the run.bat use it with the command line to V3 of python.

My run.bat looks like this:
c:\python3\python manual.py -a -i C:\convert1\process

So it forces the use of python3 for these scripts.

Yes, I know. It works without any issues when running the script alone. My question is actually when you use it with SAB :slight_smile: I thought you were using SAB’s post-processing also to convert the media files.

I’m using v3 with Sonarr and Radarr as they both support it with no problems as well.

@cayars I installed mediainfo and selected the media in question, but I don’t know where in the output I should be looking for to determine if mediainfo recognizes the media as web optimized or not. I did not see any data in the output to be able to make that determination. Perhaps you could point me to what output I should be looking at? Thanks in advance.

@almontef said:
@cayars I installed mediainfo and selected the media in question, but I don’t know where in the output I should be looking for to determine if mediainfo recognizes the media as web optimized or not. I did not see any data in the output to be able to make that determination. Perhaps you could point me to what output I should be looking at? Thanks in advance.

You should check the “web optimized” info in Plex, not in MediaInfo. When you right-click the media file in Plex, there’s “Get Info”.

Hi @kevindd992002 that is what I originally did but that shows up as no so @cayars recommended to pull down mediainfo to see what something outside of plex tells us about the media. This is media that has been successfully converted but plex still shows them as not being web optimized.

@almontef said:
Hi @kevindd992002 that is what I originally did but that shows up as no so @cayars recommended to pull down mediainfo to see what something outside of plex tells us about the media. This is media that has been successfully converted but plex still shows them as not being web optimized.

Ok, I just re-read the conversation and you’re right. Sorry.

No worries appreciate the assist!

@almontef said:
@cayars I installed mediainfo and selected the media in question, but I don’t know where in the output I should be looking for to determine if mediainfo recognizes the media as web optimized or not. I did not see any data in the output to be able to make that determination. Perhaps you could point me to what output I should be looking at? Thanks in advance.

Let’s kill a couple of steps in one shot. Try running something like this line after adjusting for your system:
C:\Python27\Python C:\Python27\Scripts\qtfaststart -l “f:\movies op gun (1986) op gun (1986).mp4”

Obviously change the path to your python directory as well as the file name you want to check. You should get an ouput similar to:

ftyp (24 bytes)
moov (2759896 bytes)
mdat (3217089508 bytes)
free (55 bytes)

What we are interested in is the MOOV and MDAT items. If the index to the MOOV is lower/less than the index to the MDAT then this is a WEB OPTIMIZED file. If the MOOV index number is larger than the MDAT number then the moov atom comes after the data and it’s not optimized.

If you get an error or the qtfaststart file isn’t in the your scripts directory under the python install directory then you didn’t follow the directions correctly when installing the script or skipped a PIP install. In which case just follow the instructions.txt file in the zip again (won’t hurt to rerun commands).

Carlo

Just FYI…I checked my most recent movies converted with this script, and through plex it is showing web optimized as “yes”.

I think he might have skipped the PIP install for qtfaststart so none of his files get “optimized” but that’s just a hunch. at this point. We’ll know shortly.

Carlo

I e.g. have installed qtfaststart just fine via pip but I still get the message when running the script that qtfaststart is not present and therefore it can’t be used (ubuntu 16.04). Dunno why, I just kept on living with it.

@cayars

Do you have list of changes you did to the original mp4_sickbeard scripts? What was changed specifically?

Yea don’t know. Originally I did a bunch of things and gave them back. Most of my changes are now in mp4_sickbeard.

I do have some (minor) changes for sound normalization, HW transcoding, and a couple of logic changes but that’s about it at this point. The current version I started that you guys don’t have is working on auto de-interlacing and probably comskip support to cut commercials from DVR recordings.

@cayars busy day so did not have a chance to look into this until now. I ran the command as instructed and it ran with no problem. Here is the output:

ftyp (32 bytes)
moov (11128395 bytes)
mdat (1785348534 bytes)
free (8 bytes)

So it looks like the file is web optimized. Not sure why Plex shows that the file is not web optimized. Hoping it’s not some corruption with the plex db or if it is looking at something else to determine if it is web optimized or not. Running your 2.2 scripts for what it’s worth. Love a good mystery.