Sono nuovo agli script e all'automazione, ma ho scritto una sceneggiatura per aiutarmi nel mio lavoro quotidiano di filigrana e masterizzare nel codice di tempo sui video.
Ho creato un drop di Automator su app per convertire video e watermark e funziona perfettamente, ma stavo cercando di includere anche il timecode di masterizzazione, quindi non funziona più.
Qualcuno può aiutarmi?
Questo è lo script che funziona bene, quando faccio cadere un video su di esso, apre una finestra di terminale ed elabora il video
on run {input, parameters}
tell application "Terminal"
activate
set filesString to ""
repeat with file_ in input
set filesString to filesString & " " & quoted form of (POSIX path of file_)
end repeat
do script "for f in" & filesString & "; do
/usr/local/bin/ffmpeg -i \"$f\" -vf \"drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=name_one:x=510:y=1000:fontsize=80:[email protected], drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=name_two:x=390:y=10:fontsize=65:[email protected], drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=name_three:x=200:y=280:fontsize=65:[email protected]\" -s 1280x720 -c:v libx264 -b:v 4000k -pix_fmt yuv420p -b:a 192k ${f%.*}_output_name.mov
done"
end tell
return input
end run
Quando ho fatto la stessa cosa con il timecode drawtext, non ha funzionato.
on run {input, parameters}
tell application "Terminal"
activate
set filesString to ""
repeat with file_ in input
set filesString to filesString & " " & quoted form of (POSIX path of file_)
end repeat
do script "for f in" & filesString & "; do
/usr/local/bin/ffmpeg -i \"$f\" -vf \"drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=text_one:x=(w-text_w)/2:y=1000:fontsize=80:[email protected], drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=text_two:x=(w-text_w)/2:y=10:fontsize=65:[email protected], drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=text_three:x=200:y=280:fontsize=65:[email protected], drawtext=fontfile=/Library/Fonts/Tahoma.ttf:timecode=01:00:00:00:r=25:x=200:y=150:fontsize=50:[email protected]:box=1:[email protected]\" -s 1280x720 -c:v libx264 -b:v 4000k -pix_fmt yuv420p -b:a 192k ${f%.*}_output_name.mov
done"
end tell
return input
end run
Qualcuno può aiutarmi a individuare l'errore? Se lo fai, per favore, considera che stai parlando con un bambino di 5 anni. LOL
Uscita terminale
rafaels-mbp-3:~ Rafael$ for f in '/Users/Rafael/Desktop/test/1645c.mov'; do
> /usr/local/bin/ffmpeg -i "$f" -vf "drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=text_one:x=(w-text_w)/2:y=1000:fontsize=80:[email protected], drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=text_two:x=(w-text_w)/2:y=10:fontsize=65:[email protected], drawtext=fontfile=/Library/Fonts/Tahoma.ttf:text=text_three:x=200:y=280:fontsize=65:[email protected], drawtext=fontfile=/Library/Fonts/Tahoma.ttf:timecode=01:00:00:00:r=25:x=200:y=150:fontsize=50:[email protected]:box=1:[email protected]" -s 1280x720 -c:v libx264 -b:v 4000k -pix_fmt yuv420p -b:a 192k ${f%.*}_output_name.mov
> done
ffmpeg version 2.5 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 15 2014 19:45:57 with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 ' --enable-nonfree --enable-vda
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.102 / 56. 15.102
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fac71821800] multiple edit list entries, a/v desync might occur, patch welcome
Last message repeated 1 times
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/Rafael/Desktop/test/1645c.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2015-04-08 16:17:54
Duration: 00:00:07.42, start: -2.166667, bitrate: 173782 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 116571 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc (default)
Metadata:
creation_time : 2015-04-08 16:17:54
handler_name : Apple Alias Data Handler
encoder : H.264
timecode : 01:59:52:00
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
creation_time : 2015-04-08 16:17:54
handler_name : Apple Alias Data Handler
Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
creation_time : 2015-04-08 16:17:54
handler_name : Apple Alias Data Handler
reel_name : AW_LR2
timecode : 01:59:52:00
[Parsed_drawtext_3 @ 0x7fac717087a0] Both text and text file provided. Please provide only one
[AVFilterGraph @ 0x7fac71601d20] Error initializing filter 'drawtext' with args 'fontfile=/Library/Fonts/Tahoma.ttf:timecode=01:00:00:00:r=25:x=200:y=150:fontsize=50:[email protected]:box=1:[email protected]'
Error opening filters!
rafaels-mbp-3:~ Rafael$