0

In Ubuntu 18.04 I quite often used the following command for trimming part of the video without re encoding (which means without any quality loss).

ffmpeg -ss 00:06:00 -i DSCF5984.MOV -t 00:07:00 -c copy DSCF5984_A_wszystkie.MOV

Not so much time ago I moved to Ubuntu 22.04. Still having the same video camera and still using the same format for recording, when using the command as above I'm getting quite strange error and the behavior is unexpected. In this case mov file is 40 sec file. I want to get 7 seconds fragment starting from 6 second (thus from 6 to 13 sec). Instead of this I get very short fragment from the beginning of the file. I don't even know how long as none of video players want to display its length. Probably it's 1-2 sec. Thus it's not only, I get this error, but ffmpeg doesn't work. In theory I have the newest version available for ubuntu 22.04.

Messages displayed by ffmpeg

ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'DSCF5984.MOV':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2023-08-12T23:07:18.000000Z
    original_format : Digital Camera
    original_format-eng: Digital Camera
    comment         : FUJIFILM DIGITAL CAMERA X-S10
    comment-eng     : FUJIFILM DIGITAL CAMERA X-S10
  Duration: 00:00:40.04, start: 0.000000, bitrate: 105270 kb/s
  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, smpte170m/bt709/smpte170m), 3840x2160, 101873 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2023-08-12T23:07:18.000000Z
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
      timecode        : 07:05:54;21
  Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2023-08-12T23:07:18.000000Z
      vendor_id       : [0][0][0][0]
      timecode        : 07:05:54;21
  Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2023-08-12T23:07:18.000000Z
      timecode        : 07:05:54;21
[mov @ 0x55a005fa6e40] Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format
[mov @ 0x55a005fa6e40] pts has no value
Output #0, mov, to 'DSCF5984_A_wszystkie.MOV':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    comment-eng     : FUJIFILM DIGITAL CAMERA X-S10
    original_format : Digital Camera
    original_format-eng: Digital Camera
    comment         : FUJIFILM DIGITAL CAMERA X-S10
    encoder         : Lavf58.76.100
  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, smpte170m/bt709/smpte170m), 3840x2160, q=2-31, 101873 kb/s, 0.03 fps, 29.97 tbr, 30k tbn, 30k tbc (default)
    Metadata:
      creation_time   : 2023-08-12T23:07:18.000000Z
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
      timecode        : 07:05:54;21
  Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2023-08-12T23:07:18.000000Z
      vendor_id       : [0][0][0][0]
      timecode        : 07:05:54;21
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   30 fps=0.0 q=-1.0 Lsize=   13475kB time=-00:05:19.97 bitrate=N/A speed=N/A    
video:13191kB audio:282kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.019629%

Is that some kind of error? Or should I do sth different? I'm quite surprised as I didn't change my camera. So is that sth changed in ffmpeg?

0

1 Answer 1

0

It often happens when using the -ss and -t together with -c copy or -codec copy.

Modified version of your command:

ffmpeg -ss 00:06:00 -i DSCF5984.MOV -t 00:07:00 -c:a copy DSCF5984_A_wszystkie.MOV

Taken from Behroozfar's answer

8
  • I'm sorry. It doesn't help. In practice it should be "ffmpeg -ss 00:06:00 -i DSCF5984.MOV -t 00:07:00 -c:v copy -c:a copy DSCF5984_A_wszystkie.MOV" as I want to copy both audio and video. But this "version" leads to the same error and to the same incorrectly created fragment. For me it looks rather as some kind of bug. However when I put this question on stackoverflow, I didn't get any answer, just one -1 point and suggestion to close the thread. Do you perhaps have Ubuntu 22.04 and if yes, could you check on your side if it works. As I'm wondering if it's more file problem or system problem. Commented Aug 28, 2023 at 20:05
  • I do use Ubuntu 22.04 but I have NEVER had this bug EVER, I use FFmpeg 6.0 but I do not use the same camera
    – marbens
    Commented Aug 28, 2023 at 21:48
  • If you want to copy everything use -c copy anyways, note that seeking might be some what inaccurate with the video
    – marbens
    Commented Aug 28, 2023 at 22:46
  • It's quite strange for me that only changing ubuntu version (and ffmpge version as consequence) caused this problem. Should I then decrease ffmpeg version? How to do this in the most safe way? Commented Aug 28, 2023 at 23:26
  • And one thing more, I've checked this with the files I used without problems in ubuntu 18.04 and now it's not possible to trim then (in 18.04 trimming was possible). Thus something changed on ffmpeg side definitely here. for me it's bug. Commented Aug 28, 2023 at 23:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .