Forum Replies Created

  • Thank you Lou Logan! It works 🙂

  • Thomas Demirian

    August 20, 2014 at 11:20 am in reply to: FFMPEG: Add black frames at start and end of video

    Hello. Im back again with a working command. But now I have to mix these two together so that its 10 seconds of text at the start. Then the video. And lastly 30 seconds of black.

    ffmpeg -i Input.mov -f lavfi -i "color=c=black:s=720x576:r=25:sar=1050/720" -filter_complex \
    "[0:v] setpts=PTS-STARTPTS [main]; \
    [1:v] trim=end=10,setpts=PTS-STARTPTS [pre]; \
    [1:v] trim=end=30,setpts=PTS-STARTPTS [post]; \
    [pre][main][post] concat=n=3:v=1:a=0 [out]" \
    -map "[out]" -vcodec mpeg2video -maxrate 30000k -b:v 30000k Output.mpg

    This works by it self.

    ffmpeg -f lavfi -i color=c=blue:s=1280x720:d=0.5 -vf \
    "drawtext=fontfile=/Library/Fonts/Georgia.ttf:text='Text to write':fontsize=30: \
    fontcolor=white:x=(w-text_w)/2:y=(h-text_h-line_h)/2:" \
    text1.mp4

    And this one works by itself. Now how can I combine them?

  • My source file is 20 seconds. The exported video according to MEDIA INFO is: 20s87ms. The video is 20s40ms and the audio is 20s87ms.

    And when I open the file in Any adobe application it also shows one frame more. And its placed in the beginning. A duplicate of the first frame.

    ffmpeg command

    ffmpeg -y -i x.mp4 -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -pass 1 -an -f rawvideo /dev/null && \
    ffmpeg -y -i x.mp4 -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -acodec libvo_aacenc -ar 48000 -b:a 128000 -aprofile aac_low -ac 2 -f mp4 -preset slow -pass 2 \
    high1.mp4

    Console Output

    Last login: Tue Aug 12 14:50:49 on ttys000
    Thomas-MacBook-Pro:~ Thomas$ cd /Users/Thomas/Desktop/Redmine_and_Others/2001_Proxy_for_ecexpress/Download
    Thomas-MacBook-Pro:Download Thomas$ ffmpeg -y -i x.mp4 -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -pass 1 -an -f rawvideo /dev/null && \
    > ffmpeg -y -i x.mp4 -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -acodec libvo_aacenc -ar 48000 -b:a 128000 -aprofile aac_low -ac 2 -f mp4 -preset slow -pass 2 \
    > high1.mp4
    ffmpeg version 2.2.4-tessus Copyright (c) 2000-2014 the FFmpeg developers
    built on Jun 29 2014 16:35:46 with clang version 3.3 (tags/RELEASE_33/final)
    configuration: --cc=/opt/local/bin/clang-mp-3.3 --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --enable-runtime-cpudetect
    libavutil 52. 66.100 / 52. 66.100
    libavcodec 55. 52.102 / 55. 52.102
    libavformat 55. 33.100 / 55. 33.100
    libavdevice 55. 10.100 / 55. 10.100
    libavfilter 4. 2.100 / 4. 2.100
    libswscale 2. 5.102 / 2. 5.102
    libswresample 0. 18.100 / 0. 18.100
    libpostproc 52. 3.100 / 52. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'x.mp4':
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42mp41
    creation_time : 2014-05-13 19:22:28
    Duration: 00:00:20.05, start: 0.000000, bitrate: 47586 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 47387 kb/s, 25 fps, 25 tbr, 50k tbn, 50 tbc (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    [libx264 @ 0x103000600] using SAR=1/1
    [libx264 @ 0x103000600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x103000600] profile Constrained Baseline, level 3.1
    Output #0, rawvideo, to '/dev/null':
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42mp41
    encoder : Lavf55.33.100
    Stream #0:0(eng): Video: h264 (libx264), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], q=-1--1, pass 1, 2500 kb/s, 90k tbn, 25 tbc (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 -> libx264)
    Press [q] to stop, [?] for help
    frame= 501 fps= 65 q=-1.0 Lsize= 6200kB time=00:00:20.04 bitrate=2534.3kbits/s dup=1 drop=0
    video:6200kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000000%
    [libx264 @ 0x103000600] frame I:12 Avg QP:14.41 size: 64532
    [libx264 @ 0x103000600] frame P:489 Avg QP:16.86 size: 11399
    [libx264 @ 0x103000600] mb I I16..4: 38.1% 0.0% 61.9%
    [libx264 @ 0x103000600] mb P I16..4: 16.4% 0.0% 0.0% P16..4: 60.9% 0.0% 0.0% 0.0% 0.0% skip:22.8%
    [libx264 @ 0x103000600] coded y,uvDC,uvAC intra: 30.5% 60.4% 37.1% inter: 25.9% 27.1% 0.9%
    [libx264 @ 0x103000600] i16 v,h,dc,p: 68% 13% 14% 5%
    [libx264 @ 0x103000600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 14% 14% 9% 8% 10% 6% 10% 6%
    [libx264 @ 0x103000600] i8c dc,h,v,p: 61% 15% 20% 4%
    [libx264 @ 0x103000600] kb/s:2534.32
    ffmpeg version 2.2.4-tessus Copyright (c) 2000-2014 the FFmpeg developers
    built on Jun 29 2014 16:35:46 with clang version 3.3 (tags/RELEASE_33/final)
    configuration: --cc=/opt/local/bin/clang-mp-3.3 --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --enable-runtime-cpudetect
    libavutil 52. 66.100 / 52. 66.100
    libavcodec 55. 52.102 / 55. 52.102
    libavformat 55. 33.100 / 55. 33.100
    libavdevice 55. 10.100 / 55. 10.100
    libavfilter 4. 2.100 / 4. 2.100
    libswscale 2. 5.102 / 2. 5.102
    libswresample 0. 18.100 / 0. 18.100
    libpostproc 52. 3.100 / 52. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'x.mp4':
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42mp41
    creation_time : 2014-05-13 19:22:28
    Duration: 00:00:20.05, start: 0.000000, bitrate: 47586 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 47387 kb/s, 25 fps, 25 tbr, 50k tbn, 50 tbc (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    [libx264 @ 0x103094600] using SAR=1/1
    [libx264 @ 0x103094600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x103094600] profile Constrained Baseline, level 3.1
    [libx264 @ 0x103094600] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - https://www.videolan.org/x264.html - options: cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=100 keyint_min=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=2pass mbtree=1 bitrate=2500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 cplxblur=20.0 qblur=0.5 vbv_maxrate=3000 vbv_bufsize=2500 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'high1.mp4':
    Metadata:
    major_brand : mp42
    minor_version : 0
    compatible_brands: mp42mp41
    encoder : Lavf55.33.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], q=-1--1, pass 2, 2500 kb/s, 12800 tbn, 25 tbc (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
    Metadata:
    creation_time : 2014-05-13 19:22:28
    handler_name : Alias Data Handler
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 -> libx264)
    Stream #0:1 -> #0:1 (aac -> libvo_aacenc)
    Press [q] to stop, [?] for help
    [mp4 @ 0x103094000] Starting second pass: moving the moov atom to the beginning of the file0
    frame= 501 fps= 21 q=-1.0 Lsize= 6437kB time=00:00:20.06 bitrate=2628.2kbits/s dup=1 drop=0
    video:6110kB audio:314kB subtitle:0 data:0 global headers:0kB muxing overhead 0.191460%
    [libx264 @ 0x103094600] frame I:12 Avg QP:14.50 size: 70089
    [libx264 @ 0x103094600] frame P:489 Avg QP:17.35 size: 11073
    [libx264 @ 0x103094600] mb I I16..4: 23.5% 0.0% 76.5%
    [libx264 @ 0x103094600] mb P I16..4: 1.1% 0.0% 0.4% P16..4: 52.7% 19.7% 8.9% 0.0% 0.0% skip:17.2%
    [libx264 @ 0x103094600] coded y,uvDC,uvAC intra: 66.7% 86.1% 73.9% inter: 19.0% 38.2% 2.4%
    [libx264 @ 0x103094600] i16 v,h,dc,p: 64% 11% 9% 16%
    [libx264 @ 0x103094600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 5% 7% 14% 16% 16% 11% 14% 8%
    [libx264 @ 0x103094600] i8c dc,h,v,p: 56% 15% 19% 10%
    [libx264 @ 0x103094600] ref P L0: 59.0% 18.7% 12.3% 5.3% 4.7%
    [libx264 @ 0x103094600] kb/s:2497.35
    Thomas-MacBook-Pro:Download Thomas$

  • Thomas Demirian

    August 12, 2014 at 12:48 pm in reply to: “libvo_aacenc” creates longer sound

    It makes the audio longer than the video. The Video exports as 20 seconds and the Audio as 20.38. Both should be 20. If I export with wav or mp3 sound the sound length is correct.

    My ffmpeg 2pass command:
    ffmpeg -y -i x_sd.mov -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -pass 1 -an -f rawvideo /dev/null && \
    ffmpeg -y -i x_sd.mov -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -acodec libvo_aacenc -ar 48000 -b:a 128000 -aprofile aac_low -ac 2 -f mp4 -preset slow -pass 2 \
    high1.mp4

    The Console output:

    Last login: Tue Aug 12 14:40:11 on ttys000
    Thomas-MacBook-Pro:~ Thomas$ cd /Users/Thomas/Desktop/Redmine_and_Others/2001_Proxy_for_ecexpress/Download
    Thomas-MacBook-Pro:Download Thomas$ ffmpeg -y -i x_sd.mov -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -pass 1 -an -f rawvideo /dev/null && \
    > ffmpeg -y -i x_sd.mov -pix_fmt yuv420p -direct-pred auto -aspect 16:9 -s 1024x576 -vcodec libx264 -bufsize 2500k -b:v 2500k -vmaxrate 3000k -vminrate 200k -vprofile baseline -level 3.1 -g 100 -bf 3 -x264opts b-pyramid=0 -coder 0 -movflags faststart -acodec libvo_aacenc -ar 48000 -b:a 128000 -aprofile aac_low -ac 2 -f mp4 -preset slow -pass 2 \
    > high1.mp4
    ffmpeg version 2.2.4-tessus Copyright (c) 2000-2014 the FFmpeg developers
    built on Jun 29 2014 16:35:46 with clang version 3.3 (tags/RELEASE_33/final)
    configuration: --cc=/opt/local/bin/clang-mp-3.3 --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --enable-runtime-cpudetect
    libavutil 52. 66.100 / 52. 66.100
    libavcodec 55. 52.102 / 55. 52.102
    libavformat 55. 33.100 / 55. 33.100
    libavdevice 55. 10.100 / 55. 10.100
    libavfilter 4. 2.100 / 4. 2.100
    libswscale 2. 5.102 / 2. 5.102
    libswresample 0. 18.100 / 0. 18.100
    libpostproc 52. 3.100 / 52. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'x_sd.mov':
    Metadata:
    major_brand : qt
    minor_version : 537199360
    compatible_brands: qt
    creation_time : 2014-08-04 15:21:15
    Duration: 00:00:20.00, start: 0.000000, bitrate: 237885 kb/s
    Stream #0:0(eng): Video: rawvideo (2vuy / 0x79757632), uyvy422, 1024x576, 235929 kb/s, SAR 1024:1024 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    [libx264 @ 0x102025400] using SAR=1/1
    [libx264 @ 0x102025400] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x102025400] profile Constrained Baseline, level 3.1
    Output #0, rawvideo, to '/dev/null':
    Metadata:
    major_brand : qt
    minor_version : 537199360
    compatible_brands: qt
    encoder : Lavf55.33.100
    Stream #0:0(eng): Video: h264 (libx264), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], q=-1--1, pass 1, 2500 kb/s, 90k tbn, 25 tbc (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    Stream mapping:
    Stream #0:0 -> #0:0 (rawvideo -> libx264)
    Press [q] to stop, [?] for help
    frame= 500 fps=206 q=-1.0 Lsize= 6190kB time=00:00:20.00 bitrate=2535.6kbits/s
    video:6190kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.000000%
    [libx264 @ 0x102025400] frame I:12 Avg QP:14.29 size: 62738
    [libx264 @ 0x102025400] frame P:488 Avg QP:16.61 size: 11447
    [libx264 @ 0x102025400] mb I I16..4: 37.7% 0.0% 62.3%
    [libx264 @ 0x102025400] mb P I16..4: 16.4% 0.0% 0.0% P16..4: 62.1% 0.0% 0.0% 0.0% 0.0% skip:21.5%
    [libx264 @ 0x102025400] coded y,uvDC,uvAC intra: 30.6% 61.8% 38.7% inter: 26.1% 28.1% 0.8%
    [libx264 @ 0x102025400] i16 v,h,dc,p: 67% 13% 15% 5%
    [libx264 @ 0x102025400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 14% 14% 8% 8% 10% 6% 10% 6%
    [libx264 @ 0x102025400] i8c dc,h,v,p: 59% 15% 22% 5%
    [libx264 @ 0x102025400] kb/s:2535.62
    ffmpeg version 2.2.4-tessus Copyright (c) 2000-2014 the FFmpeg developers
    built on Jun 29 2014 16:35:46 with clang version 3.3 (tags/RELEASE_33/final)
    configuration: --cc=/opt/local/bin/clang-mp-3.3 --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --disable-indev=qtkit --enable-runtime-cpudetect
    libavutil 52. 66.100 / 52. 66.100
    libavcodec 55. 52.102 / 55. 52.102
    libavformat 55. 33.100 / 55. 33.100
    libavdevice 55. 10.100 / 55. 10.100
    libavfilter 4. 2.100 / 4. 2.100
    libswscale 2. 5.102 / 2. 5.102
    libswresample 0. 18.100 / 0. 18.100
    libpostproc 52. 3.100 / 52. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'x_sd.mov':
    Metadata:
    major_brand : qt
    minor_version : 537199360
    compatible_brands: qt
    creation_time : 2014-08-04 15:21:15
    Duration: 00:00:20.00, start: 0.000000, bitrate: 237885 kb/s
    Stream #0:0(eng): Video: rawvideo (2vuy / 0x79757632), uyvy422, 1024x576, 235929 kb/s, SAR 1024:1024 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    [libx264 @ 0x103004e00] using SAR=1/1
    [libx264 @ 0x103004e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
    [libx264 @ 0x103004e00] profile Constrained Baseline, level 3.1
    [libx264 @ 0x103004e00] 264 - core 142 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - https://www.videolan.org/x264.html - options: cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=100 keyint_min=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=2pass mbtree=1 bitrate=2500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 cplxblur=20.0 qblur=0.5 vbv_maxrate=3000 vbv_bufsize=2500 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'high1.mp4':
    Metadata:
    major_brand : qt
    minor_version : 537199360
    compatible_brands: qt
    encoder : Lavf55.33.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], q=-1--1, pass 2, 2500 kb/s, 12800 tbn, 25 tbc (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    Stream #0:1(eng): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s (default)
    Metadata:
    creation_time : 2014-08-04 15:21:15
    handler_name : Apple Alias Data Handler
    timecode : 00:08:31:02
    Stream mapping:
    Stream #0:0 -> #0:0 (rawvideo -> libx264)
    Stream #0:1 -> #0:1 (pcm_s16le -> libvo_aacenc)
    Press [q] to stop, [?] for help
    [mp4 @ 0x103004800] Starting second pass: moving the moov atom to the beginning of the file
    frame= 500 fps= 27 q=-1.0 Lsize= 6414kB time=00:00:20.00 bitrate=2627.2kbits/s
    video:6088kB audio:313kB subtitle:0 data:0 global headers:0kB muxing overhead 0.191578%
    [libx264 @ 0x103004e00] frame I:12 Avg QP:14.34 size: 67781
    [libx264 @ 0x103004e00] frame P:488 Avg QP:17.10 size: 11107
    [libx264 @ 0x103004e00] mb I I16..4: 23.7% 0.0% 76.3%
    [libx264 @ 0x103004e00] mb P I16..4: 1.1% 0.0% 0.4% P16..4: 52.4% 20.5% 9.0% 0.0% 0.0% skip:16.6%
    [libx264 @ 0x103004e00] coded y,uvDC,uvAC intra: 66.9% 86.5% 74.6% inter: 19.1% 37.8% 2.2%
    [libx264 @ 0x103004e00] i16 v,h,dc,p: 64% 12% 9% 16%
    [libx264 @ 0x103004e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 5% 7% 14% 16% 16% 11% 14% 8%
    [libx264 @ 0x103004e00] i8c dc,h,v,p: 55% 15% 20% 10%
    [libx264 @ 0x103004e00] ref P L0: 58.8% 18.6% 12.4% 5.4% 4.8%
    [libx264 @ 0x103004e00] kb/s:2493.51
    [libvo_aacenc @ 0x103015c00] 1 frames left in the queue on closing
    Thomas-MacBook-Pro:Download Thomas$

  • I have looked at your example and it makes sense. But I cant get it to work.

    [Parsed_color_0 @ 0x103c00000] Option 'setsar' not found
    [lavfi @ 0x103004800] Error initializing filter 'color' with args 'c=black:s=1920x1080:r=25:setsar=1/1'
    color=c=black:s=1920x1080:r=25:setsar=1/1: Option not found
    Conversion failed!

    Im trying to make a universal “code” that will add black no matter what Sar or Dar is inputted. Its very strange that it cant generate black at start and end on all materials whiteout knowing its SAR/DAR. It should be able to read it from the file and just create black with the same properties.

    Isn’t there a way whiteout “Concat” so no muxing is taking place. Just pure and simply generate black at start and end for the encoded outfile? In other words, add the black in the transcoding to a new file.

  • Last login: Sun Jun 15 21:10:12 on ttys000
    Thomas-MacBook-Pro:~ Thomas$ cd /Users/Thomas/Desktop/Redmine\ and\ Others/6676
    Thomas-MacBook-Pro:6676 Thomas$ ffmpeg -i filesquare.mov -vf "
    > color=c=black:s=720x576:d=10 [pre] ;
    > color=c=black:s=720x576:d=30 [post] ;
    > [pre] [in] [post] concat=n=3" -an -vcodec mpeg2video -minrate 30000k -maxrate 30000k -b 30000k xx.mpg
    ffmpeg version 2.2.3 Copyright (c) 2000-2014 the FFmpeg developers
    built on Jun 4 2014 15:38:57 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
    configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-fontconfig --enable-libfreetype --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --enable-vda --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
    libavutil 52. 66.100 / 52. 66.100
    libavcodec 55. 52.102 / 55. 52.102
    libavformat 55. 33.100 / 55. 33.100
    libavdevice 55. 10.100 / 55. 10.100
    libavfilter 4. 2.100 / 4. 2.100
    libavresample 1. 2. 0 / 1. 2. 0
    libswscale 2. 5.102 / 2. 5.102
    libswresample 0. 18.100 / 0. 18.100
    libpostproc 52. 3.100 / 52. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'filesquare.mov':
    Metadata:
    major_brand : qt
    minor_version : 537199360
    compatible_brands: qt
    creation_time : 2014-06-09 15:24:21
    Duration: 00:00:10.00, start: 0.000000, bitrate: 31619 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 788x576, 30077 kb/s, SAR 1023:788 DAR 341:192, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
    Metadata:
    creation_time : 2014-06-09 15:24:21
    handler_name : Apple Alias Data Handler
    timecode : 00:00:40:16
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
    creation_time : 2014-06-09 15:24:21
    handler_name : Apple Alias Data Handler
    timecode : 00:00:40:16
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
    creation_time : 2014-06-09 15:24:33
    handler_name : Apple Alias Data Handler
    timecode : 00:00:40:16
    Please use -b:a or -b:v, -b is ambiguous
    [Parsed_concat_2 @ 0x7f8061425040] Input link in1:v0 parameters (size 788x576, SAR 1023:788) do not match the corresponding output link in0:v0 parameters (720x576, SAR 1:1)
    [Parsed_concat_2 @ 0x7f8061425040] Failed to configure output pad on Parsed_concat_2
    Error opening filters!
    Conversion failed!
    Thomas-MacBook-Pro:6676 Thomas$

    Thats the whole console output. Is there maybe someway that the “unsafe” filter can be implemented to fix this?

  • Thanks but it does not work.

    This code:

    ffmpeg -aspect 16:9 -i Italy_169_5sec.mxf -vf "
    color=c=black:s=720x576:d=10 [pre] ;
    color=c=black:s=720x576:d=30 [post] ;
    [pre] [in] [post] concat=n=3" -an -vcodec mpeg2video -pix_fmt yuv422p -s 720v576 -aspect 16:9 -r 25 -minrate 30000k -maxrate 30000k -b 30000k output.mpg

    Gives me this error:

    Option aspect (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)) cannot be applied to input file Italy_169_5sec.mxf -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
    Error parsing options for input file Italy_169_5sec.mxf.
    Error opening input files: Invalid argument

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy