VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. ffprobe:
    Code:
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/dev/shm/video.m4v':
      Metadata:
        major_brand     : isom
        minor_version   : 0
        compatible_brands: mp41avc1
        creation_time   : 2026-10-11T19:58:55.000000Z
        encoder         : vlc 3.0.17.3 stream output
        encoder-eng     : vlc 3.0.17.3 stream output
      Duration: 00:01:17.70, start: 0.000000, bitrate: 2431 kb/s
      Stream #0:0[0x1](eng): Audio: mp3 (mp3float) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          creation_time   : 2026-10-11T19:58:55.000000Z
          handler_name    : SoundHandler
      Stream #0:1[0x2](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt2020c/bt2020/unknown, progressive), 1080x1920 [SAR 1:1 DAR 9:16], 2295 kb/s, 30.01 fps, 30 tbr, 1000k tbn, start 0.014978 (default)
        Metadata:
          creation_time   : 2026-10-11T19:58:55.000000Z
          handler_name    : VideoHandler
    my conversion command:
    Code:
    ffmpeg  -i "/dev/shm/video.m4v" -c:a libfdk_aac -vbr 2 -c:v libx264 -crf 28 -profile:v high -level 41 -vf scale=360:640,format=yuv420p -sn -sample_fmt s16 -ac 1 -threads 0 -map_metadata -1 -max_muxing_queue_size 9999 /dev/shm/lo.mp4
    Code:
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/dev/shm/video.m4v':
      Metadata:
        major_brand     : isom
        minor_version   : 0
        compatible_brands: mp41avc1
        creation_time   : 2026-10-11T19:58:55.000000Z
        encoder         : vlc 3.0.17.3 stream output
        encoder-eng     : vlc 3.0.17.3 stream output
      Duration: 00:01:17.70, start: 0.000000, bitrate: 2431 kb/s
      Stream #0:0[0x1](eng): Audio: mp3 (mp3float) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          creation_time   : 2026-10-11T19:58:55.000000Z
          handler_name    : SoundHandler
      Stream #0:1[0x2](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt2020c/bt2020/unknown, progressive), 1080x1920 [SAR 1:1 DAR 9:16], 2295 kb/s, 30.01 fps, 30 tbr, 1000k tbn, start 0.014978 (default)
        Metadata:
          creation_time   : 2026-10-11T19:58:55.000000Z
          handler_name    : VideoHandler
    File '/dev/shm/lo.mp4' already exists. Overwrite? [y/N] y
    Stream mapping:
      Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
      Stream #0:0 -> #0:1 (mp3 (mp3float) -> aac (libfdk_aac))
    Press [q] to stop, [?] for help
    [libfdk_aac @ 0x565093052200] Note, the VBR setting is unsupported and only works with some parameter combinations
    Impossible to convert between the formats supported by the filter 'graph -1 input from stream 0:1' and the filter 'auto_scale_0'
    Link 'graph -1 input from stream 0:1.default' -> 'auto_scale_0.default':
      Color spaces:
        src: bt2020c
        dst: unknown gbr bt709 fcc bt470bg smpte170m smpte240m bt2020nc
    Link 'auto_scale_0.default' -> 'Parsed_scale_0.default':
      Color spaces:
        src: unknown gbr bt709 fcc bt470bg smpte170m smpte240m bt2020nc
        dst: unknown gbr bt709 fcc bt470bg smpte170m smpte240m bt2020nc
    [vf#0:0 @ 0x565092eb9b00] Error reinitializing filters!
    [vf#0:0 @ 0x565092eb9b00] Task finished with error code: -38 (Function not implemented)
    [vf#0:0 @ 0x565092eb9b00] Terminating thread with return code -38 (Function not implemented)
    [vost#0:0/libx264 @ 0x565092ebb280] [enc:libx264 @ 0x565092da14c0] Could not open encoder before EOF
    [vost#0:0/libx264 @ 0x565092ebb280] Task finished with error code: -22 (Invalid argument)
    [vost#0:0/libx264 @ 0x565092ebb280] Terminating thread with return code -22 (Invalid argument)
    [out#0/mp4 @ 0x565092de4580] Nothing was written into output file, because at least one of its streams received no packets.
    mpv or firefox plays video fine.
    How to modify command to convert video?
    Thanks in advance
    Quote Quote  
  2. The source is tagged with the BT.2020 constant luminance matrix (bt2020c), which swscale cannot convert from, so format negotiation fails before scaling. Override the tag at the start of the filter chain with setparams:

    Code:
    ffmpeg -i "/dev/shm/video.m4v" -c:a libfdk_aac -vbr 2 -c:v libx264 -crf 28 -profile:v high -level 41 -vf setparams=colorspace=bt709:color_primaries=bt709:color_trc=bt709,scale=360:640,format=yuv420p -sn -sample_fmt s16 -ac 1 -threads 0 -map_metadata -1 -max_muxing_queue_size 9999 /dev/shm/lo.mp4
    The bt2020c tag with an unknown transfer is almost certainly bogus metadata (phone or VLC remux), and the content is most likely ordinary BT.709. If the colors come out slightly off compared to mpv, change colorspace=bt709 to colorspace=bt2020nc (and the primaries to bt2020) instead.

    Newer FFmpeg versions negotiate colorspace and range between filters, and each filter declares which matrices it accepts. swscale’s list (the “dst” list in your error) omits bt2020c, so negotiation finds no valid path and aborts. Older versions just ignored the tag and treated the input as some ordinary matrix.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!