@don.alcombright said:
@cayars , what is your best recommendation for generating a list of file locations (for files needed to be be converted)?My original thought was the get the list of file paths of these files and then run it via a batch command 1 at a time so I could do lets say 50 a day or so and actually monitor the outcome easily, aka if audio messes up or i lose something i didn’t mean too etc etc. But I can’t seem to find a way to get the full list of files exported to a list, or better yet a full list of files that should be converted to a list.
something like this so I can monitor it in the bat file (and comment out the ones I want to do that day:
c:\python27\python manual.py -a -i “\hades\movies\3 Days to Kill (2014)” >> D:\Convert\log.txt
c:\python27\python manual.py -a -i “\hades\movies\8 Mile (2002)” > D:\Convert\log.txt
c:\python27\python manual.py -a -i “\hades\movies\8MM (1999)” > D:\Convert\log.txt
OK. first and for most I want you to shut down Plex and copy the plex database out to a new location to play with as a test. Re-Start plex again. This is just for safety and always a good idea to do when testing anything new.
Download and install SQLite3 binaries onto your plex server from here: SQLite Download Page
You will want SQLite3 and all the files below in the same directory.
What’s sharing from here on out is for Windows since it uses batch files but would be super easy to change for Linux. The important part is to get the idea how to do it.
create a new text file called transcode.txt and put the following in it:
.open ‘C:\PlexData\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db’
.output Transcode.bat
SELECT ‘c:\python27\Python C:\convert\manual.py -a -i "’ || file || ‘"’ FROM media_parts join media_items
on media_parts.media_item_id=media_items.id
where container=‘mp4’ and optimized_for_streaming <> 1
order by file;
In the above file change the first line to point to your copy of the database. After you are sure all is working correctly you can change this to point back to your real version.
Now all you have to do is run:
sqlite3 < transcode.txt
You can put that in a batch file if you want.
When you run that it fires up SQLite and uses the contents of the text file to tell it what database to use. It tells it to pipe the output out to transcode.bat (so you can run it when done). It also contains the SQL code used to run against the database.
You can adjust as needed (or I’ll help) to match your system and needs. The output as it stands will generate something like the following in the batch file:
c:\python27\Python C:\convert\manual.py -a -i “F:\TV Shows\Ongoing\Top Shot (2010)\Season 0\Top Shot - S00E01 - Additional Footage.MP4”
c:\python27\Python C:\convert\manual.py -a -i “F:\TV Shows\Ongoing\Top Shot (2010)\Season 0\Top Shot - S00E02 - Contestant Bios.MP4”
c:\python27\Python C:\convert\manual.py -a -i “F:\TV Shows\Ongoing\Top Shot (2010)\Season 0\Top Shot - S00E03 - Elimination Interviews.MP4”
Hope this helps!
Carlo
PS this one particular one above looks ONLY for MP4 files that aren’t “web optimized” (proper moov atom at start of file).
This would be the first iteration you would want to run. After this you can adjust it to look at things like ref frames, 10 bit color, no AAC as first track, or other types other than MP4.
Of course once you take care or your existing MP4s you can just run the normal conversion scripts against your library to take care of AVIs, MPG, MKV, etc.
I’ll help with the different iterations you will need but want to start you off with an EASY SQL to get your “feet wet”.