VideoHelp.com Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Member
    Join Date: May 2007
    Location: Germany
    Hi!

    I already was searching for a solution to this problem. There are many posts all over the internet with the same problem but no solution.

    So maybe you could help me.

    Whenever I try to use x264 to encode a video with ffmpeg an my Snow Leopard MacBook 1,1 ffmpeg stops and tells me:

    Code:
    Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
    The parameters don't seem to affect this. No matter what I do, the error remains. For example
    Code:
    -vcodec libx264 -b 1024k
    results in the above error. Even
    Code:
    -vcodec copy
    leads to the error (if the source is H.264/AVC of course).

    I compiled ffmpeg and x264 by my own.

    For x264 I used the snapshot of "x264-snapshot-20090926-2245" but even with the latest one (x264-snapshot-20091015-2245) I had the same problems. I had to use the
    Code:
    --disable-asm
    configure option.

    The version and configure options amoung other information regarding ffmpeg you may see here:

    Code:
    $ ffmpeg -version
    FFmpeg version SVN-r20028, Copyright (c) 2000-2009 Fabrice Bellard, et al.
      built on Oct 16 2009 03:31:04 with gcc 4.2.1 (Apple Inc. build 5646)
      configuration: --enable-pthreads --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-gpl --enable-libxvid --enable-libx264 --enable-nonfree --enable-libfaac --enable-libfaad
      libavutil     50. 3. 0 / 50. 3. 0
      libavcodec    52.36. 0 / 52.36. 0
      libavformat   52.39. 0 / 52.39. 0
      libavdevice   52. 2. 0 / 52. 2. 0
      libswscale     0. 7. 1 /  0. 7. 1
    FFmpeg SVN-r20028
    libavutil     50. 3. 0 / 50. 3. 0
    libavcodec    52.36. 0 / 52.36. 0
    libavformat   52.39. 0 / 52.39. 0
    libavdevice   52. 2. 0 / 52. 2. 0
    libswscale     0. 7. 1 /  0. 7. 1
    I don't know why it worked on Leopard. I don't know what I did differently back then :/
    Quote Quote  

  2. Member
    Join Date: Jun 2003
    Location: United States
    I don't suppose you'd want to use the H264 encoding already built in to your Mac? Try MPEG Streamclip, VideoMonkey or even QuickTime Player Pro (7).
    Quote Quote  

  3. Member
    Join Date: May 2007
    Location: Germany
    Yeah, you're right. Thank you, but I'd like to use ffmpeg (I wrote some scripts that rely on ffmpeg). And what bothers me...it worked before (on Leopard). Did I miss some dependencies (I did a clean install of Snow Leopard)? But I don't remember installing anything else than x264 and ffmpeg to encode H.264 video with ffmpeg on Leopard :/
    Quote Quote  

  4. Member
    Join Date: Jun 2003
    Location: United States
    I think your problem might be with the interaction of SL and ffmpeg. Who knows what Apple may have changed between L & SL? I think you're correct in your installation assumption (nothing extra should be needed).

    However, I just noticed that you compiled ffmpeg & x264 yourself. Have you tried using the pre-compiled versions instead? If they work, maybe it's something that went awry in the compiling.
    Quote Quote  

  5. Member
    Join Date: May 2007
    Location: Germany
    Now I tried the ffmpeg binary from the lates ffmpegX release. That one seems to work though of course linking to its own libs inside the ffmpegX bundle. Not really what I want :/

    I discovered, that there is no "libx264.dylib" in /usr/local/lib/ (only the "libx264.a"). Therefore otool returned no dynamic lib for x264.

    So! Hoping that was the reason for my problem I recompiled x264 with --enable-shared. Like I expected, it built the .dylib (what seems to be Mac OS X's equivalent to Linux's .so?).

    After recompiling ffmpeg as well, otool gives me:

    Code:
    $ otool -L /usr/local/bin/ffmpeg 
    /usr/local/bin/ffmpeg:
    	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
    	/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
    	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 123.0.0)
    	/usr/local/lib/libfaac.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    	/usr/local/lib/libfaad.2.dylib (compatibility version 3.0.0, current version 3.0.0)
    	/usr/local/lib/libmp3lame.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    	/usr/local/lib/libtheora.0.dylib (compatibility version 4.0.0, current version 4.10.0)
    	/usr/local/lib/libogg.0.dylib (compatibility version 7.0.0, current version 7.0.0)
    	/usr/local/lib/libvorbisenc.2.dylib (compatibility version 3.0.0, current version 3.6.0)
    	/usr/local/lib/libvorbis.0.dylib (compatibility version 5.0.0, current version 5.3.0)
    	/usr/local/lib/libx264.76.dylib (compatibility version 0.0.0, current version 0.0.0)
    Cool, but doesn't help at all. Same problem :/

    But! The compatibility version as well as the current version looks interesting for libx264 o_O
    Quote Quote  

  6. Member
    Join Date: Jun 2003
    Location: United States
    You're now going down such a technical route that the adhesive tape holding my glasses together has fallen off.
    *grin*


    I'll have to defer to others who may understand this techno-babble better than I.
    Quote Quote  

  7. Member
    Join Date: Jul 2007
    Location: France
    Add --arch=x86_64 in ./configure

    houdini
    Quote Quote  

  8. Member
    Join Date: May 2007
    Location: Germany
    @rumplestiltskin: *lol* ...but thank you anyway!

    @houdini2: I tried this. Same error message :/ ...but as far as I know the CPU in the first generation MacBooks (like mine) is 32bit, so I think the correct configure option is --arch=i386, which is the default :\
    Quote Quote  

  9. my configure command, used for SnowLeopard:
    "./configure --enable-postproc --enable-gpl --enable-pthreads --enable-static --disable-shared --enable-gray --enable-avfilter --enable-avfilter-lavf --enable-libx264 --extra-cflags=-m64 --extra-ldflags=-m64 --arch=x86_64"

    bye

    Edit: oops I didn't see that your processor wasn't 64bit, so -normally- you don't need to specify anything special (32bit is the default behavior)…
    Some drawings ? http://www.whynotflores.com/. A software for DV, DVD-Video, HD files (AVCHD/…): http://www.movieconverter-studio.com/ 1.6 (2010/08)
    Quote Quote  

  10. Member
    Join Date: May 2007
    Location: Germany
    Thank you all. I'm a bit confused about all the error messages I get. At least I could find the reason for the error I described above:

    Obviously I have to use a preset for encoding with x264 (in Leopard I was able to encode without this). For example:

    Code:
    -vpre hq
    So, with the preset setting I can encode with x264. But that actually isn't (all) what I want to do, because my source file already is encoded in H.264. Even the audio stream already is encoded in the codec of my choice: AC3. I just want to change the container from MKV to MP4:

    Code:
    $ ffmpeg -i video.mkv -vcodec copy -acodec copy video.mp4
    but, what I get is a similar error message to the above one:

    Code:
    Could not write header for output file #0 (incorrect codec parameters ?)
    Does ffmpeg fail in putting AC3 into the MP4 container? I know, initially MP4 did not support AC3 streams, but over a year ago they officially allowed AC3 to be enclosed in an MP4 (see http://en.wikipedia.org/wiki/Compari...tainer_formats). So I expect ffmpeg to be aware of that and fulfill my wish!

    Do I have to to specify any parameters to pack AC3 into MP4?

    Because this is off topic, I opened another thread: http://forum.videohelp.com/topic374557.html
    Quote Quote  




Similar Threads

  1. mencoder x264 vs libavcodec for h.264 encoding
    By chconnor in forum Video Conversion
    Replies: 0
    Last Post: 2nd Mar 2011, 15:31
  2. Empty audio files when converting MPEG2 with h.264 mencoder or h.264 x264
    By doctormelodious in forum ffmpegX general discussion
    Replies: 3
    Last Post: 4th Jul 2010, 08:12
  3. I can't figure out how to use the h.264 (x264) codec!
    By Tahlos in forum Newbie / General discussions
    Replies: 9
    Last Post: 15th Jun 2010, 18:34
  4. X264 or H.264
    By user123456 in forum Newbie / General discussions
    Replies: 9
    Last Post: 25th May 2009, 16:21
  5. HDTV(H.264) to x264
    By kornhulio in forum DVB / HDTV
    Replies: 30
    Last Post: 4th Jan 2008, 16:37
Search   Contact us   About   Advertise   Forum   RSS Feeds   Statistics   Tools