[FFmpeg-devel] -profile option broken(?)

Stefano Sabatini stefano.sabatini-lala at poste.it
Sun Jul 31 01:06:54 CEST 2011


On date Saturday 2011-07-30 13:42:55 -0800, Lou encoded:
> On Wed, 20 Jul 2011 02:19:32 -0700
> Thomas Worth <dev at rarevision.com> wrote:
> 
> > On Wed, Jul 20, 2011 at 1:56 AM, Michael Niedermayer
> > <michaelni at gmx.at> wrote:
> > > On Tue, Jul 19, 2011 at 09:49:48AM +0200, Erik Slagter wrote:
> > >> On 19-07-11 00:27, Rodney Baker wrote:
> > >>> On Tue, 19 Jul 2011 02:15:04 Erik Slagter wrote:
> > >>>> There is something very fishy:
> > >>>>
> > >>>> This triggers the error:
> > >>>>
> > >>>> /home/erik/src/ffmpeg/ffmpeg -y -probesize 500000000 -threads 16
> > >>>> -i 00033.avi -vsync 0 -async 0 -profile high -vcodec libx264
> > >>>> -strict experimental -acodec aac -ac 2 -ar 48000 -ab 192k -f
> > >>>> mpegts 00033_tmp.ts
> > >>>>
> > >>>> when I move -profile high to the start like this:
> > >>>>
> > >>>> /home/erik/src/ffmpeg/ffmpeg -profile high -y -probesize
> > >>>> 500000000 -threads 16 -i 00033.avi -vsync 0 -async 0 -vcodec
> > >>>> libx264 -strict experimental -acodec aac -ac 2 -ar 48000 -ab
> > >>>> 192k -f mpegts 00033_tmp.ts
> > >>>>
> > >>>> there is no error.
> > >>>
> > >>> This probably belongs on the ffmpeg-user mailing list,
> > >>
> > >> I agree, but this looks like a bug and I am trying to fix it, or
> > >> at least pinpoint the patch that caused it.
> > >>
> > >>> but have you tried
> > >>> putting -profile after -vcodec libx264? The order of command-line
> > >>> options in ffmpeg is important.
> > >>
> > >> I know I know. The interesting part is
> > >>
> > >> - the command line I'm using used to work a few weeks ago
> > >> - this error message is completely bogus
> > >>
> > >> Also interesting is that git bisect can't locate the offending
> > >> patch, I guess that has something to do with the large imports
> > >> from "qatar".
> > >>
> > >> Still, my question remains, can anyone try this with a current
> > >> version of ffmpeg (x86_64), so I know if it's something I borked,
> > >> although I have an almost clean tree (a few totally unrelated
> > >> patches, they've been the same for months).
> > >
> > > I can confirm the issue.
> > > -vprofile high seems to work.
> > >
> > > with -profile, one could argue it affects audio too and i think
> > > thats where it fails.
> > > but i did not investigate this at all ...
> > 
> > I just happened to run into this too while encoding for Blu-ray and
> > for web. It does fail, but only when including audio as you mentioned.
> > My Blu-ray script runs fine because it only generates a video file,
> > but my web script fails because it includes a separate audio file on
> > the ffmpeg command line. I get the following error:
> > 
> > [NULL @ 0x101801800] [Eval @ 0x7fff5fbfe140] Undefined constant or
> > missing '(' in 'baseline'
> > [NULL @ 0x101801800] Unable to parse option value "baseline"
> > [NULL @ 0x101801800] Error setting option profile to value baseline.
> > 
> > This is on Mac OS X/darwin x86_64.
> 
> I can confirm this on a 32-bit Ubuntu Natty VM with:
> 
> ffmpeg -i IronMan.mkv -vcodec libx264 -preset medium -profile \
> baseline -crf 24 -strict experimental -acodec aac -y ~/output.mp4
> ffmpeg version N-31478-g5dc6bd8, Copyright (c) 2000-2011 the FFmpeg
> developers
>   built on Jul 30 2011 13:40:27 with gcc 4.5.2
>   configuration: --enable-gpl --enable-libx264
> ...
> [NULL @ 0xa194720] [Eval @ 0xbfc2e17c] Undefined constant or missing
> '(' in 'baseline' [NULL @ 0xa194720] Unable to parse option value
> "baseline" [NULL @ 0xa194720] Error setting option profile to value
> baseline.
> 
> ...and some users on ubuntuforums.org have mentioned the same issue.
> 
> 5dc6bd86f0f5cfffb44b47e6e916119f26b12091 bad
> 1885824b20a493d25db4b8e5397666e3a68f45f2 good
> 
> I'm not sure what it is from 5dc6bd86 that is causing the issue.

$ ffmpeg -i INPUT -profile high -vcodec libx264 -y OUT.mov

profile is an AVCodecContext option. avcodec_open2() works by first
looking in the private context for that option, otherwise it will look
in the shared codec context (AVCodecContext).

For libx264 profile is defined in the private option, with a valid
"high" value, for other codecs it will look in the global context and
will fail since "high" is not a valid value in the global context.

If you specify "-vprofile", it will look the option only for video
codecs, so it will work with libx264. The current system lacks of a
method for specifying the context where to apply an option, and can't
prevent such conflicts.

To make it worse, when the option is set in the global/private
context, the name of the codec is not yet set in the codec context, so
it will result a "NULL" context in the log message.
-- 
FFmpeg = Funny and Funny Mean Portentous Extreme Game


More information about the ffmpeg-devel mailing list