ffmpeg를 사용하여 파일에 자막을 번인하려면 어떻게 해야 합니까?

ffmpeg를 사용하여 파일에 자막을 번인하려면 어떻게 해야 합니까?

같은 폴더에 test.m4a와 test.srt라는 파일이 있습니다.

m4a에 자막을 구우려면 어떻게 해야 하나요?

내가 얻는 결과는 다음과 같습니다.

Korays-MacBook-Pro:~ koraytugay$ ./ffmpeg -i test.m4v -vf subtitles=test.srt out.m4v
ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct  8 2014 19:37:09 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --arch=x86_64 --enable-runtime-cpudetect
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fca6201e000] stream 0, timescale not set
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fca6201e000] Could not find codec parameters for stream 1 (Video: none (drmi / 0x696D7264), 640x478, 1389 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fca6201e000] Could not find codec parameters for stream 2 (Subtitle: none (p608 / 0x38303670), 853x478, 0 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.m4v':
  Metadata:
    major_brand     : M4V 
    minor_version   : 0
    compatible_brands: M4V mp42isom
    creation_time   : 2014-06-09 19:13:04
    title           : Day 1: 2:00 A.M. - 3:00 A.M.
    artist          : 24
    album_artist    : 24
    album           : 24
    genre           : Drama
    track           : 3
    disc            : 1/1
    compilation     : 0
    gapless_playback: 0
    date            : 2001-11-20T08:00:00Z
    copyright       : © 2001 Twentieth Century Fox Film Corporation
    description     : Jack verifies the key card was encrypted on Nina's computer.
    show            : 24
    episode_id      : 1AFF02 
    season_number   : 1
    episode_sort    : 3
    media_type      : 10
    synopsis        : Kimberly and Janet find themselves in great danger and must look for an escape route.  In her search for Kimberly, Teri has found help from Janet's father Alan York.  Meanwhile, Palmer attends a secret meeting about disturbing news that is about to break,
    iTunMOVI        : <?xml version="1.0" encoding="UTF-8"?>
                    : <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                    : <plist version="1.0">
                    : <dict>
                    :   <key>asset-info</key>
                    :   <dict>
                    :       <key>closed-captioned</key>
                    :       <true/>
                    :       <key>file-size</key>
                    :       <integer>484838754</integer>
                    :       <key>flavor</key>
                    :       <string>4:640x480LC-128</string>
                    :       <key>screen-format</key>
                    :       <string>widescreen</string>
                    :   </dict>
                    : </dict>
                    : </plist>
                    : 
  Duration: 00:42:30.01, start: 0.000000, bitrate: 1521 kb/s
    Stream #0:0(eng): Audio: aac (drms / 0x736D7264), 44100 Hz, stereo, fltp, 124 kb/s (default)
    Metadata:
      creation_time   : 2014-06-09 19:13:04
      handler_name    : Apple Sound Media Handler
    Stream #0:1(eng): Video: none (drmi / 0x696D7264), 640x478, 1389 kb/s, SAR 4:3 DAR 1280:717, 23.98 fps, 23.98 tbr, 2997 tbn, 2997 tbc (default)
    Metadata:
      creation_time   : 2014-06-09 19:13:04
      handler_name    : Apple Video Media Handler
    Stream #0:2(eng): Subtitle: none (p608 / 0x38303670), 853x478, 0 kb/s (default)
    Metadata:
      creation_time   : 2014-06-09 19:13:04
      handler_name    : Apple Closed Caption Media Handler
    Stream #0:3: Video: mjpeg, yuvj444p(pc, bt470bg), 1400x1400 [SAR 300:300 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
[AVFilterGraph @ 0x7fca61e133e0] No such filter: 'subtitles'
Error opening filters!
Korays-MacBook-Pro:~ koraytugay$ 

답변1

좋다위키 페이지에서 언급--enable-libass, 자막 필터가 작동하려면 ffmpeg 빌드를 컴파일해야 합니다 . 귀하의 빌드는 불행히도 그런 기능이 없는 것 같습니다.

가장 쉬운 방법은 다음을 사용하는 것입니다.홈브류.

그런 다음 ffmpeg를 설치하십시오.

brew install ffmpeg

그런 다음 다시 시도해 보세요.

ffmpeg -i test.m4v -vf subtitles=test.srt -c:a copy out.m4v

꼭 읽어보세요H.264 인코딩 가이드출력 품질을 설정하는 방법을 알아보세요.


예제의 파일과 같이 DRM으로 암호화된 파일은 변환할 수 없습니다(비디오 코덱 참조 drmi). 이것은티켓 오픈ffmpeg의 경우 해결될 가능성이 낮습니다.

답변2

나는 Parallels에서 실행되는 Windows에서 vidcoder 1.5.22를 사용하게 되었습니다.

관련 정보