Answers.Body: <p>Found one <a href="https://github.com/suntong/ffcvt/wiki/Tips:-To-concatenate-videos" rel="nofollow noreferrer">answer here</a>:</p>
  <p>Here is the exception:</p>
  <ul>
  <li><p>To concatenate 2-part videos into one, without re-encoding:</p>
  <p><code>ffmpeg -safe 0 -f concat -i &lt;(find . -type f -name '*.mp4' -printf &quot;file '$PWD/%p'\n&quot; | sort) -c copy output.mkv</code></p>
  <p>or,</p>
  <p><code>ffmpeg -i &quot;concat:File1.mp4|File2.mp4&quot; -c:v copy -c:a copy -codec copy .output.mp4</code></p>
  </li>
  <li><p>To concatenate 2-part videos into one, with encoding:</p>
  <p><code>ffmpeg -i 01.mp4 -i 02.mp4 -filter_complex &quot;[0:v] [0:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]&quot; -map &quot;[v]&quot; -map &quot;[a]&quot; -c:v libvpx-vp9 -b:v 0 -crf 43.8 -c:a libopus -b:a 64k -c:s copy out.mkv</code></p>
  </li>
  </ul>
  <p>Refer to the original url for updates.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-23T13:59:45.610Z
Answers.LastActivityDate: 2022-10-23T13:59:45.610Z
Answers.UserDisplayName: xpt
Answers.Body: <p>You should put -i in.mkv  for the first place.
  Please try</p>
  <pre><code>ffmpeg -i in.mkv -ss 1:00 -t 5 -ss 2:00 -t 5 
  </code></pre>
  <p>I think your code have multiple &quot;-i in.mkv&quot; parts.
  Remove all but one &quot;-i</p>
  <p>Edit:
  Then I think the easiest way is :</p>
  <pre><code>ffmpeg -i in.mkv -ss 1:00 -t 5 -c copy clip1.mkv
  ffmpeg -i in.mkv -ss 2:00 -t 5 -c copy clip2.mkv
  echo file clip1.mkv &gt;&gt; mylist.txt
  echo file clip2.mkv &gt;&gt; mylist.txt
  ffmpeg -f concat -i mylist.txt -c copy out.mkv
  rm mylist.txt
  </code></pre>
  <p>Just make two clips from the original video &quot;in.mkv&quot; and just concat them in the usual ffmpeg concat way.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-13T21:17:44.750Z
Answers.Text: Thanks for the input, Tom. Please note the phrase _"when concatenating clips"_ in the title -- the multiple "-i in.mkv" parts is just for that, as I tried yours but only single clip is cut, not both. Try it yourself, and you'll know. Thanks for the input anyway, and welcome aboard.
Answers.UserDisplayName: xpt
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-10-13T08:33:06.030Z
Answers.LastActivityDate: 2021-10-15T11:31:33.307Z
Answers.LastEditDate: 2021-10-15T11:31:33.307Z
Answers.UserDisplayName: yeachan park
Body: <p>Basically I was following <a href="https://video.stackexchange.com/a/15701/26767">https://video.stackexchange.com/a/15701/26767</a>, which states:</p>
  <blockquote>
  <p>This should work faster...</p>
  <pre class="lang-bash prettyprint-override"><code>ffmpeg -ss 1:00 -t 5 -i in.mkv -ss 2:00 -t 5 -i in.mkv \
   -filter_complex &quot;[0][1]concat=n=2:v=1:a=1&quot; \ 
   out.mkv
  </code></pre>
  </blockquote>
  <p>Is it really working? Or how can I make it works for nowadays <code>ffmpeg</code>?</p>
  <p>First, I found the command there is incorrect, as I'm getting this:</p>
  <pre><code>$ ffmpeg -codec copy -i inp.mp4 clip1.mp4
  ffmpeg version 4.2.2-1ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 9 (Ubuntu 9.3.0-3ubuntu1)
    configuration: --prefix=/usr --extra-version=1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
    libavutil      56. 31.100 / 56. 31.100
    libavcodec     58. 54.100 / 58. 54.100
    libavformat    58. 29.100 / 58. 29.100
    libavdevice    58.  8.100 / 58.  8.100
    libavfilter     7. 57.100 /  7. 57.100
    libavresample   4.  0.  0 /  4.  0.  0
    libswscale      5.  5.100 /  5.  5.100
    libswresample   3.  5.100 /  3.  5.100
    libpostproc    55.  5.100 / 55.  5.100
  Unknown decoder 'copy'
  </code></pre>
  <p>I found this works: <code>ffmpeg -i inp.mp4 -codec copy clip1.mp4</code></p>
  <p>Then when I want to put things together, I got <code>Unknown decoder 'copy'</code> again:</p>
  <pre><code>$ ffmpeg -i inp.mp4 -ss 1:09 -t 76 -codec copy -i inp.mp4 -ss 2:55 -codec copy -filter_complex &quot;[0][1]concat=n=2:v=1:a=1&quot; out.mp4
  ffmpeg version 4.2.2-1ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 9 (Ubuntu 9.3.0-3ubuntu1)
  . . .
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'inp.mp4':
    Metadata:
      major_brand     : mp42
      minor_version   : 0
      compatible_brands: isommp42
      creation_time   : 2018-03-08T18:56:55.000000Z
    Duration: 00:03:46.81, start: 0.000000, bitrate: 3137 kb/s
      Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2943 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
      Metadata:
        handler_name    : VideoHandler
      Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s (default)
      Metadata:
        creation_time   : 2018-03-08T18:57:03.000000Z
        handler_name    : IsoMedia File Produced by Google, 5-11-2011
  Unknown decoder 'copy'
  </code></pre>
  <p>How can I make the 5-year-old answer works for nowadays <code>ffmpeg</code> without re-encoding?</p>
  
Tags: <ffmpeg><codec>
Title: ffmpeg: Unknown decoder 'copy' when concatenating clips
UserDisplayName: xpt
ThreadText: # ffmpeg: Unknown decoder 'copy' when concatenating clips
  
  (Asked by: username_0 on 2020-11-22)
  
  Basically I was following <https://video.stackexchange.com/a/15701/26767>, which states:
  
  > This should work faster...
  >
  > ```bash
  > ffmpeg -ss 1:00 -t 5 -i in.mkv -ss 2:00 -t 5 -i in.mkv \
  >  -filter_complex "[0][1]concat=n=2:v=1:a=1" \ 
  >  out.mkv
  >
  > ```
  
  Is it really working? Or how can I make it works for nowadays `ffmpeg`?
  
  First, I found the command there is incorrect, as I'm getting this:
  
  ```
  $ ffmpeg -codec copy -i inp.mp4 clip1.mp4
  ffmpeg version 4.2.2-1ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 9 (Ubuntu 9.3.0-3ubuntu1)
    configuration: --prefix=/usr --extra-version=1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
    libavutil      56. 31.100 / 56. 31.100
    libavcodec     58. 54.100 / 58. 54.100
    libavformat    58. 29.100 / 58. 29.100
    libavdevice    58.  8.100 / 58.  8.100
    libavfilter     7. 57.100 /  7. 57.100
    libavresample   4.  0.  0 /  4.  0.  0
    libswscale      5.  5.100 /  5.  5.100
    libswresample   3.  5.100 /  3.  5.100
    libpostproc    55.  5.100 / 55.  5.100
  Unknown decoder 'copy'
  
  ```
  
  I found this works: `ffmpeg -i inp.mp4 -codec copy clip1.mp4`
  
  Then when I want to put things together, I got `Unknown decoder 'copy'` again:
  
  ```
  $ ffmpeg -i inp.mp4 -ss 1:09 -t 76 -codec copy -i inp.mp4 -ss 2:55 -codec copy -filter_complex "[0][1]concat=n=2:v=1:a=1" out.mp4
  ffmpeg version 4.2.2-1ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 9 (Ubuntu 9.3.0-3ubuntu1)
  . . .
  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'inp.mp4':
    Metadata:
      major_brand     : mp42
      minor_version   : 0
      compatible_brands: isommp42
      creation_time   : 2018-03-08T18:56:55.000000Z
    Duration: 00:03:46.81, start: 0.000000, bitrate: 3137 kb/s
      Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2943 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
      Metadata:
        handler_name    : VideoHandler
      Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s (default)
      Metadata:
        creation_time   : 2018-03-08T18:57:03.000000Z
        handler_name    : IsoMedia File Produced by Google, 5-11-2011
  Unknown decoder 'copy'
  
  ```
  
  How can I make the 5-year-old answer works for nowadays `ffmpeg` without re-encoding?
  
  **Tags:** ffmpeg, codec
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2022-10-23. Score: 0 | Accepted answer
  
  Found one [answer here](https://github.com/suntong/ffcvt/wiki/Tips:-To-concatenate-videos):
  
  Here is the exception:
  
  * To concatenate 2-part videos into one, without re-encoding:
  
    `ffmpeg -safe 0 -f concat -i <(find . -type f -name '*.mp4' -printf "file '$PWD/%p'\n" | sort) -c copy output.mkv`
  
    or,
  
    `ffmpeg -i "concat:File1.mp4|File2.mp4" -c:v copy -c:a copy -codec copy .output.mp4`
  * To concatenate 2-part videos into one, with encoding:
  
    `ffmpeg -i 01.mp4 -i 02.mp4 -filter_complex "[0:v] [0:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" -c:v libvpx-vp9 -b:v 0 -crf 43.8 -c:a libopus -b:a 64k -c:s copy out.mkv`
  
  Refer to the original url for updates.
  
  
  ---
  
  ### Answer by username_1 on 2021-10-13. Score: 1
  
  You should put -i in.mkv for the first place.
  Please try
  
  ```
  ffmpeg -i in.mkv -ss 1:00 -t 5 -ss 2:00 -t 5 
  
  ```
  
  I think your code have multiple "-i in.mkv" parts.
  Remove all but one "-i
  
  Edit:
  Then I think the easiest way is :
  
  ```
  ffmpeg -i in.mkv -ss 1:00 -t 5 -c copy clip1.mkv
  ffmpeg -i in.mkv -ss 2:00 -t 5 -c copy clip2.mkv
  echo file clip1.mkv >> mylist.txt
  echo file clip2.mkv >> mylist.txt
  ffmpeg -f concat -i mylist.txt -c copy out.mkv
  rm mylist.txt
  
  ```
  
  Just make two clips from the original video "in.mkv" and just concat them in the usual ffmpeg concat way.
  
  > **Comments:**
  > **username_0**: Thanks for the input, Tom. Please note the phrase _"when concatenating clips"_ in the title -- the multiple "-i in.mkv" parts is just for that, as I tried yours but only single clip is cut, not both. Try it yourself, and you'll know. Thanks for the input anyway, and welcome aboard.  
  
  ---
  
  