Opened 13 years ago

Closed 12 years ago

#387 closed defect (fixed)

ffmpeg '-profile baseline' no longer works with libx264

Reported by: Andrew Wason Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Recent ffmpeg seems to be parsing the libavcodec/libx264.c "-profile" codec option as the "-profile" option defined in libavcodec/options.c

So "-profile baseline" is eval'ed and fails to parse.

$ ./ffmpeg -i /tmp/in.avi -vcodec libx264 -profile baseline -y /tmp/out.mp4                                        ffmpeg version N-31788-g0d4ea7b, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 10 2011 01:45:04 with gcc 4.4.3
  configuration: --extra-cflags=-I/opt/motionbox/foundation/6.2.2-2-gee5a36a-dirty/include --extra-ldflags=-L/opt/motionbox/foundation/6.2.2-2-gee5a36a-dirty/lib --enable-libx264 --enable-gpl
  libavutil    51. 11. 1 / 51. 11. 1
  libavcodec   53. 10. 0 / 53. 10. 0
  libavformat  53.  6. 0 / 53.  6. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 28. 1 /  2. 28. 1
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, avi, from '/tmp/in.avi':
  Duration: 00:00:29.98, start: 0.000000, bitrate: 40887 kb/s
    Stream #0.0: Video: fraps, yuvj420p, 640x512, 60 fps, 60 tbr, 60 tbn, 60 tbc
    Stream #0.1: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
[buffer @ 0x2bd0680] w:640 h:512 pixfmt:yuvj420p tb:1/1000000 sar:0/1 sws_param:
[libx264 @ 0x2bcee80] Default settings detected, using medium profile
[libx264 @ 0x2bcee80] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2
[libx264 @ 0x2bcee80] profile Constrained Baseline, level 3.1
[libx264 @ 0x2bcee80] 264 - core 116 0b9c261 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[NULL @ 0x2bd5e60] [Eval @ 0x7fffa8a577d0] Undefined constant or missing '(' in 'baseline'
[NULL @ 0x2bd5e60] Unable to parse option value "baseline"
[NULL @ 0x2bd5e60] Error setting option profile to value baseline.
Output #0, mp4, to '/tmp/out.mp4':
    Stream #0.0: Video: libx264, yuvj420p, 640x512, q=2-31, 200 kb/s, 90k tbn, 60 tbc
    Stream #0.1: Audio: aac, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height

Change History (9)

comment:1 by Carl Eugen Hoyos, 13 years ago

Status: newopen

Please add complete, uncut output of latest git head (your output is missing the version information).

comment:2 by styleproject, 13 years ago

I don't have a linux machine right now, but same problem here with the latest packaged Windows x64 static build (N-31774-g6c4e9ca). But it works fine if I turn off audio transcoding with "-an"

C:\Users\user\Desktop>ffmpeg -i d:\video\test.avi -acodec aac -ab 192k -vcodec l
ibx264 -profile baseline -crf 21 -level 30 -f ipod -s 320x136 -y -t 720 -strict
experimental "test.m4v"
ffmpeg version N-31774-g6c4e9ca, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug  6 2011 22:25:16 with gcc 4.6.1
  configuration: --enable-gpl --enable-version3 --enable-memalign-hack --enable-
runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libo
pencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --
enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger
 --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enabl
e-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil    51. 11. 1 / 51. 11. 1
  libavcodec   53.  9. 1 / 53.  9. 1
  libavformat  53.  6. 0 / 53.  6. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 28. 0 /  2. 28. 0
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, avi, from 'd:\video\test.avi':
  Duration: 01:58:28.89, start: 0.000000, bitrate: 1560 kb/s
    Stream #0.0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 720x306 [SAR 1
:1 DAR 40:17], 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
[buffer @ 0000000001961380] w:720 h:306 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_
param:
[scale @ 0000000001A23200] w:720 h:306 fmt:yuv420p -> w:320 h:136 fmt:yuv420p fl
ags:0x4
[libx264 @ 0000000001A5D000] Default settings detected, using medium profile
[libx264 @ 0000000001A5D000] using SAR=1/1
[libx264 @ 0000000001A5D000] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64

[libx264 @ 0000000001A5D000] profile Constrained Baseline, level 3.0
[libx264 @ 0000000001A5D000] 264 - core 116 r2044 392e762 - H.264/MPEG-4 AVC cod
ec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 r
ef=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed
_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pski
p=1 chroma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=23
 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60
 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[NULL @ 0000000001A5E780] [Eval @ 000000000022EA30] Undefined constant or missin
g '(' in 'baseline'
[NULL @ 0000000001A5E780] Unable to parse option value "baseline"
[NULL @ 0000000001A5E780] Error setting option profile to value baseline.
Output #0, ipod, to 'test.m4v':
    Stream #0.0: Video: libx264, yuv420p, 320x136 [SAR 1:1 DAR 40:17], q=2-31, 2
00 kb/s, 90k tbn, 23.98 tbc
    Stream #0.1: Audio: aac, 48000 Hz, stereo, s16, 192 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.1 - maybe incorrect parameters
such as bit_rate, rate, width or height

comment:3 by Andrew Wason, 13 years ago

Sorry, was a copy/paste error that missed the version info:
ffmpeg version N-31789-g6481a36, Copyright (c) 2000-2011 the FFmpeg developers

It looks like "-profile" is being parsed as the aac audio profile option declared in libavcodec/options.c instead of the x264 profile option declared in libavcodec/libx264.c (which may be why it works when audio is turned off with -an)

comment:4 by llogan, 13 years ago

This was also mentioned on ffmpeg-devel: -profile option broken(?).

comment:5 by Carl Eugen Hoyos, 13 years ago

Work-around is to use -vprofile.

comment:6 by patronanejo, 13 years ago

As a practical matter, would it be insufficient to have ffmpeg pass -coder 0 to x264? Unless you intend to apply CABAC-dependent features, turning off entropy coding is one way to access baseline profile.

Version 1, edited 13 years ago by patronanejo (previous) (next) (diff)

comment:7 by Carl Eugen Hoyos, 13 years ago

@patronanejo: Does -vprofile baseline not work for you?

comment:8 by zimbatm, 13 years ago

-vprofile works fine with on HEAD for me even if it's undocumented (unless the -profile option) when running ffmpeg -h

comment:9 by Michael Niedermayer, 12 years ago

Reproduced by developer: set
Resolution: fixed
Status: openclosed

will be fixed in my next git push

Note: See TracTickets for help on using tickets.