Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to stream mp4 file with ffmpeg:

ffmpeg -re -i '/home/alex/test.mp4' \
-vcodec libx264 -ab 128k -ac 2 -ar 44100 \
-r 25 -s 320x240 -vb 660k -f \
flv 'rtmp://192.168.1.24/live/stream0'

But I get this error:

Seems stream 0 codec frame rate differs from container frame rate: 2997.00 (2997/1) -> 23.98 (24000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/alex/test.mp4':
  Duration: 00:02:28.79, start: 0.000000, bitrate: 1143 kb/s
    Stream #0.0(und): Video: mpeg4, yuv420p, 856x368 [PAR 1:1 DAR 107:46], 23.98 tbr, 23.98 tbn, 2997 tbc
    Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16
Unknown encoder 'libx264'

I'm install ffmpeg from Debian repositoty:

$ cat /etc/debian_version 
6.0.7

Full console output:

alex@alex:~$ ffmpeg -re -i '/home/alex/test.mp4' -vcodec libx264 -ab 128k -ac 2 -ar 44100 -r 25 -s 320x240 -vb 660k -f flv 'rtmp://192.168.1.24/live/stream0'
FFmpeg version SVN-r0.5.10-4:0.5.10-1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.10-1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Feb 16 2013 09:22:58, gcc: 4.4.5

Seems stream 0 codec frame rate differs from container frame rate: 2997.00 (2997/1) -> 23.98 (24000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/alex/test.mp4':
  Duration: 00:02:28.79, start: 0.000000, bitrate: 1143 kb/s
    Stream #0.0(und): Video: mpeg4, yuv420p, 856x368 [PAR 1:1 DAR 107:46], 23.98 tbr, 23.98 tbn, 2997 tbc
    Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16
Unknown encoder 'libx264'

How can I specify ffmpeg to use libx264 decoder?

share|improve this question
2  
Please show the complete console output that results from your ffmpeg command. –  LordNeckbeard Apr 12 '13 at 4:45
    
I'm updated my questions. –  ymn Apr 12 '13 at 4:53

1 Answer 1

up vote 2 down vote accepted

Your ffmpeg build is missing --enable-libx264 from the configuration; meaning that it was not compiled to support the libx264 external encoding library. Also, ffmpeg version 0.5 is considered to be ancient, so I recommend that you either compile ffmpeg or use a recent static build. Builds are available for Linux, OS X, and Windows via links on the FFmpeg download page .It is recommended to use the latest version available because they are generally stable and development is very active.

You are scaling from 856x368 to 320x240, but this will stretch your video vertically. Using 320x138 will preserve your aspect ratio, but to automatically calculate a value you can use the scale filter instead of -s:

-vf scale=320:-1

The -1 will tell scale to automatically provide a value that will preserve aspect.

share|improve this answer
    
It works. Thanks a lot! –  ymn Apr 12 '13 at 5:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.