[Ffmpeg-devel] Why I cannot get the results I want ???

Thomas Parmegiani thomasp
Tue Oct 31 18:27:20 CET 2006


> -----Message d'origine-----
> De : ffmpeg-devel-bounces at mplayerhq.hu
> [mailto:ffmpeg-devel-bounces at mplayerhq.hu]De la part de Michel Bardiaux
> Envoy? : mardi 31 octobre 2006 17:49
> ? : FFmpeg development discussions and patches
> Objet : Re: [Ffmpeg-devel] Why I cannot get the results I want ???
>
>
> Thomas Parmegiani wrote:
> > Hi all !
> >
> > I would like to implement ffmpeg library in my application to schedule
> > conversion tasks.
> > User will choose an encoding profile (type : Always MPEG2,
> constant bitrate
> > : 10->80 Mbs, GOP : I only, IP or IBBP (with fixed gop size)).
>
> These are VERY high bitrates. Why?

Because it is HD files. In fact I need a destination bitrate avallable
between 10->60Mbs.
>
> >
> > I tried first using ffmpeg command line but most of my encoding don't
> > produce that I want :
> >
> > - I cannot reach the desired constant bitrate :
> >
> > ffmpeg -i /G/test-50mbs.ts -minrate 25000K -maxrate 25000K -bufsize
> > 2500K -bt 1 -intra /G/test-25mbs-intra-only.ts
>
> Output messages please.

See this example :

This problems happens especially when I want I only GOP.

./ffmpeg -i /G/Partage/CrossHatch.m2v -intra -b 25000K -minrate
25000K -maxra
te 25000K -bufsize 2500K /G/TS/test.ts
FFmpeg version SVN-r6530, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-shared --disable-static --enable-memalign-hack --
disable-strip
  libavutil version: 49.0.1
  libavcodec version: 51.16.0
  libavformat version: 50.5.0
  built on Oct 18 2006 15:01:57, gcc: 3.4.2 (mingw-special)
Input #0, mpegvideo, from 'g:/Partage/CrossHatch.m2v':
  Duration: 00:00:14.8, start: 0.000000, bitrate: 19578 kb/s
  Stream #0.0, 1/25: Video: mpeg2video, yuv420p, 1920x1080, 1001/30000,
19574 kb/s, 29.97 fps(r)
Output #0, mpegts, to 'g:/TS/test.ts':
  Stream #0.0, 1/90000: Video: mpeg2video, yuv420p, 1920x1080, 1001/30000,
q=2-31, 25000 kb/s, 29.97 fps(c)
Stream mapping:
  Stream #0.0 -> #0.0
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow2 bitrate=68667.1kbits/s
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow4 bitrate=54994.9kbits/s
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow
[mpeg2video @ 10275000]rc buffer underflow7 bitrate=51563.7kbits/s
.
.
.
.
.

>
> And IIRC -bt is irrelevant for CBR.

Ok. Thanks.
>
> >
> > It does not work. I get too many buffer underflows and the
> final bitrate is
> > 4mbs instead of desired 25mbs.
>
> At least you explained what does not work. Many dont.
>
> > I tried to change bufsize value without any success.
>
> Aie, NOT so good, mention of unsuccessful tries but no command line, no
> output messages, no postmortem, no nothing.
>
> > Can anyone help me to find the correct command line to have the desired
> > constant bitrate ?
> >
> > - I cannot have a fixed gop size :
> >
> > ffmpeg -i /G/test-50mbs.ts -minrate 25000K -maxrate 25000K -bufsize
> > 2500K -bf 2 -g 12 -flags2 sgop /G/test-25mbs-intra-only.ts
> >
> > It works for some files I have but not all only a few. I have read somes
> > posts and someone wrote to set scenechange_threshold =
> 1000000000. It does
> > not fixed my problem.
> > Can anyone help me to find the correct command line to have a
> fixed gop size
> > ?
>
> How do you know you dont have a fixed GOP size? What tool did you use?

I use Elecard Stream eye tool application. I attached a capture (GOP.jpg)
which corresponds to :

$ ./ffmpeg -i /G/TS/bm-40.ts -g 12 -bf 2 -flags2 sgop /G/TS/test.ts
FFmpeg version SVN-r6530, Copyright (c) 2000-2006 Fabrice Bellard, et al.
  configuration:  --enable-shared --disable-static --enable-memalign-hack --
disable-strip
  libavutil version: 49.0.1
  libavcodec version: 51.16.0
  libavformat version: 50.5.0
  built on Oct 18 2006 15:01:57, gcc: 3.4.2 (mingw-special)

Seems that stream 0 comes from film source: 25.00 (25025/1001) -> 25.00
(25/1)
Input #0, mpegts, from 'g:/TS/bm-40.ts':
  Duration: 00:00:02.3, start: 0.440000, bitrate: 46748 kb/s
  Stream #0.0[0x21], 1/90000: Video: mpeg2video, yuv420p, 1920x1080, 1/25,
40000 kb/s, 25.00 fps(r)
  Stream #0.1[0x24], 1/90000: Audio: mp2, 48000 Hz, stereo, 256 kb/s
Output #0, mpegts, to 'g:/TS/test.ts':
  Stream #0.0, 1/90000: Video: mpeg2video, yuv420p, 1920x1080, 1/25, q=2-31,
200 kb/s, 25.00 fps(c)
  Stream #0.1, 1/90000: Audio: mp2, 48000 Hz, stereo, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
[mpeg2video @ 10275000]ac-tex damaged at 63 14trate=5707.5kbits/s
[mpeg2video @ 10275000]Warning MVs not available
[mpeg2video @ 10275000]concealing 6440 DC, 6440 AC, 6440 MV errors
frame=   61 q=31.0 Lsize=    1572kB time=2.2 bitrate=5770.7kbits/s
video:1260kB audio:17kB global headers:0kB muxing overhead 23.115698%


>
> >
> > I am novice with MPEG2 format. And I am wonder if it possible to have a
> > destination file according the profile I choose, in a very
> simply way. If
> > not, will I have to play with all paramters such as qmin, qmax,
> max_qdiff,
> > bufsize... until I get the target format I want ?
>
> The priority should be to explain why you want such a profile.

The purpose is to convert any video format to MPEG2 streams for a hardware
SD/HD player.
User will select an encoding profile (ie I want only I only encoded file at
25Mbs) and add will add tasks.
Then my application would use ffmpeg library to convert these files and
transfer resulted files to the destination hardware device player.
I don't want the user has to set some "difficult to understand" values like
qmin, qmax, threshold, etc... It has to be simple for user who only wants to
play his files to the device.

Another questions :

-I tried to access to ftp to upload a file but I cannot create create folder
or upload any file (It seems that I don't have the right access) Can you
help me ?

- You already told me to do not top post. I hope it will be ok with this
post. Which application can I use on windows to read email from this mailing
list ? Because using outlook it is very hard...

Thakns for your answers...
>
> >
> > Thanks in advance for your clarifications...
> >
> > Best Regards,
> >
> > Thomas.P
>
>
> --
> Michel Bardiaux
> R&D Director
> T +32 [0] 2 790 29 41
> F +32 [0] 2 790 29 02
> E mailto:mbardiaux at mediaxim.be
>
> Mediaxim NV/SA
> Vorstlaan 191 Boulevard du Souverain
> Brussel 1160 Bruxelles
> http://www.mediaxim.com/
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>
> __________ Information NOD32 1.1845 (20061031) __________
>
> Ce message a ete verifie par NOD32 Antivirus System.
> http://www.nod32.com
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GOP.jpg
Type: image/jpeg
Size: 32243 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061031/9a8f65e3/attachment.jpg>



More information about the ffmpeg-devel mailing list