Vom video player zu Animated Gif mit Automator

ich hab es runtergelassen und ins Verzeichnis /usr/local/bin/ffmpeg kopiert dann

  1. sudo chown root:wheel /usr/local/bin/ffmpeg
    sudo chmod 755 /usr/local/bin/ffmpeg
jetzt bekomme ich "Illegal Instruction: 4 " beim Aufruf von ​ffmpeg -version
 
Was für einen Rechner hast du?
Versuchs mal direkt im runtergeladenen Ordner. Du solltest gar nichts verschieben müssen und hast hier jetzt verschiedene Dateien gemischt, die nicht hätten gemischt werden sollen.
 
MacBook Pro (Retina, 13-inch, Late 2013)

wenn ich es entpackt und es öffne kommt das terminal und es steht auch illegal Instruktion 4
 
Wenn es auch kommt während keine Libs vermischt sind, dann vergiss die Binaries, die funktionieren (so wie sie kompiliert wurden) dann einfach nicht auf deiner CPU/OSX Kombination.
Mach bitte an der Stelle mit dem Einfügen der erwähnten echo Nachrichten weiter.
 
ich habe jetzt das echo $SECONDS eingebaut, aber blöde frage wo gibt er das echo aus ??? wenn ich es über automator laufen lasse sehe ich ja keine terminal ausgaben.


#!/bin/bash
#set -vx


[[ "$1" = "-h" ]] && echo "Syntax: ${0##*/} [-t]" && exit 1


theLength=2; #in seconds
theResolution=425; #x in pixels (y=auto aspect ratio)
theFrameRate=14; #frames per second


thePath=$(osascript -e 'tell app "VLC" to get path of current item');
thePos=$(osascript -e 'tell app "VLC" to get current time');
echo $SECONDS
[[ "$thePath" ]] && echo -e "$thePath:$thePos\n" && tmpdir=$(mktemp -d -t "${0##*/}") && \
echo $SECONDS
/usr/local/bin/ffmpeg -threads 4 -i "$thePath" -ss "$thePos" -t "$theLength" -r "$theFrameRate" -vf scale="$theResolution":-1 -f image2 "$tmpdir"/%03d.png && \
echo $SECONDS
/opt/ImageMagick/bin/convert -delay 1x"$theFrameRate" "$tmpdir"/*.png -coalesce -layers OptimizeTransparency "${thePath%.*}${thePos%.*}.gif" || \
{ echo "VLC: No file open." && exit 2; }


[[ "$1" = "-t" ]] && exit 0 || rm -rf "$tmpdir"
 
Du siehst da ein Bash Skript vor dir, wieso nutzt du es nicht einfach als solches und führst es im Terminal aus?
 
also er extrahiert die bilder dann kommt

error parsing debug value size=N/A time=00:00:00.00 bitrate=N/A

debug=0

ffmpeg geht auf 250% hängt dort bis zu 11 minuten

dann erstellt er innerhalb von ein paar sec das gif

am ende steht 1004
 
Code:
flomacbook:~ flo$ #!/bin/bashflomacbook:~ flo$ #set -vx
flomacbook:~ flo$ 
flomacbook:~ flo$ [[ "$1" = "-h" ]] && echo "Syntax: ${0##*/} [-t]" && exit 1
flomacbook:~ flo$ 
flomacbook:~ flo$ 
flomacbook:~ flo$ theLength=2; #in seconds
flomacbook:~ flo$ theResolution=425; #x in pixels (y=auto aspect ratio)
flomacbook:~ flo$ theFrameRate=14; #frames per second
flomacbook:~ flo$ 
flomacbook:~ flo$ 
flomacbook:~ flo$ thePath=$(osascript -e 'tell app "VLC" to get path of current item');
flomacbook:~ flo$ thePos=$(osascript -e 'tell app "VLC" to get current time');
flomacbook:~ flo$ echo $SECONDS
154
flomacbook:~ flo$ [[ "$thePath" ]] && echo -e "$thePath:$thePos\n" && tmpdir=$(mktemp -d -t "${0##*/}") && \
> echo $SECONDS
/Users/flo/Downloads/111.mp4:1003


154
flomacbook:~ flo$ /usr/local/bin/ffmpeg -threads 4 -i "$thePath" -ss "$thePos" -t "$theLength" -r "$theFrameRate" -vf scale="$theResolution":-1 -f image2 "$tmpdir"/%03d.png && \
> echo $SECONDS
ffmpeg version 2.3.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug 22 2014 13:45:20 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.100 / 55. 48.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.100 /  4. 11.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/flo/Downloads/111.mp4':
  Metadata:
    major_brand     : M4V 
    minor_version   : 1
    compatible_brands: M4V mp42isom
    creation_time   : 2014-07-18 03:37:18
    track           : 0
    artist          : 
    album           : 
    comment         : 
    date            : 0
    genre           : 
  Duration: 00:18:39.34, start: 0.000000, bitrate: 4090 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], 3888 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2014-07-18 03:37:18
      handler_name    : Mainconcept MP4 Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2014-07-18 03:37:18
      handler_name    : Mainconcept MP4 Sound Media Handler
Output #0, image2, to '/var/folders/94/hksvplw93znd7kcgts43cyq80000gn/T/-bash.DqYsOwdI/%03d.png':
  Metadata:
    major_brand     : M4V 
    minor_version   : 1
    compatible_brands: M4V mp42isom
    genre           : 
    track           : 0
    artist          : 
    album           : 
    comment         : 
    date            : 0
    encoder         : Lavf55.48.100
    Stream #0:0(eng): Video: png, rgb24, 425x239 [SAR 3824:3825 DAR 16:9], q=2-31, 200 kb/s, 14 fps, 14 tbn, 14 tbc (default)
    Metadata:
      creation_time   : 2014-07-18 03:37:18
      handler_name    : Mainconcept MP4 Video Media Handler
      encoder         : Lavc55.69.100 png
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A    
Enter command: <target>|all <time>|-1 <command>[ <argument>]
Parse error, at least 3 arguments were expected, only 1 given in string 'k/bin/convert -delay 1x"$theFrameRate" "$tmpdir"/*.png -coalesce -layers OptimizeTransparency "${thePath%.*}${thePos%.*}.gif" || \'
frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A    
Enter command: <target>|all <time>|-1 <command>[ <argument>]
Parse error, at least 3 arguments were expected, only 1 given in string 'ho "VLC: No file open." && exit 2; }'
error parsing debug value size=N/A time=00:00:00.00 bitrate=N/A    
debug=0
[FONT=Menlo]1004[/FONT]
 
hallo,
danke für eure Hilfe aber leider haut das für mich garnicht hin mit ffmpeg, es dauert einfach viel zu lange sogar auf einem macbook pro mit Quad-Core. nur um ein paar poplige Bilder aus einem hd video zu ziehen.

ich möchte jetzt gerne einen anderen Ansatz versuchen. und zwar das ich an VLC immer abwechselnd einen shortcut für "videosnappschuss machen" und eine sec vor springen sende.
wie kann ich das am reibungslosesten in automator machen ? ich habe es mit der record Funktion vom automator versucht aber da funktioniert das senden von shortcuts nicht verlässlich genug.
danach soll er die Bilder im vorgegebenen Ordner mit convert zum gif zusammen gefügt werden.
am ende die vlideosnappschuss bilder löschen.
 
Hallo,

ich glaube ich habe die Probleme mit ffmpeg gelöst:

Code:
#!/bin/bash
#set -vx


[[ "$1" = "-h" ]] && echo "Syntax: ${0##*/} [-t]" && exit 1


theLength=2; #in seconds
theResolution=425; #x in pixels (y=auto aspect ratio)
theFrameRate=14; #frames per second


thePath=$(osascript -e 'tell app "VLC" to get path of current item');
thePos=$(osascript -e 'tell app "VLC" to get current time');
echo $SECONDS
[[ "$thePath" ]] && echo -e "$thePath:$thePos\n" && tmpdir=$(mktemp -d -t "${0##*/}") && \
echo $SECONDS
/usr/local/bin/ffmpeg -nostdin -threads 4 -ss "$thePos" -i "$thePath" -t "$theLength" -r "$theFrameRate" -vf scale="$theResolution":-1 -f image2 "$tmpdir"/%03d.png && \
echo $SECONDS
/opt/ImageMagick/bin/convert -delay 1x"$theFrameRate" "$tmpdir"/*.png -coalesce -layers OptimizeTransparency "${thePath%.*}${thePos%.*}.gif" || \
{ echo "VLC: No file open." && exit 2; }


[[ "$1" = "-t" ]] && exit 0 || rm -rf "$tmpdir"

Die ausgegebenen Fehlermeldungen sollten dank der Option nostdin jetzt weg sein. Außerdem wird nun Input-Seeking statt Output-Seeking verwendet, was bei einer späten Startposition zu der hohen Auslastung und der langen Dauer geführt hat. Mehr dazu hier: https://trac.ffmpeg.org/wiki/Seeking

Bitte mal testen und die Ausgabe hier posten. Warum VLC solange braucht, kann ich mir noch nicht erklären, aber vielleicht hängt das ja zusammen.
 
ich habe ein video im VLC offen bekomme folgenden Fehler:

Last login: Wed Aug 5 00:45:37 on ttys000
MacBook-Pro:~ flo$ #!/bin/bash
MacBook-Pro:~ flo$ #set -vx
MacBook-Pro:~ flo$
MacBook-Pro:~ flo$
MacBook-Pro:~ flo$ [[ "$1" = "-h" ]] && echo "Syntax: ${0##*/} [-t]" && exit 1
MacBook-Pro:~ flo$
MacBook-Pro:~ flo$
MacBook-Pro:~ flo$ theLength=2; #in seconds
MacBook-Pro:~ flo$ theResolution=425; #x in pixels (y=auto aspect ratio)
MacBook-Pro:~ flo$ theFrameRate=14; #frames per second
MacBook-Pro:~ flo$
MacBook-Pro:~ flo$
MacBook-Pro:~ flo$ thePath=$(osascript -e 'tell app "VLC" to get path of current item');
MacBook-Pro:~ flo$ thePos=$(osascript -e 'tell app "VLC" to get current time');
MacBook-Pro:~ flo$ echo $SECONDS
13
MacBook-Pro:~ flo$ [[ "$thePath" ]] && echo -e "$thePath:$thePos\n" && tmpdir=$(mktemp -d -t "${0##*/}") && \
> echo $SECONDS
/Volumes/INTENSO/music.mp4:823

13
MacBook-Pro:~ flo$ /Users/flo/Library/Application\ Support/iFFmpeg5/ffmpeg -nostdin -threads 4 -ss "$thePos" -i "$thePath" -t "$theLength" -r "$theFrameRate" -vf scale="$theResolution":-1 -f image2 "$tmpdir"/%03d.png && \
> echo $SECONDS
ffmpeg version 2.7.1 Copyright (c) 2000-2015 the FFmpeg developers
built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
configuration: --prefix=/Volumes/tempdisk/sw --as=yasm --enable-gpl --enable-version3 --enable-pthreads --disable-ffplay --disable-ffserver --disable-shared --enable-static --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-zlib --enable-avfilter --enable-fontconfig --enable-libfreetype --enable-libass --enable-libutvideo --enable-libvidstab --enable-filters --enable-postproc --enable-runtime-cpudetect --disable-indev=qtkit --disable-indev=x11grab_xcb
libavutil 54. 27.100 / 54. 27.100
libavcodec 56. 41.100 / 56. 41.100
libavformat 56. 36.100 / 56. 36.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.101 / 5. 16.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.100 / 1. 2.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/INTENSO/music.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2014-05-22 21:43:16
compilation : 0
encoder : Sorenson Squeeze
comment : Encoded by
Duration: 00:34:55.33, start: 0.000000, bitrate: 2734 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 128 kb/s (default)
Metadata:
creation_time : 2014-05-22 21:43:16
handler_name : soun
Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2500 kb/s, 28 fps, 28 tbr, 90k tbn, 56 tbc (default)
Metadata:
creation_time : 2014-05-22 21:43:16
handler_name : vide
encoder : AVC Coding
Stream #0:2(und): Data: none (mp4s / 0x7334706D) (default)
Metadata:
creation_time : 2014-05-23 00:12:43
handler_name : sdsm
Stream #0:3(und): Data: none (mp4s / 0x7334706D) (default)
Metadata:
creation_time : 2014-05-23 00:12:43
handler_name : odsm
Stream #0:4(eng): Data: none (rtp / 0x20707472), 11 kb/s
Metadata:
creation_time : 2014-05-24 00:12:45
Stream #0:5(eng): Data: none (rtp / 0x20707472), 87 kb/s
Metadata:
creation_time : 2014-05-24 00:12:46
Output #0, image2, to '/var/folders/hw/fjpt03cs3mn5r3dz9cttx2z00000gn/T/-bash.gCpVgoIc/%03d.png':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
comment : Encoded by
compilation : 0
encoder : Lavf56.36.100
Stream #0:0(und): Video: png, rgb24, 425x239 [SAR 3824:3825 DAR 16:9], q=2-31, 200 kb/s, 14 fps, 14 tbn, 14 tbc (default)
Metadata:
creation_time : 2014-05-22 21:43:16
handler_name : vide
encoder : Lavc56.41.100 png
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> png (native))
frame= 28 fps=0.0 q=0.0 Lsize=N/A time=00:00:02.00 bitrate=N/A dup=0 drop=25
video:4864kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
14
MacBook-Pro:~ flo$ /opt/local/bin/convert -delay 1x"$theFrameRate" "$tmpdir"/*.png -coalesce -layers OptimizeTransparency "${thePath%.*}${thePos%.*}.gif" || \
> { echo "VLC: No file open." && exit 2; }
dyld: Library not loaded: /opt/local/lib/libexpat.1.dylib
Referenced from: /opt/local/lib/libfontconfig.1.dylib
Reason: Incompatible library version: libfontconfig.1.dylib requires version 8.0.0 or later, but libexpat.1.dylib provides version 7.0.0
Trace/BPT trap: 5
VLC: No file open.
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
 
ich habe FFmpeg ohne MacPorts installiert "iffmpeg" damit ich das Monstrum Xcode (3,5GB) nicht installieren muss. wenn ich
"sudo port -n upgrade --force libiconv" eingebe um die "libiconv rebuild" eingebe bekomme ich :

Error: Current platform "darwin 15" does not match expected platform "darwin 14"
Error: If you upgraded your OS, please follow the migration instructions: https://trac.macports.org/wiki/Migration
OS platform mismatch
while executing
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, OS platform mismatch

auf https://trac.macports.org/wiki/Migration bekomme ich wieder ne Anleitung das ich Xcode installieren muss . . .
geht das auch ohne ???
 
macports ohne Xcode geht natürlich nicht.
Es liegt nicht an ffmpeg, sondern an ImageMagick.
Ausserdem ist das script zur Verwendung als scriptdatei geschrieben, nicht zur terminaleingabe.
 
Zuletzt bearbeitet:
Ich würde ImageMagick mal komplett deinstallieren und dann neu installieren über homebrew. Homebrew ist ein Paketmanager ähnlich wie Macports, nur dass kein Xcode benötigt wird.
 
Zurück
Oben Unten