[FFmpeg-user] cutting mts(h264+ac3) with least possible transcoding

Henning Thielemann lemming at henning-thielemann.de
Wed Jul 17 18:20:24 EEST 2019


I want to cut a video with optimally no recoding, or only a bit of 
recoding at the beginning and the end, or if recoding is necessary, only 
for the audio track.

I tried this:

$ ffmpeg -ss 00:02 -i 00078.MTS -vcodec copy -acodec ac3 -b:a 256k cut.mts

However, cut.mts contains only audio, no video anymore:

$ ffmpeg -i cut.mts
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
   configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 
--build-suffix=-ffmpeg --toolchain=hardened 
--libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu 
--cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping 
--disable-decoder=libopenjpeg --disable-decoder=libschroedinger 
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa 
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca 
--enable-libcdio --enable-libflite --enable-libfontconfig 
--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-libsnappy 
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora 
--enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack 
--enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi 
--enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 
--enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 
--enable-libopencv
   libavutil      54. 31.100 / 54. 31.100
   libavcodec     56. 60.100 / 56. 60.100
   libavformat    56. 40.101 / 56. 40.101
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 40.101 /  5. 40.101
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  2.101 /  1.  2.101
   libpostproc    53.  3.100 / 53.  3.100
[h264 @ 0x1087c40] start time for stream 0 is not set in estimate_timings_from_pts
[mpegts @ 0x10837a0] Could not find codec parameters for stream 0 (Video: 
h264 ([27][0][0][0] / 0x001B), none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from '/tmp/cut.mts':
   Duration: 00:00:04.26, start: 1.400000, bitrate: 297 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: h264 ([27][0][0][0] / 0x001B), none, 90k tbr, 90k tbn, 180k tbc
     Stream #0:1[0x101]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 256 kb/s
At least one output file must be specified


Is this a bug or am I doing something wrong?


You can find my small test video here:
    http://sim.mathematik.uni-halle.de/~henning/video/00078.MTS


More information about the ffmpeg-user mailing list