[FFmpeg-user] Discrepancy in lengths of audio/video track
Barnett, Phillip
PHILLIP.BARNETT at ITN.CO.UK
Thu Mar 14 19:25:04 CET 2013
Hi,
I have a problem when using ffmpeg to create files for an Avid system – I seem unable to create audio and video mxf files of exactly the same length, and newer Avid systems refuse to recognise mxf files which are not exactly matching. All my audio files are short by one frame.
Here is a sequence of commands, where I create an XDCAM MXF file, then strip out the audio and video separately to demonstrate the difference in length.( I’ve tried using –async 1 and –vsync 1)
You’ll see Duration: 00:01:35.96 and Duration: 00:01:35.94 for the video and audio respectively.
Any ideas?
Phillip
C:\metamorph>ffmpeg -i "C:\5 news videos\Am I the only deaf teenager_.mp4" -thre
ads 8 -r 25 -vcodec mpeg2video -s 1920x1080 -vb 5000k -qscale 1 -pix_fmt yuv422p
-vtag xd5c -ar 48000 -async 1 intermediate.mxf
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:31:52 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\5 news videos\Am I the only deaf tee
nager_.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2012-03-28 09:41:36
Duration: 00:01:35.96, start: 0.000000, bitrate: 1713 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720,
1558 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 15
1 kb/s
Metadata:
creation_time : 2012-03-28 09:41:36
handler_name : IsoMedia File Produced by Google, 5-11-2011
Please use -q:a or -q:v, -qscale is ambiguous
File 'intermediate.mxf' already exists. Overwrite ? [y/N] y
-async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.
100000:first_pts=0.
Output #0, mxf, to 'intermediate.mxf':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf55.0.100
Stream #0:0(und): Video: mpeg2video (xd5c / 0x63356478), yuv422p, 1920x1080,
q=2-31, 5000 kb/s, 25 tbn, 25 tbc
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Metadata:
creation_time : 2012-03-28 09:41:36
handler_name : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg2video)
Stream #0:1 -> #0:1 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
frame= 56 fps=0.0 q=1.0 size= 1384kB time=00:00:02.16 bitrate=5247.1kbits/s
frame= 110 fps=108 q=1.0 size= 3690kB time=00:00:04.41 bitrate=6853.1kbits/s
frame= 162 fps=107 q=1.0 size= 5267kB time=00:00:06.40 bitrate=6741.1kbits/s
frame= 216 fps=107 q=1.0 size= 7947kB time=00:00:08.80 bitrate=7398.0kbits/s
frame= 268 fps=106 q=1.0 size= 11108kB time=00:00:10.75 bitrate=8464.7kbits/s
frame= 312 fps=103 q=1.0 size= 18743kB time=00:00:12.70 bitrate=12088.8kbits/
frame= 356 fps=100 q=1.0 size= 26290kB time=00:00:14.16 bitrate=15205.5kbits/
frame= 405 fps=100 q=1.0 size= 30484kB time=00:00:16.18 bitrate=15430.4kbits/
frame= 457 fps=101 q=1.0 size= 33665kB time=00:00:18.55 bitrate=14865.3kbits/
frame= 504 fps=100 q=1.0 size= 39877kB time=00:00:20.50 bitrate=15933.0kbits/
frame= 553 fps= 99 q=1.0 size= 45148kB time=00:00:22.45 bitrate=16472.2kbits/
frame= 604 fps=100 q=1.0 size= 49449kB time=00:00:24.40 bitrate=16599.2kbits/
frame= 642 fps= 98 q=1.0 size= 59503kB time=00:00:25.86 bitrate=18844.8kbits/
frame= 699 fps= 99 q=1.0 size= 61114kB time=00:00:28.30 bitrate=17687.6kbits/
frame= 749 fps= 99 q=1.0 size= 64206kB time=00:00:30.25 bitrate=17384.6kbits/
frame= 799 fps= 99 q=1.0 size= 67553kB time=00:00:32.20 bitrate=17183.2kbits/
frame= 849 fps= 99 q=1.0 size= 70122kB time=00:00:34.38 bitrate=16704.4kbits/
frame= 901 fps= 99 q=1.0 size= 72864kB time=00:00:36.52 bitrate=16342.3kbits/
frame= 956 fps=100 q=1.0 size= 75169kB time=00:00:38.45 bitrate=16014.5kbits/
frame= 1009 fps=100 q=1.0 size= 77470kB time=00:00:40.84 bitrate=15538.1kbits/
frame= 1060 fps=100 q=1.0 size= 79992kB time=00:00:42.77 bitrate=15321.0kbits/
frame= 1110 fps=100 q=1.0 size= 82744kB time=00:00:44.69 bitrate=15164.9kbits/
frame= 1159 fps=100 q=1.0 size= 85705kB time=00:00:46.62 bitrate=15058.2kbits/
frame= 1208 fps=100 q=1.0 size= 89307kB time=00:00:48.52 bitrate=15075.5kbits/
frame= 1257 fps=100 q=1.0 size= 92220kB time=00:00:50.47 bitrate=14965.8kbits/
frame= 1308 fps=100 q=1.0 size= 95160kB time=00:00:52.84 bitrate=14750.8kbits/
frame= 1358 fps=100 q=1.0 size= 98403kB time=00:00:54.77 bitrate=14716.8kbits/
frame= 1408 fps=100 q=1.0 size= 102014kB time=00:00:56.70 bitrate=14738.3kbits/
frame= 1459 fps=100 q=1.0 size= 104673kB time=00:00:58.60 bitrate=14631.0kbits/
frame= 1509 fps=100 q=1.0 size= 107643kB time=00:01:00.53 bitrate=14567.2kbits/
frame= 1559 fps=100 q=1.0 size= 110750kB time=00:01:02.92 bitrate=14417.9kbits/
frame= 1610 fps=100 q=1.0 size= 113658kB time=00:01:04.85 bitrate=14356.9kbits/
frame= 1660 fps=100 q=1.0 size= 116685kB time=00:01:06.78 bitrate=14313.8kbits/
frame= 1708 fps= 99 q=1.0 size= 120114kB time=00:01:08.68 bitrate=14326.0kbits/
frame= 1757 fps= 99 q=1.0 size= 123243kB time=00:01:10.61 bitrate=14298.1kbits/
frame= 1811 fps=100 q=1.0 size= 125306kB time=00:01:13.00 bitrate=14061.2kbits/
frame= 1864 fps=100 q=1.0 size= 127866kB time=00:01:14.93 bitrate=13979.3kbits/
frame= 1914 fps=100 q=1.0 size= 133417kB time=00:01:16.85 bitrate=14220.5kbits/
frame= 1970 fps=100 q=1.0 size= 135156kB time=00:01:19.24 bitrate=13971.0kbits/
frame= 2025 fps=100 q=1.0 size= 136952kB time=00:01:21.19 bitrate=13816.6kbits/
frame= 2075 fps=100 q=1.0 size= 140789kB time=00:01:23.56 bitrate=13801.2kbits/
frame= 2126 fps=100 q=1.0 size= 143605kB time=00:01:25.49 bitrate=13759.9kbits/
frame= 2172 fps=100 q=1.0 size= 148848kB time=00:01:27.42 bitrate=13947.9kbits/
frame= 2217 fps=100 q=1.0 size= 152869kB time=00:01:28.86 bitrate=14092.6kbits/
frame= 2265 fps=100 q=1.0 size= 156314kB time=00:01:30.76 bitrate=14107.9kbits/
frame= 2316 fps=100 q=1.0 size= 158947kB time=00:01:33.18 bitrate=13973.7kbits/
frame= 2368 fps=100 q=1.0 size= 161546kB time=00:01:35.08 bitrate=13917.9kbits/
frame= 2399 fps=100 q=1.0 Lsize= 162921kB time=00:01:35.94 bitrate=13910.5kbits
/s
video:141786kB audio:17990kB subtitle:0 global headers:0kB muxing overhead 1.968
976%
C:\metamorph>ffmpeg -i intermediate.mxf -an -vcodec copy video.mxf
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:31:52 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mxf, from 'intermediate.mxf':
Metadata:
timecode : 00:00:00:00
Duration: 00:01:35.96, start: 0.000000, bitrate: 13908 kb/s
Stream #0:0: Video: mpeg2video (4:2:2), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9
], 25 fps, 25 tbr, 25 tbn, 50 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
File 'video.mxf' already exists. Overwrite ? [y/N] y
Output #0, mxf, to 'video.mxf':
Metadata:
timecode : 00:00:00:00
encoder : Lavf55.0.100
Stream #0:0: Video: mpeg2video, yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-3
1, 25 fps, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
intermediate.mxf: Operation not permitted
frame= 2399 fps=0.0 q=-1.0 Lsize= 143722kB time=00:01:35.92 bitrate=12274.5kbit
s/s
video:141786kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.365510%
C:\metamorph>ffmpeg -i intermediate.mxf -vn -acodec copy audio.wav
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:31:52 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mxf, from 'intermediate.mxf':
Metadata:
timecode : 00:00:00:00
Duration: 00:01:35.96, start: 0.000000, bitrate: 13908 kb/s
Stream #0:0: Video: mpeg2video (4:2:2), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9
], 25 fps, 25 tbr, 25 tbn, 50 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
File 'audio.wav' already exists. Overwrite ? [y/N] y
Output #0, wav, to 'audio.wav':
Metadata:
ISMP : 00:00:00:00
ISFT : Lavf55.0.100
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, 153
6 kb/s
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Press [q] to stop, [?] for help
intermediate.mxf: Operation not permitted
size= 17990kB time=00:01:35.94 bitrate=1536.0kbits/s
video:0kB audio:17990kB subtitle:0 global headers:0kB muxing overhead 0.000543%
C:\metamorph>ffmpeg -i C:\metamorph\audio.wav
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:31:52 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[wav @ 000000000033a3e0] max_analyze_duration 5000000 reached at 5013333 microse
conds
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'C:\metamorph\audio.wav':
Metadata:
encoder : Lavf55.0.100
timecode : 00:00:00:00
Duration: 00:01:35.94, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16
, 1536 kb/s
At least one output file must be specified
C:\metamorph>ffmpeg -i C:\metamorph\video.mxf
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:31:52 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mxf, from 'C:\metamorph\video.mxf':
Metadata:
timecode : 00:00:00:00
Duration: 00:01:35.96, start: 0.000000, bitrate: 12269 kb/s
Stream #0:0: Video: mpeg2video (4:2:2), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9
], 25 fps, 25 tbr, 25 tbn, 50 tbc
At least one output file must be specified
[http://images.itn.co.uk/images/ITN_Master_blue.gif]
PHILLIP BARNETT
SERVER MANAGER
200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 207 430 4474
E PHILLIP.BARNETT at ITN.CO.UK
WWW.ITN.CO.UK
P Please consider the environment. Do you really need to print this email?
Please Note:
Any views or opinions are solely those of the author and do not necessarily represent those of Independent Television News Limited unless specifically stated. This email and any files attached are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error, please notify postmaster at itn.co.uk
Please note that to ensure regulatory compliance and for the protection of our clients and business, we may monitor and read messages sent to and from our systems.
More information about the ffmpeg-user
mailing list