0

I'm trying to slice/cut/split a video using FFMPEG (command line).

It works for the video, but not for the audio.

What I mean is: The resulting video file ('the-video-file-1.mpg') renders video, but there's no sound, as in the original file.

It's like FFMPEG doesn't know how to read or write the AC3 codec (I assume, by looking at the console output).

Any idea how to resolve this?

me@my-box:~/backup$ ffmpeg -i the-video-file.mpg -vcodec copy -acodec copy -ss 00:00:00 -t 00:41:54 the-video-file-1.mpg ffmpeg version 3.3.3-2~ubuntu16.04.1~ppa1 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609 configuration: --prefix=/usr --extra-version='2~ubuntu16.04.1~ppa1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100 Input #0, mpeg, from 'the-video-file.mpg': Duration: 01:07:07.12, start: 0.230389, bitrate: 4728 kb/s Stream #0:0[0x1bf]: Data: dvd_nav_packet Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg, top first), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:2[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s [mpeg @ 0x55968b869880] VBV buffer size not set, using default size of 130KB If you want the mpeg file to be compliant to some specification Like DVD, VCD or others, make sure you set the correct buffer size [mpeg @ 0x55968b869880] 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 'the-video-file-1.mpg': Metadata: encoder : Lavf57.71.100 Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt470bg, top first), 720x576 [SAR 16:15 DAR 4:3], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s Stream mapping: Stream #0:1 -> #0:0 (copy) Stream #0:2 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 1640 fps=0.0 q=-1.0 size= 45284kB time=00:01:06.61 bitrate=5568.5kbits/frame= 2976 fps=2975 q=-1.0 size= 78484kB time=00:02:00.36 bitrate=5341.5kbitsframe= 4013 fps=2671 q=-1.0 size= 101906kB frame=62267 fps=1259 q=-1.0 Lsize= 1472858kB time=00:41:53.98 bitrate=4799.4kbits/s speed=50.8x trate=5038.6kbits/s speed= 111x video:1388209kB audio:77847kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.463944% 

1 Answer 1

1

The input file is a MPEG-2 Program Stream, but .mpg is also used for MPEG-1 Program Stream, so that's what ffmpeg defaults to creating.

Use

ffmpeg -i the-video-file.mpg -c copy -ss 00:00:00 -t 00:41:54 -f vob the-video-file-1.mpg 
1
  • Why would 'vob' work? I'd guess 'copy' would work, as it works on the original file. Anyway thanks! :) Commented May 1, 2018 at 15:16

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.