• Apfeltalk ändert einen Teil seiner Allgemeinen Geschäftsbedingungen (AGB), das Löschen von Useraccounts betreffend.
    Näheres könnt Ihr hier nachlesen: AGB-Änderung
  • Der Frühling ist auch in den eingesandten Fotos deutlich zu erkennen. Zeigt uns, wer Euer Favorit ist! hier geht es lang für Euer Voting --> Klick

Script Dreambox TS Dateien --> MP4 Konvertierung --> iTunes Export

stampfki

Gala
Registriert
20.05.07
Beiträge
48
Hallo Zusammen,

möchte die Aufnahmen der Dreambox8000 via Handbrake in mp4 files umwandeln und anschliessend automatisch in iTunes schieben.
Habe im Net folgendes Script gefunden, was auch gut funktioniert, nur werden die konvertierten files in dem Quellverzeichnis abgelegt. Mein Ziel, dass sie nach iTunes verschoben werden.

Könntet Ihr mir bitte weiterhelfen?

Vielen Dank!

--on adding folder items to this_folder after receiving these_items
with timeout of (720 * 60) seconds
tell application "Finder"
--Get all AVI and MKV files that have no label color yet, meaning it hasn't been processed
set allFiles to every file of entire contents of ("Harddisk" as alias) whose ((name extension is "ts" or name extension is "mkv") and label index is 0)

--Repeat for all files in above folder
repeat with i from 1 to number of items in allFiles
set currentFile to (item i of allFiles)

try
--Set to gray label to indicate processing
set label index of currentFile to 7

--Assemble original and new file paths
set origFilepath to quoted form of POSIX path of (currentFile as alias)
set newFilepath to (characters 1 thru -5 of origFilepath as string) & "mp4'"

--Start the conversion
set shellCommand to "nice /Applications/HandBrakeCLI -i " & origFilepath & " -o " & newFilepath & " -e x264 -b 4000 -a 1 -E faac -B 160 -R 48 -6 dpl2 -f mp4 --crop 0:0:0:0 -x level=40:ref=2:mixed-refs:bframes=3:weightb:subme=9:direct=auto:b-pyramid:me=umh:analyse=all:no-fast-pskip:filter=-2,-1 ;"
do shell script shellCommand

--Set the label to green in case file deletion fails
set label index of currentFile to 6

--Remove the old file
set shellCommand to "rm -f " & origFilepath
do shell script shellCommand
on error errmsg
--Set the label to red to indicate failure
set label index of currentFile to 2
end try
end repeat
end tell
end timeout
--end adding folder items to
 

toc-rox

Weigelts Zinszahler (Rotfranch)
Registriert
15.11.09
Beiträge
247
Dies könnte (ggf.) weiterhelfen:

- Track von der Kommandozeile der iTunes-Library hinzufügen (Beispiel für Tests):
osascript -e 'tell application "iTunes" to add POSIX file "/Users/the-me/FallenRain.mp3"'

Das würde man dann (falls schon ausreichend) natürlich an geeigneter Stelle direkt (ohne die Kommandozeile zu bemühen) ins Skript integrieren (Beispiel):
tell application "iTunes" to add POSIX file "/Users/the-me/FallenRain.mp3"