Eu tenho tentado encapsular alguns vídeos do QuickTime para MP4 com ffmpeg, mas os resultados estão um pouco confusos. Os codecs são todos compatíveis com MP4 para que tudo funcione bem. O problema é que os arquivos MP4 resultantes têm enormes quantidades de vídeo gaguejando neles. Por exemplo, ele será reproduzido, depois recuará meio segundo, depois voltará para onde deveria estar, depois fará outro salto e assim por diante.
Eu tentei várias combinações dos seguintes sinalizadores: -c copy -vcodec copy -acodec copy -copyts
, mas não encontrei nada que funcione. Então, o que eu preciso fazer para evitar a gagueira durante o reencapsulamento?
Aqui eu tento -c copy -copyts
:
$ ffmpeg -i in.mov -c copy -copyts out2.mp4
ffmpeg version 1.2.2 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 13 2013 00:49:34 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2013-02-13 06:40:06
Duration: 00:45:10.08, start: 0.040000, bitrate: 503 kb/s
Stream #0:0(eng): Video: h264 (High) (H264 / 0x34363248), yuv420p, 644x364 [SAR 1:1 DAR 23:13], 402 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
Metadata:
creation_time : 2013-02-13 06:40:06
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s
Metadata:
creation_time : 2013-02-13 06:40:06
handler_name : Apple Alias Data Handler
Output #0, mp4, to 'out2.mp4':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
encoder : Lavf54.63.104
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 644x364 [SAR 1:1 DAR 23:13], q=2-31, 402 kb/s, 25 fps, 16k tbn, 1k tbc
Metadata:
creation_time : 2013-02-13 06:40:06
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 95 kb/s
Metadata:
creation_time : 2013-02-13 06:40:06
handler_name : Apple Alias Data Handler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=67751 fps=15817 q=-1.0 Lsize= 166739kB time=00:45:10.04 bitrate= 504.0kbits/s
video:133281kB audio:31756kB subtitle:0 global headers:0kB muxing overhead 1.031415%
Aqui eu tento configurar os codecs de áudio e vídeo para copiar:
$ ffmpeg -i in.mov -vcodec copy -acodec copy out4.mp4
ffmpeg version 1.2.2 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 13 2013 00:49:34 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-gnutls --enable-libfreetype --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid --enable-nonfree --enable-libfaac
libavutil 52. 18.100 / 52. 18.100
libavcodec 54. 92.100 / 54. 92.100
libavformat 54. 63.104 / 54. 63.104
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 42.103 / 3. 42.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2013-02-13 06:40:06
Duration: 00:45:10.08, start: 0.040000, bitrate: 503 kb/s
Stream #0:0(eng): Video: h264 (High) (H264 / 0x34363248), yuv420p, 644x364 [SAR 1:1 DAR 23:13], 402 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
Metadata:
creation_time : 2013-02-13 06:40:06
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s
Metadata:
creation_time : 2013-02-13 06:40:06
handler_name : Apple Alias Data Handler
Output #0, mp4, to 'out4.mp4':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
encoder : Lavf54.63.104
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 644x364 [SAR 1:1 DAR 23:13], q=2-31, 402 kb/s, 25 fps, 16k tbn, 1k tbc
Metadata:
creation_time : 2013-02-13 06:40:06
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 95 kb/s
Metadata:
creation_time : 2013-02-13 06:40:06
handler_name : Apple Alias Data Handler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=67751 fps=15495 q=-1.0 Lsize= 166739kB time=00:45:10.00 bitrate= 504.0kbits/s
video:133281kB audio:31756kB subtitle:0 global headers:0kB muxing overhead 1.031400%