VideoHelp Forum

Try DVDFab and copy Ultra HD Blu-rays and DVDs! Or rip iTunes movies and music! Download free trial !
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Hello,

    since Handbrake will crash randomly i try to convert my videos with ffmpeg. I tried to convert my Handbrake Preset to ffmpeg. With a little help from google it looks like this:

    Code:
    ffmpeg -hide_banner \
    -i "test.mkv" \
    -map_metadata 0 \
    -map_chapters 0 \
    -metadata title="TITLE" \
    -map 0:0 -metadata:s:v:0 language=eng \
    -map 0:1 -metadata:s:a:0 language=eng -metadata:s:a:0 \
    -map 0:2 -metadata:s:s:0 language=eng -metadata:s:s:0 \
    -c:v libx265 -preset slow -x265-params \
    crf=21:wpp:ctu=64:min-cu-size=8:max-tu-size=32:tu-intra-depth=1:tu-inter-depth=1:me=1:subme=2:merange=57:no-rect:no-amp:max-merge=2:temporal-mvp:no-early-skip:rdpenalty=0:no-tskip:no-tskip-fast:strong-intra-smoothing:no-lossless:no-cu-lossless:no-constrained-intra:no-fast-intra:open-gop:no-temporal-layers:interlace=0:keyint=240:min-keyint=24:scenecut=40:rc-lookahead=20:lookahead-slices=6:bframes=4:bframe-bias=0:b-adapt=2:ref=3:limit-refs=3:no-limit-modes:weightp:no-weightb:aq-mode=1:qg-size=32:cbqpoffs=0:crqpoffs=0:rd=3:rdoq-level=0:signhide:deblock:sao:no-sao-non-deblock:b-pyramid:cutree:no-intra-refresh:qpstep=4 \
    -c:a copy \
    -c:s copy \
    "OUTPUT.mkv"
    So when i try this my terminal output looks like:
    Code:
    [NULL @ 0x556737178dc0] Unable to find a suitable output format for '0:2'
    0:2: Invalid argument
    I tried to delete the line "map 0:2....." then the error is:
    Code:
    Missing argument for option 'metadata:s:a:0'.
    Error splitting the argument list: Invalid argument
    ffmpeg: Line 9: -c:v: command not fount.
    Im using Manjaro Linux and ffmpeg 4.2.2. I just want to convert some videos. Perfectly with a script that will convert all files in the folder where i run the script.
    Can somebody help me pls?

    If it is usefull here is my Handbrake preset:
    Code:
    {
        "PresetList": [
            {
                "AlignAVStart": false,
                "AudioCopyMask": [
                    "copy:mp3",
                    "copy:aac",
                    "copy:ac3",
                    "copy:dts",
                    "copy:dtshd"
                ],
                "AudioEncoderFallback": "ac3",
                "AudioLanguageList": [
                    "und"
                ],
                "AudioList": [
                    {
                        "AudioBitrate": 192,
                        "AudioCompressionLevel": -1.0,
                        "AudioDitherMethod": "auto",
                        "AudioEncoder": "copy:ac3",
                        "AudioMixdown": "5point1",
                        "AudioNormalizeMixLevel": false,
                        "AudioSamplerate": "auto",
                        "AudioTrackDRCSlider": 0.0,
                        "AudioTrackGainSlider": -20.0,
                        "AudioTrackQuality": 0.0,
                        "AudioTrackQualityEnable": false
                    }
                ],
                "AudioSecondaryEncoderMode": true,
                "AudioTrackSelectionBehavior": "first",
                "ChapterMarkers": true,
                "ChildrenArray": [],
                "Default": false,
                "FileFormat": "av_mkv",
                "Folder": false,
                "FolderOpen": false,
                "InlineParameterSets": false,
                "Mp4HttpOptimize": false,
                "Mp4iPodCompatible": false,
                "PictureAutoCrop": true,
                "PictureBottomCrop": 0,
                "PictureCombDetectCustom": "",
                "PictureCombDetectPreset": "off",
                "PictureDARWidth": 0,
                "PictureDeblock": 0,
                "PictureDeblockCustom": "qp=0:mode=2",
                "PictureDeinterlaceCustom": "",
                "PictureDeinterlaceFilter": "off",
                "PictureDeinterlacePreset": "",
                "PictureDenoiseCustom": "",
                "PictureDenoiseFilter": "off",
                "PictureDenoisePreset": "",
                "PictureDenoiseTune": "none",
                "PictureDetelecine": "off",
                "PictureDetelecineCustom": "",
                "PictureForceHeight": 0,
                "PictureForceWidth": 0,
                "PictureHeight": 720,
                "PictureItuPAR": false,
                "PictureKeepRatio": true,
                "PictureLeftCrop": 0,
                "PictureLooseCrop": false,
                "PictureModulus": 2,
                "PicturePAR": "loose",
                "PicturePARHeight": 1,
                "PicturePARWidth": 1,
                "PictureRightCrop": 0,
                "PictureRotate": "disable=1",
                "PictureSharpenCustom": "",
                "PictureSharpenFilter": "off",
                "PictureSharpenPreset": "medium",
                "PictureSharpenTune": "none",
                "PictureTopCrop": 0,
                "PictureWidth": 1280,
                "PresetDescription": "HandBrake's normal, default settings.",
                "PresetName": "x265fun_ac3720p",
                "SubtitleAddCC": false,
                "SubtitleAddForeignAudioSearch": false,
                "SubtitleAddForeignAudioSubtitle": false,
                "SubtitleBurnBDSub": false,
                "SubtitleBurnBehavior": "none",
                "SubtitleBurnDVDSub": false,
                "SubtitleLanguageList": [
                    "deu"
                ],
                "SubtitleTrackSelectionBehavior": "all",
                "Type": 1,
                "UsesPictureFilters": true,
                "UsesPictureSettings": 1,
                "VideoAvgBitrate": 2500,
                "VideoColorMatrixCode": 0,
                "VideoEncoder": "x265",
                "VideoFramerate": "auto",
                "VideoFramerateMode": "vfr",
                "VideoGrayScale": false,
                "VideoLevel": "",
                "VideoOptionExtra": "wpp:ctu=64:min-cu-size=8:max-tu-size=32:tu-intra-depth=1:tu-inter-depth=1:me=1:subme=2:merange=57:no-rect:no-amp:max-merge=2:temporal-mvp:no-early-skip:rdpenalty=0:no-tskip:no-tskip-fast:strong-intra-smoothing:no-lossless:no-cu-lossless:no-constrained-intra:no-fast-intra:open-gop:no-temporal-layers:interlace=0:keyint=240:min-keyint=24:scenecut=40:rc-lookahead=20:lookahead-slices=6:bframes=4:bframe-bias=0:b-adapt=2:ref=3:limit-refs=3:no-limit-modes:weightp:no-weightb:aq-mode=1:qg-size=32:cbqpoffs=0:crqpoffs=0:rd=3:rdoq-level=0:signhide:deblock:sao:no-sao-non-deblock:b-pyramid:cutree:no-intra-refresh:qpstep=4",
                "VideoPreset": "slow",
                "VideoProfile": "main",
                "VideoQSVAsyncDepth": 4,
                "VideoQSVDecode": false,
                "VideoQualitySlider": 21.0,
                "VideoQualityType": 2,
                "VideoScaler": "swscale",
                "VideoTune": "",
                "VideoTurboTwoPass": false,
                "VideoTwoPass": false,
                "x264Option": "",
                "x264UseAdvancedOptions": false
            }
        ],
        "VersionMajor": 32,
        "VersionMicro": 0,
        "VersionMinor": 0
    }

    odin89
    Quote Quote  
  2. Why is there an extra "-metadata:s:a:0" and "-metadata:s:s:0" at the end of the map audio and sub lines? The command appears to work properly without those.
    Quote Quote  
  3. This is how i found it. Im new to ffmpeg
    But even if i remove them i get the error that the command -c:v is not found
    Quote Quote  
  4. Originally Posted by odin89 View Post
    But even if i remove them i get the error that the command -c:v is not found
    Be sure you didn't also remove the \ at the end the previous line. The \ means the command is continued on the next line. If you remove the \ the command line interpreter will assume the next line is a new command, not a continuation of the previous. This code works for me in Windows:

    Code:
     
    ffmpeg -y -hide_banner ^
      -i "test.mkv" ^
      -map_metadata 0 ^
      -map_chapters 0 ^
      -metadata title="TITLE" ^
      -map 0:0 -metadata:s:v:0 language=eng ^
      -map 0:1 -metadata:s:a:0 language=eng ^
      -map 0:2 -metadata:s:s:0 language=eng ^
      -c:v copy ^
      -c:a copy ^
      -c:s copy ^
      "OUTPUT.mkv"
    All i did was remove the extra "-metadata:s:a:0" and "-metadata:s:a:0" and change the \ to ^ (I'm using Windows, and Windows uses ^ instead of \ as the continuation character).
    Quote Quote  
  5. I don't pretend to be anything of an expert, but could that error message be related to the presence or absence of subtitles in the source video?

    From the ffmpeg trac:

    A trailing ?, such as -map 1:a?, will allow the map to be optional. If the map matches no streams the map will be ignored instead of failing. Note the mapping will still fail if an invalid input_file_index is used; such as if the map refers to an input that does not exist.

    https://trac.ffmpeg.org/wiki/Map
    Quote Quote  



Similar Threads