Extraje sin pérdidas 30 m de un video de ~ 1.5 h usando el siguiente ffmpeg
comando:
ffmpeg -ss 0 -t 00:30:00 -i in.mp4 -acodec copy -vcodec copy out.mp4
El split fue exitoso y out.mp4
se creó con los primeros 30m.
Sin embargo... a pesar de que el video se detiene después de 30 m, los reproductores de video como VLC y Windows Media Player muestran que la duración del video sigue siendo de aproximadamente 1,5 horas, al igual que el Explorador de Windows cuando se selecciona el archivo.
¿Por qué la duración del video que se muestra es diferente a la duración real del video?
¿Cómo puedo ajustarlo para que coincidan?
Estoy en Win7 usando ffmpeg 64bit static desde el 10 de febrero de 2015.
Además, aquí está el resultado del proceso:
ffmpeg version N-69672-g078be09 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-l
ibrtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --ena
ble-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 18.100 / 54. 18.100
libavcodec 56. 21.102 / 56. 21.102
libavformat 56. 19.100 / 56. 19.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 9.104 / 5. 9.104
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000307fe0] overread end of atom 'colr' by 1 bytes
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2015-02-11 15:31:12
encoder : HandBrake 0.9.8 2012071700
Duration: 01:33:46.64, start: 0.000000, bitrate: 2556 kb/s
Chapter #0:0: start -0.160000, end 301.040000
Metadata:
title : Chapter 1
Chapter #0:1: start 301.040000, end 600.560000
Metadata:
title : Chapter 2
Chapter #0:2: start 600.560000, end 901.040000
Metadata:
title : Chapter 3
Chapter #0:3: start 901.040000, end 1200.560000
Metadata:
title : Chapter 4
Chapter #0:4: start 1200.560000, end 1501.040000
Metadata:
title : Chapter 5
Chapter #0:5: start 1501.040000, end 1800.560000
Metadata:
title : Chapter 6
Chapter #0:6: start 1800.560000, end 2101.040000
Metadata:
title : Chapter 7
Chapter #0:7: start 2101.040000, end 2400.560000
Metadata:
title : Chapter 8
Chapter #0:8: start 2400.560000, end 2701.040000
Metadata:
title : Chapter 9
Chapter #0:9: start 2701.040000, end 3000.560000
Metadata:
title : Chapter 10
Chapter #0:10: start 3000.560000, end 3301.040000
Metadata:
title : Chapter 11
Chapter #0:11: start 3301.040000, end 3600.560000
Metadata:
title : Chapter 12
Chapter #0:12: start 3600.560000, end 3901.040000
Metadata:
title : Chapter 13
Chapter #0:13: start 3901.040000, end 4200.560000
Metadata:
title : Chapter 14
Chapter #0:14: start 4200.560000, end 4501.040000
Metadata:
title : Chapter 15
Chapter #0:15: start 4501.040000, end 4800.560000
Metadata:
title : Chapter 16
Chapter #0:16: start 4800.560000, end 5101.040000
Metadata:
title : Chapter 17
Chapter #0:17: start 5101.040000, end 5400.560000
Metadata:
title : Chapter 18
Chapter #0:18: start 5400.560000, end 5626.640000
Metadata:
title : Chapter 19
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 720x576 [SAR 768:715 DAR 192:143], 2391 kb/s, 25
fps, 25 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2015-02-11 15:31:12
encoder : JVT/AVC Coding
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
Metadata:
creation_time : 2015-02-11 15:31:12
Stream #0:2(und): Subtitle: mov_text (text / 0x74786574)
Metadata:
creation_time : 2015-02-11 15:31:12
Output #0, mp4, to 'out.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
encoder : Lavf56.19.100
Chapter #0:0: start 0.000000, end 301.040000
Metadata:
title : Chapter 1
Chapter #0:1: start 301.040000, end 600.560000
Metadata:
title : Chapter 2
Chapter #0:2: start 600.560000, end 901.040000
Metadata:
title : Chapter 3
Chapter #0:3: start 901.040000, end 1200.560000
Metadata:
title : Chapter 4
Chapter #0:4: start 1200.560000, end 1501.040000
Metadata:
title : Chapter 5
Chapter #0:5: start 1501.040000, end 1800.560000
Metadata:
title : Chapter 6
Chapter #0:6: start 1800.560000, end 2101.040000
Metadata:
title : Chapter 7
Chapter #0:7: start 2101.040000, end 2400.560000
Metadata:
title : Chapter 8
Chapter #0:8: start 2400.560000, end 2701.040000
Metadata:
title : Chapter 9
Chapter #0:9: start 2701.040000, end 3000.560000
Metadata:
title : Chapter 10
Chapter #0:10: start 3000.560000, end 3301.040000
Metadata:
title : Chapter 11
Chapter #0:11: start 3301.040000, end 3600.560000
Metadata:
title : Chapter 12
Chapter #0:12: start 3600.560000, end 3901.040000
Metadata:
title : Chapter 13
Chapter #0:13: start 3901.040000, end 4200.560000
Metadata:
title : Chapter 14
Chapter #0:14: start 4200.560000, end 4501.040000
Metadata:
title : Chapter 15
Chapter #0:15: start 4501.040000, end 4800.560000
Metadata:
title : Chapter 16
Chapter #0:16: start 4800.560000, end 5101.040000
Metadata:
title : Chapter 17
Chapter #0:17: start 5101.040000, end 5400.560000
Metadata:
title : Chapter 18
Chapter #0:18: start 5400.560000, end 5626.640000
Metadata:
title : Chapter 19
Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x576 [SAR 768:715 DAR 192:143], q=2-31, 2391 kb/s, 25 fps, 25 tbr, 90k tbn, 90
k tbc (default)
Metadata:
creation_time : 2015-02-11 15:31:12
encoder : JVT/AVC Coding
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 159 kb/s (default)
Metadata:
creation_time : 2015-02-11 15:31:12
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=45000 fps=5763 q=-1.0 Lsize= 590048kB time=00:30:00.00 bitrate=2685.4kbits/s
video:553577kB audio:35153kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.223870%
Aquí está la salida de ffmpeg -i out.mp4
:
ffmpeg version N-69672-g078be09 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-l
ibrtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --ena
ble-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 18.100 / 54. 18.100
libavcodec 56. 21.102 / 56. 21.102
libavformat 56. 19.100 / 56. 19.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 9.104 / 5. 9.104
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.19.100
Duration: 01:33:46.64, start: 0.000000, bitrate: 859 kb/s
Chapter #0:0: start 0.000000, end 301.040000
Metadata:
title : Chapter 1
Chapter #0:1: start 301.040000, end 600.560000
Metadata:
title : Chapter 2
Chapter #0:2: start 600.560000, end 901.040000
Metadata:
title : Chapter 3
Chapter #0:3: start 901.040000, end 1200.560000
Metadata:
title : Chapter 4
Chapter #0:4: start 1200.560000, end 1501.040000
Metadata:
title : Chapter 5
Chapter #0:5: start 1501.040000, end 1800.560000
Metadata:
title : Chapter 6
Chapter #0:6: start 1800.560000, end 2101.040000
Metadata:
title : Chapter 7
Chapter #0:7: start 2101.040000, end 2400.560000
Metadata:
title : Chapter 8
Chapter #0:8: start 2400.560000, end 2701.040000
Metadata:
title : Chapter 9
Chapter #0:9: start 2701.040000, end 3000.560000
Metadata:
title : Chapter 10
Chapter #0:10: start 3000.560000, end 3301.040000
Metadata:
title : Chapter 11
Chapter #0:11: start 3301.040000, end 3600.560000
Metadata:
title : Chapter 12
Chapter #0:12: start 3600.560000, end 3901.040000
Metadata:
title : Chapter 13
Chapter #0:13: start 3901.040000, end 4200.560000
Metadata:
title : Chapter 14
Chapter #0:14: start 4200.560000, end 4501.040000
Metadata:
title : Chapter 15
Chapter #0:15: start 4501.040000, end 4800.560000
Metadata:
title : Chapter 16
Chapter #0:16: start 4800.560000, end 5101.040000
Metadata:
title : Chapter 17
Chapter #0:17: start 5101.040000, end 5400.560000
Metadata:
title : Chapter 18
Chapter #0:18: start 5400.560000, end 5626.640000
Metadata:
title : Chapter 19
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 720x576 [SAR 768:715 DAR 192:143], 2519 kb/s, 25
fps, 25 tbr, 90k tbn, 180k tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 159 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574)
Metadata:
handler_name : SubtitleHandler
At least one output file must be specified
Como escribió @LordNeckbeard en los comentarios, mover la -t
bandera después de que la -i
bandera funcione:
ffmpeg -ss 0 -i in.mp4 -t 00:30:00 -acodec copy -vcodec copy out.mp4
-shortest
como una opción de salida. Creo que lo que está pasando -t
tal vez se aplica solo a una de las secuencias en el archivo de entrada, o algo así.
llogan
jonathan
jonathan
jonathan
llogan
-ss 0
? ¿Qué sucede si se mueve-t 00:30:00
después de la entrada para que se use como una opción de salida?jonathan
-t
a después de que la entrada-i
funcionó. Escríbelo como respuesta y lo aceptaré :)jonathan
llogan
-t
es tanto una opción de entrada como de salida, por lo que supongo que realmente no importaría. Tal vez encontraste un error. ¿Ocurre con todas las entradas, o solo con una(s) determinada(s)? No puedo duplicar el problema.