[FFmpeg-user] Problem encoding raw data frames using libx264 on Mac OS

inge inge.becht91 at gmail.com
Mon Jan 12 17:53:29 CET 2015


I have written a program in which I call ffmpeg (the  binary
<http://ffmpegmac.net/>   for Snow Leopard) to encode raw data frames using
the following command:

ffmpeg -r 24 -pix_fmt rgba -s 1280x720 -f rawvideo -y -i - -vcodec libx264
-preset veryfast -y -crf 15 -vf vflip OutputFile.mp4

Ffmpeg outputs as follows:

ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Dec 30 2014 11:31:18 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads
--enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx
--enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264
--enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb
--enable-filters --enable-libgsm --enable-libvidstab --enable-libx265
--arch=x86_64 --enable-runtime-cpudetect
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 13.100 / 56. 13.100
  libavformat    56. 15.102 / 56. 15.102
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, rawvideo, from 'pipe:':
  Duration: N/A, start: 0.000000, bitrate: 707788 kb/s
    Stream #0:0: Video: rawvideo (RGBA / 0x41424752), rgba, 1280x720, 707788
kb/s, 24 tbr, 24 tbn, 24 tbc
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7f8a9902da00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0x7f8a9902da00] profile High 4:4:4 Predictive, level 3.1, 4:4:4
8-bit
[libx264 @ 0x7f8a9902da00] 264 - core 142 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1
ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00
mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11
fast_pskip=1 chroma_qp_offset=6 threads=6 lookahead_threads=2
sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=24 scenecut=40
intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=15.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'Output.mp4':
  Metadata:
    encoder         : Lavf56.15.102
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p,
1280x720, q=-1--1, 24 fps, 12288 tbn, 24 tbc
    Metadata:
      encoder         : Lavc56.13.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
frame=   28 fps=0.0 q=20.0 size=     238kB time=00:00:00.25
bitrate=7807.0kbits/s    
frame=   50 fps= 49 q=20.0 size=     448kB time=00:00:01.16
bitrate=3149.0kbits/s    
frame=   71 fps= 46 q=20.0 size=     957kB time=00:00:02.04
bitrate=3840.3kbits/s    
frame=   91 fps= 44 q=20.0 size=    1440kB time=00:00:02.87
bitrate=4102.9kbits/s    
frame=  112 fps= 44 q=20.0 size=    1890kB time=00:00:03.75
bitrate=4128.6kbits/s    
frame=  133 fps= 43 q=20.0 size=    2356kB time=00:00:04.62
bitrate=4173.3kbits/s    
frame=  154 fps= 43 q=20.0 size=    2769kB time=00:00:05.50
bitrate=4123.6kbits/s    
frame=  174 fps= 43 q=20.0 size=    3169kB time=00:00:06.33
bitrate=4098.7kbits/s    
frame=  194 fps= 42 q=20.0 size=    3739kB time=00:00:07.16
bitrate=4273.7kbits/s    
frame=  213 fps= 42 q=20.0 size=    4448kB time=00:00:07.95
bitrate=4578.4kbits/s    
frame=  234 fps= 42 q=20.0 size=    5277kB time=00:00:08.83
bitrate=4894.0kbits/s    
frame=  256 fps= 42 q=20.0 size=    6172kB time=00:00:09.75
bitrate=5185.6kbits/s    
frame=  278 fps= 42 q=20.0 size=    7008kB time=00:00:10.66
bitrate=5381.8kbits/s    
frame=  300 fps= 42 q=20.0 size=    7765kB time=00:00:11.58
bitrate=5491.4kbits/s    
frame=  323 fps= 42 q=20.0 size=    8597kB time=00:00:12.54
bitrate=5615.7kbits/s    
frame=  346 fps= 42 q=20.0 size=    9231kB time=00:00:13.50
bitrate=5601.5kbits/s    
frame=  368 fps= 42 q=20.0 size=   10270kB time=00:00:14.41
bitrate=5835.9kbits/s    
frame=  391 fps= 43 q=20.0 size=   11061kB time=00:00:15.37
bitrate=5893.6kbits/s    
frame=  414 fps= 43 q=20.0 size=   11670kB time=00:00:16.33
bitrate=5853.2kbits/s    
frame=  434 fps= 42 q=20.0 size=   12167kB time=00:00:17.16
bitrate=5806.1kbits/s    
frame=  458 fps= 43 q=20.0 size=   12737kB time=00:00:18.16
bitrate=5743.5kbits/s    
frame=  482 fps= 43 q=20.0 size=   13240kB time=00:00:19.16
bitrate=5658.8kbits/s    
frame=  503 fps= 42 q=-1.0 Lsize=   14291kB time=00:00:20.87
bitrate=5608.3kbits/s    
video:14285kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.046953%
[libx264 @ 0x7f8a9902da00] frame I:3     Avg QP:13.76  size:163717
[libx264 @ 0x7f8a9902da00] frame P:203   Avg QP:16.30  size: 48967
[libx264 @ 0x7f8a9902da00] frame B:297   Avg QP:19.53  size: 14125
[libx264 @ 0x7f8a9902da00] consecutive B-frames:  8.5% 25.4% 38.2% 27.8%
[libx264 @ 0x7f8a9902da00] mb I  I16..4: 18.7% 17.8% 63.5%
[libx264 @ 0x7f8a9902da00] mb P  I16..4:  7.3%  3.8%  4.4%  P16..4: 32.0%
19.3% 12.5%  0.0%  0.0%    skip:20.6%
[libx264 @ 0x7f8a9902da00] mb B  I16..4:  1.5%  0.5%  0.3%  B16..8: 19.1%
11.2%  3.4%  direct: 7.0%  skip:57.0%  L0:37.8% L1:44.7% BI:17.5%
[libx264 @ 0x7f8a9902da00] 8x8 transform intra:23.5% inter:24.7%
[libx264 @ 0x7f8a9902da00] coded y,u,v intra: 50.7% 24.8% 22.3% inter: 19.6%
6.2% 5.5%
[libx264 @ 0x7f8a9902da00] i16 v,h,dc,p: 31% 51% 14%  4%
[libx264 @ 0x7f8a9902da00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 41% 20%  2% 
2%  3%  3%  3%  3%
[libx264 @ 0x7f8a9902da00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 42% 15%  3% 
4%  4%  4%  3%  4%
[libx264 @ 0x7f8a9902da00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7f8a9902da00] kb/s:5583.16

Everything seems to be working fine, except the output is a video that only
shows black, for the amount of time that has been encoded. I've changed the
frame rate and resolution, but that doesn't help.

I've tried encoding raw data frames using mpeg1 as well using the following
command:

ffmpeg -r 24 -pix_fmt rgba -s 1280x720 -f rawvideo -y -i - -vcodec
mpeg1video -qscale 4 -bufsize 500KB -maxrate 5000KB -vf vflip Output.mpeg

and that /does/ work. I can also encode the output mpeg1 video using x264,
so the problem seems to be the raw data.

Does anyone have an idea what the problem might be?




--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Problem-encoding-raw-data-frames-using-libx264-on-Mac-OS-tp4668830.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list