使用 ffmpeg 转换为 MPG 的 VOB 不包含音频

使用 ffmpeg 转换为 MPG 的 VOB 不包含音频

我摘录了一些家庭自制的视频:

dvdbackup  -M -i /dev/sr0 -o ~/Videos/dvd-backup

创建以下文件:

$ ls -1
VIDEO_TS.BUP
VIDEO_TS.IFO
VIDEO_TS.VOB
VTS_01_0.BUP
VTS_01_0.IFO
VTS_01_1.VOB

如果我使用vlc ./视频,则可以正常播放声音。

我正在尝试将视频转换为 MPG 以便上传到 Google 照片。

我试过了:

ffmpeg -i VTS_01_1.VOB -c:v copy -c:a copy VTS_01_1.MPG

但是,当我播放时vlc ./VTS_01_1.MPG没有音频。

ffmpeg 的输出是:

ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
  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
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, mpeg, from 'VTS_01_1.VOB':
  Duration: 00:00:07.79, start: 0.228178, bitrate: 917935 kb/s
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR 16:15 DAR 4:3], max. 9100 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
[mpeg @ 0x1c05a60] ac3 in MPEG-1 system streams is not widely supported, consider using the vob or the dvd muxer to force a MPEG-2 program stream.
Output #0, mpeg, to 'VTS_01_1.MPG':
  Metadata:
    encoder         : Lavf56.4.101
    Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, max. 9100 kb/s, 25 fps, 90k tbn, 25 tbc
    Stream #0:1: Audio: ac3, 48000 Hz, stereo, 256 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 6422 fps=0.0 q=-1.0 size=  151326kB time=00:04:16.71 bitrate=4829.0kbitsframe=12342 fps=12341 q=-1.0 size=  288334kB time=00:08:13.38 bitrate=4787.4kbiframe=17950 fps=11966 q=-1.0 size=  419024kB time=00:11:57.48 bitrate=4784.3kbiframe=22323 fps=7459 q=-1.0 size=  521394kB time=00:14:52.30 bitrate=4786.8kbitframe=27246 fps=7800 q=-1.0 size=  637078kB time=00:18:09.09 bitrate=4792.0kbitframe=32097 fps=8038 q=-1.0 size=  748222kB time=00:21:23.07 bitrate=4777.2kbitframe=35360 fps=7870 q=-1.0 size=  824050kB time=00:23:33.49 bitrate=4775.8kbitframe=36444 fps=7811 q=-1.0 Lsize=  850006kB time=00:24:16.83 bitrate=4779.7kbits/s    
video:800615kB audio:45555kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.453322%

我对视频格式和上述通过谷歌找到的命令几乎一无所知。我希望仅从手册页就能掌握足够的知识来使用 ffmpeg,所以任何学习资源的提示都是额外的奖励!

答案1

使用

ffmpeg -i VTS_01_1.VOB -c:v copy -c:a copy -f dvd VTS_01_1.MPG

FFmpeg 的 MPEG 多路复用器默认创建 MPEG-1 程序流,它不接受 DVD 中存在的 AC3 音频。

答案2

如果相关,那么您可以指定流。流 #0:0[0x1bf]:数据:dvd_nav_packet - DVD 的菜单导航。即:

ffmpeg -i VTS_01_1.VOB -map 0:1 -map 0:2 -c:v copy -c:a copy -f dvd VTS_01_1.MPG

相关内容