VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hello all,

    I'm new to the forum and working with ffmpeg using windows machine so pls be gentle with me

    My goal is quite simple, I have two video file, one is a clip from a GoPro camera and the other is a video produced by Filmora (video editor), I've tried, without success, to join the two files into one, I got errors trying the Concatenation of files with different codecs, from what i understand the files are not sharing the same codecs/res/and such and should be encoded, following is the ffmpeg -i output for both files(intro.mp4, GOPR2263.MP4:

    Code:
    C:\ffmpeg-20170525-b946bd8-win64-static\bin>ffmpeg.exe -i intro.mp4
    ffmpeg version N-86265-gb946bd8 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 7.1.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
      libavutil      55. 63.100 / 55. 63.100
      libavcodec     57. 96.101 / 57. 96.101
      libavformat    57. 72.101 / 57. 72.101
      libavdevice    57.  7.100 / 57.  7.100
      libavfilter     6. 90.100 /  6. 90.100
      libswscale      4.  7.101 /  4.  7.101
      libswresample   2.  8.100 /  2.  8.100
      libpostproc    54.  6.100 / 54.  6.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'intro.mp4':
      Metadata:
        major_brand     : qt
        minor_version   : 512
        compatible_brands: qt
        encoder         : Lavf55.33.100
      Duration: 00:00:05.01, start: 0.000000, bitrate: 2476 kb/s
        Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2213 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
        Metadata:
          handler_name    : DataHandler
          encoder         : libx264
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 253 kb/s (default)
        Metadata:
          handler_name    : DataHandler
    At least one output file must be specified
    
    
    
    
    
    
    C:\ffmpeg-20170525-b946bd8-win64-static\bin>ffmpeg.exe -i GOPR2263.mp4
    ffmpeg version N-86265-gb946bd8 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 7.1.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
      libavutil      55. 63.100 / 55. 63.100
      libavcodec     57. 96.101 / 57. 96.101
      libavformat    57. 72.101 / 57. 72.101
      libavdevice    57.  7.100 / 57.  7.100
      libavfilter     6. 90.100 /  6. 90.100
      libswscale      4.  7.101 /  4.  7.101
      libswresample   2.  8.100 /  2.  8.100
      libpostproc    54.  6.100 / 54.  6.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0000000001ea24a0] Using non-standard frame rate 29/1
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GOPR2263.mp4':
      Metadata:
        major_brand     : mp41
        minor_version   : 538120216
        compatible_brands: mp41
        creation_time   : 2017-06-25T12:46:31.000000Z
        firmware        : HD4.02.05.00.00
      Duration: 00:00:09.98, start: 0.000000, bitrate: 2087 kb/s
        Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 848x480 [SAR 1:1 DAR 53:30], 1954 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
        Metadata:
          creation_time   : 2017-06-25T12:46:31.000000Z
          handler_name    :         GoPro AVC
          encoder         : GoPro AVC encoder
          timecode        : 13:12:09:24
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          creation_time   : 2017-06-25T12:46:31.000000Z
          handler_name    :         GoPro AAC
          timecode        : 13:12:09:24
        Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
        Metadata:
          creation_time   : 2017-06-25T12:46:31.000000Z
          handler_name    :         GoPro TCD
          timecode        : 13:12:09:24
    At least one output file must be specified

    Can anyone please help me figured out the correct commands to join those two files?

    Many thanks in advance!!
    Best to all,
    RS
    Quote Quote  
  2. Try something like:
    ffmpeg -y -i "intro.mp4" -i "GOPR2263.mp4" -filter_complex "[1:v]scale=1280:720[s];[0:v] [0:a] [s] [1:a] concat=n=2:v=1:a=1 [vid] [aud]" -map "[vid]" -map "[aud]" "output.mp4"
    Quote Quote  
  3. Originally Posted by sneaker View Post
    Try something like:
    ffmpeg -y -i "intro.mp4" -i "GOPR2263.mp4" -filter_complex "[1:v]scale=1280:720[s];[0:v] [0:a] [s] [1:a] concat=n=2:v=1:a=1 [vid] [aud]" -map "[vid]" -map "[aud]" "output.mp4"
    Hi sneaker, thank you very much for your reply!

    I've tried your suggestion but still no joy, I get the error "Conversion failed!":

    Code:
    C:\ffmpeg-20170525-b946bd8-win64-static\bin>ffmpeg -y -i "intro.mp4" -i "GOPR2263.mp4" -filter_complex "[1:v]scale=1280:720[s];[0:v] [0:a] [s] [1:a] concat=n=2:v=1:a=1 [vid] [aud]" -map "[vid]" -map "[aud]" "output.mp4"
    ffmpeg version N-86265-gb946bd8 Copyright (c) 2000-2017 the FFmpeg developers
      built with gcc 7.1.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
      libavutil      55. 63.100 / 55. 63.100
      libavcodec     57. 96.101 / 57. 96.101
      libavformat    57. 72.101 / 57. 72.101
      libavdevice    57.  7.100 / 57.  7.100
      libavfilter     6. 90.100 /  6. 90.100
      libswscale      4.  7.101 /  4.  7.101
      libswresample   2.  8.100 /  2.  8.100
      libpostproc    54.  6.100 / 54.  6.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'intro.mp4':
      Metadata:
        major_brand     : qt
        minor_version   : 512
        compatible_brands: qt
        encoder         : Lavf55.33.100
      Duration: 00:00:05.01, start: 0.000000, bitrate: 2476 kb/s
        Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2213 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
        Metadata:
          handler_name    : DataHandler
          encoder         : libx264
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 253 kb/s (default)
        Metadata:
          handler_name    : DataHandler
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000858c80] Using non-standard frame rate 29/1
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'GOPR2263.mp4':
      Metadata:
        major_brand     : mp41
        minor_version   : 538120216
        compatible_brands: mp41
        creation_time   : 2017-06-25T12:46:31.000000Z
        firmware        : HD4.02.05.00.00
      Duration: 00:00:09.98, start: 0.000000, bitrate: 2087 kb/s
        Stream #1:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 848x480 [SAR 1:1 DAR 53:30], 1954 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
        Metadata:
          creation_time   : 2017-06-25T12:46:31.000000Z
          handler_name    :         GoPro AVC
          encoder         : GoPro AVC encoder
          timecode        : 13:12:09:24
        Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
        Metadata:
          creation_time   : 2017-06-25T12:46:31.000000Z
          handler_name    :         GoPro AAC
          timecode        : 13:12:09:24
        Stream #1:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
        Metadata:
          creation_time   : 2017-06-25T12:46:31.000000Z
          handler_name    :         GoPro TCD
          timecode        : 13:12:09:24
    Stream mapping:
      Stream #0:0 (h264) -> concat:in0:v0
      Stream #0:1 (aac) -> concat:in0:a0
      Stream #1:0 (h264) -> scale
      Stream #1:1 (aac) -> concat:in1:a0
      concat:out:v0 -> Stream #0:0 (libx264)
      concat:out:a0 -> Stream #0:1 (aac)
    Press [q] to stop, [?] for help
    [swscaler @ 00000000083d8ba0] deprecated pixel format used, make sure you did set range correctly
    [Parsed_concat_1 @ 0000000008313de0] Input link in1:v0 parameters (size 1280x720, SAR 159:160) do not match the corresponding output link in0:v0 parameters (1280x720, SAR 1:1)
    [Parsed_concat_1 @ 0000000008313de0] Failed to configure output pad on Parsed_concat_1
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!
    your thoughts?
    Quote Quote  
  4. First file is limited range, second file is full range. I overlooked that.
    Try:
    ffmpeg -y -i "intro.mp4" -i "GOPR2263.mp4" -filter_complex "[1:v]scale=1280:720:in_range=full:out_range=tv[s];[0:v] [0:a] [s] [1:a] concat=n=2:v=1:a=1 [vid] [aud]" -map "[vid]" -map "[aud]" "output.mp4"

    or if AR is different:
    ffmpeg -y -i "intro.mp4" -i "GOPR2263.mp4" -filter_complex "[1:v]scale=1280:720:in_range=full:out_range=tv[s];[s]setsar=1:1[so];[0:v] [0:a] [so] [1:a] concat=n=2:v=1:a=1 [vid] [aud]" -map "[vid]" -map "[aud]" "output.mp4"
    Quote Quote  


  5. YAY!!!!! the second option did the trick!!!

    MANY MANY THANKS!!
    Quote Quote  



Similar Threads

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