سؤال

I have this script:

extract.sh:

ffmpeg –i $1 –ss $2 –t $3 –c:v copy –c:a copy $4

If I type

ffmpeg –i full.mp4 –ss 114 –t 30 –c:v copy –c:a copy out.mp4

All go well. But if I try

sh extract.sh full.mp4 114 30 out.mp4

I get :

ffmpeg version 2.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on May  5 2014 11:41:48 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --enable-gpl
  libavutil      52. 48.100 / 52. 48.100
  libavcodec     55. 39.100 / 55. 39.100
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[NULL @ 0x2a20b00] Unable to find a suitable output format for '–i'
–i: Invalid argument

What does sh do to the argument to make it unreadable in the script?

EDIT:

user@domain:~/test$ sh extract.sh cdr.mp4 0 7 generique.mp4
ffmpeg –i cdr.mp4 –ss 0 –t 7 –c:v copy –c:a copy generique.mp4
هل كانت مفيدة؟

المحلول

I ended up re-writing the sh file, it seemed there was invisible character somewhere in it, which where included in the command.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top