我试图告诉Linux / Ubuntu将mkv文件转换为mp4文件而不做任何修改,我在mkv中有很多多语言+字幕文件我想转换为mp4但保持与mkv文件完全相同
实际上我正在使用此代码
ffmpeg -i 13.Reasons.Why.S01E01.720p-www.DescargateloCorp.com.mkv -map 0 -c:v copy -c:a copy -c:s copy 13.Reasons.Why.S01E01.720p.mp4
但它只是保存音轨而不是视频轨道
我尝试了不同的代码,但没有一个,但是这个
编辑:我试过这个命令
> ffmpeg version N-75193-gf855353-Xtream-Codes Copyright (c) 2000-2015
> the FFmpeg developers built with gcc 4.8 (Ubuntu
> 4.8.4-2ubuntu1~14.04) configuration: --prefix=/root/FFmpeg/target --extra-cflags='-I/root/FFmpeg/target/include -static' --extra-ldflags='-L/root/FFmpeg/target/lib -lm -static' --extra-version=Xtream-Codes --disable-debug --disable-shared --enable-libx265 --enable-static --extra-cflags=--static --disable-ffplay --disable-ffserver --disable-doc --enable-librtmp --enable-gpl --enable-pthreads --enable-postproc --enable-libass --enable-gray --enable-runtime-cpudetect --enable-gnutls --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-bzlib --enable-zlib --enable-version3 --enable-libvpx --enable-libxavs --disable-devices --extra-libs='-lrtmp -lnettle -lhogweed -lgmp -lssl -lcrypto -lz -lc -ldl' libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 1.100 / 57. 1.100 libavformat 57. 0.100 /
> 57. 0.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 1.100 / 6. 1.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 / 2. 0.100 libpostproc 54. 0.100 /
> 54. 0.100 Input #0, matroska,webm, from '13.Reasons.Why.S01E01.720p-www.DescargateloCorp.com.mkv': Metadata:
> title : www.DescargateloCorp.com
> encoder : libebml v1.3.0 + libmatroska v1.4.1
> creation_time : 2017-04-17 01:52:33 Duration: 00:52:57.65, start: 0.062000, bitrate: 1862 kb/s
> Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 180k tbc (default)
> Metadata:
> title : www.DescargateloCorp.com
> BPS : 1549034
> BPS-eng : 1549034
> DURATION : 00:52:38.280000000
> DURATION-eng : 00:52:38.280000000
> NUMBER_OF_FRAMES: 75723
> NUMBER_OF_FRAMES-eng: 75723
> NUMBER_OF_BYTES : 611535569
> NUMBER_OF_BYTES-eng: 611535569
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:1(spa): Audio: ac3, 48000 Hz, stereo, fltp, 160 kb/s (default)
> Metadata:
> title : Español Latino
> BPS : 160000
> BPS-eng : 160000
> DURATION : 00:52:57.632000000
> DURATION-eng : 00:52:57.632000000
> NUMBER_OF_FRAMES: 99301
> NUMBER_OF_FRAMES-eng: 99301
> NUMBER_OF_BYTES : 63552640
> NUMBER_OF_BYTES-eng: 63552640
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:2(eng): Audio: aac (LC), 48000 Hz, stereo, fltp
> Metadata:
> title : Ingles
> BPS : 160357
> BPS-eng : 160357
> DURATION : 00:52:57.621000000
> DURATION-eng : 00:52:57.621000000
> NUMBER_OF_FRAMES: 148951
> NUMBER_OF_FRAMES-eng: 148951
> NUMBER_OF_BYTES : 63694551
> NUMBER_OF_BYTES-eng: 63694551
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:3: Subtitle: subrip (default)
> Metadata:
> title : Forzados
> BPS : 0
> BPS-eng : 0
> DURATION : 00:50:31.904000000
> DURATION-eng : 00:50:31.904000000
> NUMBER_OF_FRAMES: 10
> NUMBER_OF_FRAMES-eng: 10
> NUMBER_OF_BYTES : 199
> NUMBER_OF_BYTES-eng: 199
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:4(spa): Subtitle: subrip
> Metadata:
> title : Español
> BPS : 57
> BPS-eng : 57
> DURATION : 00:49:59.496000000
> DURATION-eng : 00:49:59.496000000
> NUMBER_OF_FRAMES: 772
> NUMBER_OF_FRAMES-eng: 772
> NUMBER_OF_BYTES : 21630
> NUMBER_OF_BYTES-eng: 21630
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES [mp4 @ 0x530b120] Codec for stream 0 does not use
> global headers but container format requires global headers [mp4 @
> 0x530b120] Codec for stream 1 does not use global headers but
> container format requires global headers [mp4 @ 0x530b120] Codec for
> stream 2 does not use global headers but container format requires
> global headers [mp4 @ 0x530b120] Codec for stream 3 does not use
> global headers but container format requires global headers [mp4 @
> 0x530b120] Codec for stream 4 does not use global headers but
> container format requires global headers [mp4 @ 0x530b120] track 1:
> codec frame size is not set [mp4 @ 0x530b120] Could not find tag for
> codec subrip in stream #3, codec not currently supported in container
> Output #0, mp4, to '13.Reasons.Why.S01E01.720p.mp4': Metadata:
> title : www.DescargateloCorp.com
> encoder : Lavf57.0.100
> Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 16k tbn, 1k
> tbc (default)
> Metadata:
> title : www.DescargateloCorp.com
> BPS : 1549034
> BPS-eng : 1549034
> DURATION : 00:52:38.280000000
> DURATION-eng : 00:52:38.280000000
> NUMBER_OF_FRAMES: 75723
> NUMBER_OF_FRAMES-eng: 75723
> NUMBER_OF_BYTES : 611535569
> NUMBER_OF_BYTES-eng: 611535569
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:1(spa): Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, stereo, 160 kb/s (default)
> Metadata:
> title : Español Latino
> BPS : 160000
> BPS-eng : 160000
> DURATION : 00:52:57.632000000
> DURATION-eng : 00:52:57.632000000
> NUMBER_OF_FRAMES: 99301
> NUMBER_OF_FRAMES-eng: 99301
> NUMBER_OF_BYTES : 63552640
> NUMBER_OF_BYTES-eng: 63552640
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:2(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo
> Metadata:
> title : Ingles
> BPS : 160357
> BPS-eng : 160357
> DURATION : 00:52:57.621000000
> DURATION-eng : 00:52:57.621000000
> NUMBER_OF_FRAMES: 148951
> NUMBER_OF_FRAMES-eng: 148951
> NUMBER_OF_BYTES : 63694551
> NUMBER_OF_BYTES-eng: 63694551
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:3: Subtitle: subrip (default)
> Metadata:
> title : Forzados
> BPS : 0
> BPS-eng : 0
> DURATION : 00:50:31.904000000
> DURATION-eng : 00:50:31.904000000
> NUMBER_OF_FRAMES: 10
> NUMBER_OF_FRAMES-eng: 10
> NUMBER_OF_BYTES : 199
> NUMBER_OF_BYTES-eng: 199
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> Stream #0:4(spa): Subtitle: subrip
> Metadata:
> title : Español
> BPS : 57
> BPS-eng : 57
> DURATION : 00:49:59.496000000
> DURATION-eng : 00:49:59.496000000
> NUMBER_OF_FRAMES: 772
> NUMBER_OF_FRAMES-eng: 772
> NUMBER_OF_BYTES : 21630
> NUMBER_OF_BYTES-eng: 21630
> _STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit built on Jun 9 2014 15:16:27
> _STATISTICS_WRITING_DATE_UTC: 2017-04-17 01:52:33
> _STATISTICS_WRITING_DATE_UTC-eng: 2017-04-17 01:52:33
> _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
> _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream mapping: Stream #0:0 -> #0:0 (copy) Stream
> #0:1 -> #0:1 (copy) Stream #0:2 -> #0:2 (copy) Stream #0:3 -> #0:3 (copy) Stream #0:4 -> #0:4 (copy)
我认为它可行,但我收到此错误消息
无法为输出文件#0写入标头(编解码器参数不正确?):参数无效
c = [[3], [1], [4], [5], [7], [0], [2], [6]]
p = [[0, 1, 2, 4, 5, 6, 7],
[0, 2, 3, 4, 5, 6, 7],
[0, 1, 2, 3, 6, 7, 4],
[0, 1, 2, 3, 6, 5, 5],
[0, 1, 2, 3, 4, 6, 7],
[1, 2, 3, 4, 6, 7, 5],
[0, 1, 3, 4, 5, 6, 7],
[0, 1, 2, 3, 4, 5, 7]]
for i in range(1000):
c_main, p_main = temp(c, p)
答案 0 :(得分:0)
在挖掘arroung之后,我找到了一个使用HandBreakCLI的解决方案
第一。您需要安装HandBreakCLI
然后我使用了这段代码
HandBrakeCLI -i INPUT-MOVIE.mkv -o OUTPUT-MOVIE.mp4 -e x264 --all-audio --all-subtitles
使用此HandBrake创建一个新的mp4文件,使用H264,保存文件中的所有音频和字幕,其中包含多个流/音轨或字幕。
现在我需要知道我该如何使这个命令适用于整个目录。
问候。