이것은 데비안 테스트에 사용한 ffmpeg 버전입니다.
$ ffmpeg -version
ffmpeg version 4.4.1-2+b1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11 (Debian 11.2.0-12)
configuration: --prefix=/usr --extra-version=2+b1 --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
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
이것은 내가 사용하려는 명령입니다.
$ ffmpeg -ss 00:22:20 -t 60 -i 123.mkv 456.mkv
이것은에서 비롯됩니다동영상 파일의 특정 부분에서 오디오를 추출/복사하는 것이 가능합니까?제가 몇 년 전에 질문한 내용입니다.
나도 본 적 있어FFMpeg: 약 20바이트의 비디오 클립을 생성합니다. 영상 길이를 알 수 없고 오디오가 없을 때 10초하지만 여기에 표시된 타임스탬프를 사용하려고 하면 오류가 발생합니다.
Invalid duration specification for ss: 00:22:20:0.0
제가 재생하고 있는 미디어 파일의 길이는 약 50분 이상인데 22분 20초와 그 이후의 1분 파일만 원합니다.
ffmpeg 또는 처리 방식에서 뭔가가 변경되었습니다. 분명히 파일 이름을 변경했습니다. 그럼에도 불구하고 mkvinfo에 넣은 것처럼 보이는 파일입니다.
$ mkvinfo 456.mkv
+ EBML head
|+ EBML version: 1
|+ EBML read version: 1
|+ Maximum EBML ID length: 4
|+ Maximum EBML size length: 8
|+ Document type: matroska
|+ Document type version: 4
|+ Document type read version: 2
+ Segment: size 6959454
|+ Seek head (subentries will be skipped)
|+ EBML void: size 81
|+ Segment information
| + Timestamp scale: 1000000
| + Title: 123
| + Multiplexing application: Lavf58.76.100
| + Writing application: Lavf58.76.100
| + Segment UID: 0x19 0xba 0x01 0xe0 0xed 0x6f 0x79 0xef 0xfb 0x9d 0xe6 0xcd 0x2b 0xad 0x2f 0x79
| + Duration: 00:23:54.905000000
|+ Tracks
| + Track
| + Track number: 1 (track ID for mkvmerge & mkvextract: 0)
| + Track UID: 4989308985802999081
| + "Lacing" flag: 0
| + Name: abcd
| + Language: und
| + Codec ID: V_MPEG4/ISO/AVC
| + Track type: video
| + Default duration: 00:00:00.041708333 (23.976 frames/fields per second for a video track)
| + Video track
| + Pixel width: 1280
| + Pixel height: 720
| + Interlaced: 2
| + Video colour information
| + Horizontal chroma siting: 1
| + Vertical chroma siting: 2
| + Codec's private data: size 45 (H.264 profile: High @L3.1)
| + Track
| + Track number: 2 (track ID for mkvmerge & mkvextract: 1)
| + Track UID: 5858605359486045911
| + "Lacing" flag: 0
| + Name: abcd
| + Language: eng
| + Codec ID: A_VORBIS
| + Track type: audio
| + Audio track
| + Channels: 2
| + Sampling frequency: 48000
| + Bit depth: 32
| + Codec's private data: size 3959
| + Track
| + Track number: 3 (track ID for mkvmerge & mkvextract: 2)
| + Track UID: 6757137498994684877
| + "Lacing" flag: 0
| + Name: abcd
| + Language: eng
| + Codec ID: S_TEXT/ASS
| + Track type: subtitles
| + Codec's private data: size 576
|+ Tags
| + Tag
| + Targets
| + Simple
| + Name: COMMENT
| + String: abcd
| + Simple
| + Name: ENCODER
| + String: Lavf58.76.100
| + Tag
| + Targets
| + Track UID: 4989308985802999081
| + Simple
| + Name: BPS
| + String: 1050683
| + Simple
| + Name: BPS
| + Tag language: eng
| + String: 1050683
| + Simple
| + Name: DURATION
| + Tag language: eng
| + String: 00:47:01.110000000
| + Simple
| + Name: NUMBER_OF_FRAMES
| + String: 67639
| + Simple
| + Name: NUMBER_OF_FRAMES
| + Tag language: eng
| + String: 67639
| + Simple
| + Name: NUMBER_OF_BYTES
| + String: 370511729
| + Simple
| + Name: NUMBER_OF_BYTES
| + Tag language: eng
| + String: 370511729
| + Simple
| + Name: _STATISTICS_WRITING_APP
| + String: mkvmerge v13.0.0 ('The Juggler') 64bit
| + Simple
| + Name: _STATISTICS_WRITING_APP
| + Tag language: eng
| + String: mkvmerge v13.0.0 ('The Juggler') 64bit
| + Simple
| + Name: _STATISTICS_WRITING_DATE_UTC
| + String: 2018-09-20 14:51:30
| + Simple
| + Name: _STATISTICS_WRITING_DATE_UTC
| + Tag language: eng
| + String: 2018-09-20 14:51:30
| + Simple
| + Name: _STATISTICS_TAGS
| + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
| + Simple
| + Name: _STATISTICS_TAGS
| + Tag language: eng
| + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
| + Simple
| + Name: ENCODER
| + String: Lavc58.134.100 libx264
| + Simple
| + Name: DURATION
| + String: 00:01:00.022000000
| + Tag
| + Targets
| + Track UID: 5858605359486045911
| + Simple
| + Name: BPS
| + String: 640000
| + Simple
| + Name: BPS
| + Tag language: eng
| + String: 640000
| + Simple
| + Name: DURATION
| + Tag language: eng
| + String: 00:47:01.120000000
| + Simple
| + Name: NUMBER_OF_FRAMES
| + String: 88160
| + Simple
| + Name: NUMBER_OF_FRAMES
| + Tag language: eng
| + String: 88160
| + Simple
| + Name: NUMBER_OF_BYTES
| + String: 225689600
| + Simple
| + Name: NUMBER_OF_BYTES
| + Tag language: eng
| + String: 225689600
| + Simple
| + Name: _STATISTICS_WRITING_APP
| + String: mkvmerge v13.0.0 ('The Juggler') 64bit
| + Simple
| + Name: _STATISTICS_WRITING_APP
| + Tag language: eng
| + String: mkvmerge v13.0.0 ('The Juggler') 64bit
| + Simple
| + Name: _STATISTICS_WRITING_DATE_UTC
| + String: 2018-09-20 14:51:30
| + Simple
| + Name: _STATISTICS_WRITING_DATE_UTC
| + Tag language: eng
| + String: 2018-09-20 14:51:30
| + Simple
| + Name: _STATISTICS_TAGS
| + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
| + Simple
| + Name: _STATISTICS_TAGS
| + Tag language: eng
| + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
| + Simple
| + Name: ENCODER
| + String: Lavc58.134.100 libvorbis
| + Simple
| + Name: DURATION
| + String: 00:01:00.003000000
| + Tag
| + Targets
| + Track UID: 6757137498994684877
| + Simple
| + Name: BPS
| + String: 40
| + Simple
| + Name: BPS
| + Tag language: eng
| + String: 40
| + Simple
| + Name: DURATION
| + Tag language: eng
| + String: 00:46:08.244000000
| + Simple
| + Name: NUMBER_OF_FRAMES
| + String: 636
| + Simple
| + Name: NUMBER_OF_FRAMES
| + Tag language: eng
| + String: 636
| + Simple
| + Name: NUMBER_OF_BYTES
| + String: 14113
| + Simple
| + Name: NUMBER_OF_BYTES
| + Tag language: eng
| + String: 14113
| + Simple
| + Name: _STATISTICS_WRITING_APP
| + String: mkvmerge v13.0.0 ('The Juggler') 64bit
| + Simple
| + Name: _STATISTICS_WRITING_APP
| + Tag language: eng
| + String: mkvmerge v13.0.0 ('The Juggler') 64bit
| + Simple
| + Name: _STATISTICS_WRITING_DATE_UTC
| + String: 2018-09-20 14:51:30
| + Simple
| + Name: _STATISTICS_WRITING_DATE_UTC
| + Tag language: eng
| + String: 2018-09-20 14:51:30
| + Simple
| + Name: _STATISTICS_TAGS
| + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
| + Simple
| + Name: _STATISTICS_TAGS
| + Tag language: eng
| + String: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
| + Simple
| + Name: ENCODER
| + String: Lavc58.134.100 ssa
| + Simple
| + Name: DURATION
| + String: 00:23:54.905000000
|+ Cluster
이제 위의 내용을 통해 ffmpeg가 비디오를 자르기만 하므로 내가 만든 미디어 파일의 길이가 약 1분임에도 불구하고 시간을 포함하여 이전 버전의 속성을 표시한다는 것을 추론할 수 있습니다.
어쨌든, 더 잘할 수 있는 방법이 있습니까? 즉, 오늘부터 ffmpeg 버전을 사용하고 동일한 효과를 제공하며 지속 시간이 표시된 23분이 아닌 1분으로 변경된다는 의미입니까?
FWIW, 내 현재 시스템의 mkvmerge는 -
$ mkvmerge --veion
mkvmerge v64.0.0 ('Willows') 64-bit
답변1
게시한 예제는 괜찮아 보이지만 오류 메시지는 0.0
명령을 실행할 때 시작 시간에 뭔가 추가된다는 것을 나타냅니다. 이것은 작동합니다:
ffmpeg -ss 00:22:20 -t 60 -i 123.mkv 456.mkv