Advertisement
Guest User

Untitled

a guest
May 31st, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.22 KB | None | 0 0
  1. ffmpeg -ss 00:01:00 -noaccurate_seek -i $1 -t 2 -c copy cut1.mp4
  2. ffmpeg -ss 00:02:00 -noaccurate_seek -i $1 -t 2 -c copy cut2.mp4
  3. ffmpeg -ss 00:03:00 -noaccurate_seek -i $1 -t 2 -c copy cut3.mp4
  4. ffmpeg -ss 00:04:00 -noaccurate_seek -i $1 -t 2 -c copy cut4.mp4
  5. ffmpeg -ss 00:05:00 -noaccurate_seek -i $1 -t 2 -c copy cut5.mp4
  6. ffmpeg -ss 00:06:00 -noaccurate_seek -i $1 -t 2 -c copy cut6.mp4
  7. ffmpeg -ss 00:07:00 -noaccurate_seek -i $1 -t 2 -c copy cut7.mp4
  8.  
  9. ffmpeg -i cut1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y intermediate1.ts
  10. ffmpeg -i cut2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y intermediate2.ts
  11. ffmpeg -i cut3.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y intermediate3.ts
  12. ffmpeg -i cut4.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y intermediate4.ts
  13. ffmpeg -i cut5.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y intermediate5.ts
  14. ffmpeg -i cut6.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y intermediate6.ts
  15. ffmpeg -i cut7.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts -y intermediate7.ts
  16.  
  17. ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts|intermediate5.ts|intermediate6.ts|intermediate7.ts" -c copy -bsf:a aac_adtstoasc -y $1.mp4
  18.  
  19. # cleanup
  20. rm -f cut*.mp4
  21. rm -f intermediate*.ts
  22.  
  23.  
  24. ###### FILE BELOW HAS CUTS > 2 SECONDS (TOTAL APPROX. 40 SECS)
  25.  
  26. processing# ffprobe yifod7jj.mp4
  27. ffprobe version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2007-2014 the FFmpeg developers
  28.   built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  29.   configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
  30.   libavutil      54.  7.100 / 54.  7.100
  31.   libavcodec     56.  1.100 / 56.  1.100
  32.   libavformat    56.  4.101 / 56.  4.101
  33.   libavdevice    56.  0.100 / 56.  0.100
  34.   libavfilter     5.  1.100 /  5.  1.100
  35.   libavresample   2.  1.  0 /  2.  1.  0
  36.   libswscale      3.  0.100 /  3.  0.100
  37.   libswresample   1.  1.100 /  1.  1.100
  38.   libpostproc    53.  0.100 / 53.  0.100
  39. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'yifod7jj.mp4':
  40.   Metadata:
  41.     major_brand     : isom
  42.     minor_version   : 512
  43.     compatible_brands: isomiso2avc1mp41
  44.     encoder         : Lavf54.29.104
  45.   Duration: 00:28:38.32, start: 0.000000, bitrate: 12402 kb/s
  46.     Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 12283 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc (default)
  47.     Metadata:
  48.       handler_name    : VideoHandler
  49.     Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 114 kb/s (default)
  50.     Metadata:
  51.       handler_name    : SoundHandler
  52.  
  53.  
  54.  
  55. ###### FILE BELOW HAS INTENDED OUTPUT (TOTAL 14 SECS, 2 SECS x 7 CUTS)
  56.  
  57.  
  58. processing# ffprobe
  59. 0kssnwxg/               3st6vxs8/               8fb55sbs/               am1ykiga/               cjqhsn6k/               clipmaker2.sh           output3.mp4             output6.mp4             yifod7jj.mp4            yo4cfhwb.mp4            
  60. 0kssnwxg.mp4            3st6vxs8.mp4            8fb55sbs.mp4            am1ykiga.mp4            cjqhsn6k.mp4            clippy.sh               output4.mp4             output7.mp4             yifod7jj.mp4.keyframes  yo4cfhwb.mp4.keyframes  
  61. 0kssnwxg.mp4.keyframes  3st6vxs8.mp4.keyframes  8fb55sbs.mp4.keyframes  am1ykiga.mp4.keyframes  cjqhsn6k.mp4.keyframes  concat.sh               output5.mp4             yifod7jj/               yo4cfhwb/              
  62. root@pornbot-nzb:/srv/pbot/processing# ffprobe cjqhsn6k.mp4
  63. ffprobe version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2007-2014 the FFmpeg developers
  64.   built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  65.   configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
  66.   libavutil      54.  7.100 / 54.  7.100
  67.   libavcodec     56.  1.100 / 56.  1.100
  68.   libavformat    56.  4.101 / 56.  4.101
  69.   libavdevice    56.  0.100 / 56.  0.100
  70.   libavfilter     5.  1.100 /  5.  1.100
  71.   libavresample   2.  1.  0 /  2.  1.  0
  72.   libswscale      3.  0.100 /  3.  0.100
  73.   libswresample   1.  1.100 /  1.  1.100
  74.   libpostproc    53.  0.100 / 53.  0.100
  75. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cjqhsn6k.mp4':
  76.   Metadata:
  77.     major_brand     : mp42
  78.     minor_version   : 0
  79.     compatible_brands: mp42isomavc1
  80.     creation_time   : 2015-05-26 13:11:13
  81.     compilation     : 0
  82.     encoder         : Sorenson Squeeze
  83.     comment         : Encoded by abc123inc
  84.   Duration: 00:13:50.46, start: 0.000000, bitrate: 6132 kb/s
  85.     Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
  86.     Metadata:
  87.       creation_time   : 2015-05-26 13:11:13
  88.       handler_name    : soun
  89.     Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 5998 kb/s, 30 fps, 30 tbr, 600 tbn, 60 tbc (default)
  90.     Metadata:
  91.       creation_time   : 2015-05-26 13:11:13
  92.       handler_name    : vide
  93.       encoder         : AVC Coding
  94.     Stream #0:2(und): Data: none (mp4s / 0x7334706D) (default)
  95.     Metadata:
  96.       creation_time   : 2015-05-26 13:32:41
  97.       handler_name    : sdsm
  98.     Stream #0:3(und): Data: none (mp4s / 0x7334706D) (default)
  99.     Metadata:
  100.       creation_time   : 2015-05-26 13:32:41
  101.       handler_name    : odsm
  102. Unsupported codec with id 0 for input stream 2
  103. Unsupported codec with id 0 for input stream 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement