0

I have a https input that I want to crop the top (control) and side (chat bar).

I am using the -vf "crop=1600:980:0:1080" and this works fine.

When I want to scale my cropped input by using -vf "crop=1600:980:0:180,scale=1920:1080"

I get an Error: Command not found - -c:v libx264

Any ideas on what i am doing wrong here.

Here is the ffmpeg part of the script:

ffmpeg \
  -hide_banner -loglevel error \
  -nostdin \
  -s ${CAPTURE_SCREEN_RESOLUTION} \
  -r ${VIDEO_FRAMERATE} \
  -draw_mouse 0 \
  -f x11grab \
    -i ${DISPLAY} \
  -f pulse \
    -ac 2 \
    -i default \
    -vf "crop=1600:980:0:1080,scale=1920:1080" \
  -c:v libx264 \
    -pix_fmt yuv420p \
    -profile:v main \
    -preset slow \
    -x264opts "nal-hrd=cbr:no-scenecut" \
    -minrate ${VIDEO_BITRATE} \
    -maxrate ${VIDEO_BITRATE} \
    -g ${VIDEO_GOP} \
  -c:a aac \
    -b:a ${AUDIO_BITRATE} \
    -ac ${AUDIO_CHANNELS} \
    -ar ${AUDIO_SAMPLERATE} \
  -f flv ${RTMP_URL}

I have also tried to -vf "crop=1600:980:0:1080;scale=1920:1080"

Nic3500
  • 8,144
  • 10
  • 29
  • 40
Mash
  • 1
  • 1
  • Make sure your real file doesn't have whitespace after the backslash on the line before `-c:v libx264` -- such whitespace would negate the backslash's use. Even better, collect all your arguments into an array and then you don't need backslashes by the linebreaks at all. – Charles Duffy Jun 26 '23 at 01:29
  • That usually happens when the shell thinks the line is over. So it interprets the `-c:v libx264` line as a new command. Are you sure your line endings are not Windows (CRLF), no `\\` missing, all variables are set, tabs instead of spaces, ...? – Nic3500 Jun 26 '23 at 01:30
  • https://stackoverflow.com/a/27196266/14122 is an example of the array practice. – Charles Duffy Jun 26 '23 at 01:30
  • (and yes, invisible whitespace characters like CRs/carriage returns/DOS newlines can consume a backslash too, as Nic3500 suggests, and thereby prevent it from working as a line continuation). – Charles Duffy Jun 26 '23 at 01:31
  • Anyhow -- we can't reproduce the problem with the code from the question; make sure that copying-and-pasting from the question into a new file still causes the same problem. – Charles Duffy Jun 26 '23 at 01:37
  • 1
    thank you. yes it was the whitespace after either -i default \ or -c:v libx264 \ If i wanted to use the -tune zerolatency Can i use this after my preset line? – Mash Jun 26 '23 at 02:48

0 Answers0