[FFmpeg-user] buffer problems with dvd encoding

Jim Shupert jshupert at pps-inc.com
Thu Oct 3 18:08:36 CEST 2013


On 10/2/2013 6:59 PM, Carl Eugen Hoyos wrote:
> Jim Shupert <jshupert <at> pps-inc.com> writes:
>
>> ffmpeg -y -i /media/data/cap/soc_1.avi -vf "yadif"
>> -vcodec mpeg2video -pix_fmt yuv420p -acodec mp2
>> -target ntsc-dvd -sample_fmt flt -minrate
>> 1000k -maxrate 6000k -bufsize 4096k -aspect 4:3
>> /media/SSD-015/SofC/SofC2.mpg
> Does the following work?
> ffmpeg -i soc_1.avi -vf yadif -target ntsc-dvd SofC2.mpg
>
> Carl Eugen

:: starts OK but hits a 'bad spot at 1:26 of a 1:40 file

ffmpeg -y -i /media/data/cap/soc_1.avi  -vf yadif -target ntsc-dvd
/media/SSD-015/SofC/SofC10e.mpg

  ffmpeg -y -i /media/data/cap/soc_1.avi  -vf yadif -target ntsc-dvd
/media/SSD-015/SofC/SofC10e.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 @ 0x2f2b240] non-interleaved AVI
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, avi, from '/media/data/cap/soc_1.avi':
   Duration: 00:01:40.26, start: 0.000000, bitrate: 226520 kb/s
     Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le, 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
Output #0, dvd, to '/media/SSD-015/SofC/SofC10e.mpg':
   Metadata:
     encoder         : Lavf54.28.101
     Stream #0:0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 6000 kb/s,
90k tbn, 29.97 tbc
     Stream #0:1: Audio: ac3, 48000 Hz, stereo, flt, 448 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (v210 -> mpeg2video)
   Stream #0:1 -> #0:1 (pcm_s16le -> ac3)
Press [q] to stop, [?] for help
frame=   23 fps=0.0 q=2.0 size=     162kB time=00:00:00.76
bitrate=1740.1kbits/sframe=   50 fps= 49 q=2.0 size=     358kB
time=00:00:01.65 bitrate=1768.1kbits/sframe=   75 fps= 49 q=2.0 size=
774kB time=00:00:02.52 bitrate=2513.5kbits/sframe=   99 fps= 48 q=2.0
size=    1562kB time=00:00:03.32 bitrate=3851.1kbits/sframe=  122 fps= 48
q=2.0 size=    2346kB time=00:00:04.09 bitrate=4698.1kbits/sframe=  145
fps= 47 q=2.0 size=    3160kB time=00:00:04.82 bitrate=5363.3kbits/sframe=
  165 fps= 46 q=2.0 size=    3808kB time=00:00:05.49
bitrate=5673.2kbits/sframe=  186 fps= 46 q=2.0 size=    4476kB
time=00:00:06.20 bitrate=5911.6kbits/sframe=  206 fps= 45 q=2.0 size=
5096kB time=00:00:06.87 bitrate=6072.5kbits/sframe=  220 fps= 43 q=2.0
size=    5524kB time=00:00:07.35 bitrate=6152.9kbits/sframe=  241 fps= 43
q=2.0 size=    6180kB time=00:00:08.05 bitrate=6282.2kbits/sframe=  261
fps= 42 q=2.0 size=    6818kB time=00:00:08.73 bitrate=6397.3kbits/sframe=
  282 fps= 42 q=2.0 size=    7494kB time=00:00:09.40
bitrate=6529.1kbits/sframe=  303 fps= 42 q=1.6 size=    8154kB
time=00:00:10.10 bitrate=6609.3kbits/sframe=  324 fps= 42 q=2.6 size=
8716kB time=00:00:10.81 bitrate=6604.7kbits/sframe=  345 fps= 42 q=2.4
size=    9282kB time=00:00:11.51 bitrate=6603.6kbits/sframe=  367 fps= 42
q=2.2 size=    9852kB

<snip>

frame= 2512 fps= 44 q=2.0 size=   37922kB time=00:01:23.83
bitrate=3705.6kbits/sframe= 2534 fps= 44 q=2.0 size=   38596kB
time=00:01:24.53 bitrate=3740.0kbits/sframe= 2556 fps= 44 q=2.0 size=
39556kB time=00:01:25.27 bitrate=3800.0kbits/sframe= 2577 fps= 44 q=2.0
size=   40400kB time=00:01:26.01 bitrate=3847.9kbits/src buffer underflow
[mpeg2video @ 0x2f53600] rc buffer underflow
     Last message repeated 3 times
frame= 2599 fps= 44 q=2.0 size=   41304kB time=00:01:26.71
bitrate=3902.0kbits/src buffer underflow
[mpeg2video @ 0x2f53600] rc buffer underflow
     Last message repeated 6 times
frame= 2619 fps= 44 q=2.0 size=   42126kB time=00:01:27.38
bitrate=3949.1kbits/src buffer underflow

so not a solution
__________________________

but,
This seems to have worked ------------note: minRate == maxRate == bRate

ffmpeg -y -i /media/data/cap/soc_1.avi -vf yadif -f dvd -vcodec mpeg2video
-pix_fmt yuv420p -target ntsc-dvd  -b:v 7000k -minrate 7000k -maxrate
7000k -bufsize 4096k -aspect 4:3  /media/SSD-015/SofC/SofC11.mpg

- and dvdauthor seems to have not puked on it - the disc is burning as i write this...

dvdauthor -x /media/SSD-015/SofC/SofC11.xml
DVDAuthor::dvdauthor, version 0.7.0.

INFO: default video format is NTSC
INFO: dvdauthor creating VTS
STAT: Picking VTS 01

STAT: Processing /media/SSD-015/SofC/SofC11.mpg...
STAT: VOBU 160 at 80MB, 1 PGCs
INFO: Video pts = 0.533 .. 100.800
STAT: VOBU 170 at 85MB, 1 PGCs
CHAPTERS: VTS[1/1] 0.000
INFO: Generating VTS with the following video attributes:
INFO: MPEG version: mpeg2
INFO: TV standard: ntsc
INFO: Aspect ratio: 4:3
INFO: Resolution: 720x480

STAT: fixed 170 VOBUs
INFO: dvdauthor creating table of contents
INFO: Scanning /media/SSD-015/dvd_product/soc//VIDEO_TS/VTS_01_0.IFO


so having minrate == maxrate is needed , maybe, what do you think?

I may need to do more testing to see if bufsize is needed.
I do bufsize of `high' -bufsize 4096k  not the standard -bufsize 1835k
___________

I would love to see where
-target ntsc-dvd   is fully defined. meaning what are all the details of
the various params that are encapsulated in that target.
And can I declare them all out in `long form` , meaning declare each - and
be able to tweek each.

where in the c code can i find that?  would love to know more.....
It is not in ffmpeg man ( which does have lots of good stuff )

Thanks Much!

js



More information about the ffmpeg-user mailing list