2017-09-03 199 views
0

我試圖告訴Linux/Ubuntu將mkv文件轉換爲mp4文件,無需任何修改,我有很多多語言+字幕文件mkv我想轉換爲MP4,但保留所有的MKV文件的同一轉換多音軌+字幕.MKV到MP4

其實我使用這個代碼

ffmpeg -i VIDEO.mkv -acodec copy -vcodec copy -map 0:a VIDEO.mp4 

,但它只是保存音軌,而不是視頻軌道

我嘗試了不同的代碼,但沒有工作,但這個

編輯:我試圖用這個命令

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 

我認爲它可以工作,但我得到這個錯誤信息

無法寫入輸出文件#0頭(不正確的編解碼器的參數?):無效參數

> 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

Stack Overflow是編程和開發問題的網站。這個問題似乎是無關緊要的,因爲它不是關於編程或開發。請參閱幫助中心的[我可以詢問哪些主題](http://stackoverflow.com/help/on-topic)。也許[超級用戶](http://superuser.com/)或[Unix&Linux堆棧交換](http://unix.stackexchange.com/)會是一個更好的地方。 – jww

回答

0

挖arroung我發現使用HandBreakCLI

後,滴加

1st。您需要安裝HandBreakCLI

然後我用這個代碼

HandBrakeCLI -i INPUT-MOVIE.mkv -o OUTPUT-MOVIE.mp4 -e x264 --all-audio --all-subtitles 

有了這個手剎創建一個新的MP4文件,使用H264,節省從多流/音頻軌道或字幕文件的所有音頻和字幕它。

現在我需要知道我該如何讓這個命令適用於整個目錄。

問候。