[FFmpeg-user] 50 Mbps Ifram mpg2 with scaling and pad --sync problem
Jim Shupert, Jr
jshupert at pps-inc.com
Fri Aug 2 18:46:59 CEST 2013
Friends,
I wish to take 720x486 Unc 8 bit rawVideo with 2 chn pcm audio
and make 50 mbps Iframe mpg2 422 1920x1080i with mpg2 audio
I realize that upScaling is not best - but I do need to in this situation.
I have something that I think is close but the audio goes out of sync.
I wonder why?
You will see I have my buffer set rather high - i did that to avoid
...
[mpeg @ 0x307afa0] buffer underflow i=0 bufi=354801 size=358510
[mpeg @ 0x307afa0] packet too large, ignoring buffer limits to mux it
[mpeg @ 0x307afa0] buffer underflow i=0 bufi=354801 size=358510
...
here is my command
jj at gagarin:~$ ffmpeg -i /media/data/z_parts/dog.avi -vf
"scale=1620:1080,pad=1920:1080:150:0:black" -pix_fmt yuv422p -c:v
mpeg2video -minrate 50000k -maxrate 50000k -b:v 50000k -intra -flags
+ildct+low_delay -g 1 -dc 10 -ps 1 -qmin 1 -qmax 3 -top 1 -bufsize
5000000 -rc_init_occupancy 2000000 -rc_buf_aggressivity 0.25 -c:a mp2
-async 1 -b:a 224k -ar 48000 -ac 2 /media/data/jtest/dog-3a_1080i.mpg
jj at gagarin:~$ ffmpeg -i /media/data/z_parts/dog.avi -vf
"scale=1620:1080,pad=1920:1080:150:0:black" -pix_fmt yuv422p -c:v
mpeg2video -minrate 50000k -maxrate 50000k -b:v 50000k -intra -flags
+ildct+low_delay -g 1 -dc 10 -ps 1 -qmin 1 -qmax 3 -top 1 -bufsize
5000000 -rc_init_occupancy 2000000 -rc_buf_aggressivity 0.25 -c:a mp2
-async 1 -b:a 224k -ar 48000 -ac 2 /media/data/jtest/dog-3a_1080i.mpg
ffmpeg version git-2012-09-24-fd63c2f Copyright (c) 2000-2012 the FFmpeg
developers
built on Sep 24 2012 14:09:13 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
--enable-version3 --enable-x11grab
libavutil 51. 73.101 / 51. 73.101
libavcodec 54. 58.100 / 54. 58.100
libavformat 54. 28.101 / 54. 28.101
libavdevice 54. 2.101 / 54. 2.101
libavfilter 3. 17.100 / 3. 17.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[avi @ 0x28b5240] non-interleaved AVI
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, avi, from '/media/data/z_parts/dog.avi':
Duration: 00:00:05.03, start: 0.000000, bitrate: 170941 kb/s
Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 720x486,
29.97 tbr, 29.97 tbn, 29.97 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz,
stereo, s16, 1536 kb/s
File '/media/data/jtest/dog-3a_1080i.mpg' already exists. Overwrite ? [y/N] y
-async is forwarded to lavfi similarly to -af
aresample=min_comp=0.001:min_hard_comp=0.100000.
Output #0, mpeg, to '/media/data/jtest/dog-3a_1080i.mpg':
Metadata:
encoder : Lavf54.28.101
Stream #0:0: Video: mpeg2video, yuv422p, 1920x1080, q=1-3, 50000 kb/s,
90k tbn, 29.97 tbc
Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 224 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> mpeg2video)
Stream #0:1 -> #0:1 (pcm_s16le -> mp2)
Press [q] to stop, [?] for help
[mpeg2video @ 0x28b6800] rc buffer underflow
Last message repeated 24 times
frame= 25 fps=0.0 q=24.8 size= 6190kB time=00:00:00.83
bitrate=60789.4kbitsrc buffer underflow
[mpeg2video @ 0x28b6800] rc buffer underflow
Last message repeated 25 times
frame= 52 fps= 51 q=24.8 size= 13722kB time=00:00:01.73
bitrate=64787.5kbitsrc buffer underflow
[mpeg2video @ 0x28b6800] rc buffer underflow
Last message repeated 25 times
frame= 79 fps= 52 q=24.8 size= 21908kB time=00:00:02.63
bitrate=68085.2kbitsrc buffer underflow
[mpeg2video @ 0x28b6800] rc buffer underflow
Last message repeated 25 times
frame= 106 fps= 52 q=24.8 size= 29746kB time=00:00:03.53
bitrate=68896.9kbitsrc buffer underflow
[mpeg2video @ 0x28b6800] rc buffer underflow
Last message repeated 24 times
frame= 132 fps= 52 q=24.8 size= 37322kB time=00:00:04.40
bitrate=69417.4kbitsrc buffer underflow
[mpeg2video @ 0x28b6800] rc buffer underflow
Last message repeated 17 times
frame= 151 fps= 52 q=24.8 Lsize= 44048kB time=00:00:05.03
bitrate=71618.7kbits/s
video:43755kB audio:138kB subtitle:0 global headers:0kB muxing overhead
0.353431%
I notice the
-async is forwarded to lavfi similarly to -af
aresample=min_comp=0.001:min_hard_comp=0.100000.
I am uncertain as to the wisdom of that....
This cmd does make a file ; and I think it is ok except for the audio sync
problem
note: i added the -async 1 in attempt to correct the sync.
Thank you
More information about the ffmpeg-user
mailing list