[FFmpeg-user] (mpeg2) how to set "audio delay relative to video" as 0 ?

linxs linxsy at gmail.com
Wed Sep 17 13:44:02 CEST 2014


Hi everybody,
I transcode other video to mpg2 video as following command:
ffmpeg -i <other video> -c:v mpeg2video -b:v 8000k -c:a mp2 -y 0.mpg

/****************************************************************************************************
/****************************************************************************************************
d:\>ffmpeg -i orig.mpg -c:v mpeg2video -c:a mp2 -y 0.mpg
ffmpeg version N-63439-g96470ca Copyright (c) 2000-2014 the FFmpeg
developers
  built on May 25 2014 22:01:51 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
--enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca
--enable-libfreetyp
e --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug
--enable-
libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libope
njpeg --enable-libopus --enable-librtmp --enable-libschroedinger
--enable-libsox
r --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 --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 86.100 / 52. 86.100
  libavcodec     55. 65.100 / 55. 65.100
  libavformat    55. 41.100 / 55. 41.100
  libavdevice    55. 13.101 / 55. 13.101
  libavfilter     4.  5.100 /  4.  5.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpeg, from 'orig.mpg':
  Duration: 00:00:15.00, start: 0.269611, bitrate: 8661 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv), 720x576 [SAR
16:1
5 DAR 4:3], max. 8000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s
[mpeg @ 04677680] 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
Output #0, mpeg, to '0.mpg':
  Metadata:
    encoder         : Lavf55.41.100
    Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 16:15 DAR 4:3],
q=2-31
, 200 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc55.65.100 mpeg2video
    Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
    Metadata:
      encoder         : Lavc55.65.100 mp2
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> mpeg2video)
  Stream #0:1 -> #0:1 (mp2 -> mp2)
Press [q] to stop, [?] for help
frame=  137 fps=0.0 q=31.0 size=     588kB time=00:00:05.40 bitrate=
892.0kbits/
frame=  282 fps=282 q=31.0 size=    1286kB time=00:00:11.22 bitrate=
938.8kbits/
frame=  375 fps=290 q=31.0 Lsize=    1744kB time=00:00:15.01 bitrate=
951.6kbits
/s
video:1023kB audio:704kB subtitle:0kB other streams:0kB global headers:0kB
muxin
g overhead: 0.974431%

/****************************************************************************************************
/****************************************************************************************************

I use MediaInfo.exe to view the ouput mpg, and get the result:

/****************************************************************************************************
/****************************************************************************************************
General
Complete name                            :
D:\1.project\1.HDPlayer\audiolevel\FM_MIRROR\loop\0.mpg
Format                                   : MPEG-PS
File size                                : 1.70 MiB
Duration                                 : 15s 24ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 951 Kbps

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main at Main
Format settings, BVOP                    : No
Format settings, Matrix                  : Default
Format settings, GOP                     : Variable
Duration                                 : 14s 960ms
Bit rate mode                            : Variable
Bit rate                                 : 548 Kbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 25.000 fps
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.053
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
Stream size                              : 1 001 KiB (57%)

Audio
ID                                       : 192 (0xC0)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Duration                                 : 15s 24ms
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Delay relative to video                  : -10ms

>>>>>>>>>  !!!!!!! how to make this "delay relative to video" value to
0ms?


Stream size                              : 704 KiB (40%)
/****************************************************************************************************
/****************************************************************************************************


More information about the ffmpeg-user mailing list