<div dir="ltr"><div><div><div><div><div>Hello,<br><br></div>I am trying to encode video in h264 using ffmpeg on laptop using laptop camera.<br></div>I have installed yasm on laptop and my problem begins with x264.<br><br></div>
While I am doing x264 configuration, I get this warning:<br><br>tejas@tejas-ubuntu:~/<div dir="ltr"><span style="color:rgb(0,0,255)">Documents/ffmpeg-sources/x264-</span><span style="color:rgb(0,0,255)">snapshot-20140226-2245$ ./configure --enable-static --enable-debug --enable-gprof</span><br>
<br><span style="color:rgb(255,153,0)"><span style="color:rgb(255,0,0)">Warning: AV_PIX_FMT_FLAG_RGB is missing from libavutil, update for swscale support<br>
Warning: libavformat is not supported without swscale support</span><br>platform: X86_64<br>system: LINUX<br>cli: yes<br>libx264: internal<br>shared: no<br>static: yes<br>asm: yes<br>
interlaced: yes<br>avs: avxsynth<br>lavf: no<br>ffms: no<br>mp4: gpac<br>gpl: yes<br>thread: posix<br>opencl: yes<br>filters: crop select_every <br>debug: yes<br>
gprof: yes<br>strip: no<br>PIC: no<br>bit depth: 8<br>chroma format: all<br>You can run 'make' or 'make fprofiled' now.</span></div><br></div> With this warning, x264 compiles without any error and now I enable x264 in ffmpeg configuration. Ffmpeg recognizes x264, but I get issues using x264 for encoding in ffmpeg. <br>
<br></div><div>The command I am using captures a h264 encoded video for 1minute. I ran this command twice and in the first instance it started capturing the video properly, but at 25sec it terminated encoding. Here is the output of that.<br>
<br><font color="#00ff00"><span style="color:rgb(0,0,255)">tejas@tejas-ubuntu:~/ffmpeg-sources/ffmpeg$
ffmpeg -y -f video4linux2 -i /dev/video0 -t 60 -c:v libx264 -pix_fmt
yuv420p -profile:v baseline -level 31 -b:v 600K -r 24 -g 72 -f hls
-hls_time 2 -hls_list_size 300 -s 640x360 640x360.m3u8<br>
The program 'ffmpeg' is currently not installed. You can install it by typing:<br>sudo apt-get install ffmpeg<br>tejas@tejas-ubuntu:~/ffmpeg-sources/ffmpeg$
./ffmpeg -y -f video4linux2 -i /dev/video0 -t 60 -c:v libx264 -pix_fmt
yuv420p -profile:v baseline -level 31 -b:v 600K -r 24 -g 72 -f hls
-hls_time 2 -hls_list_size 300 -s 640x360 640x360.m3u8<br>
ffmpeg version N-61046-g8b8ae29 Copyright (c) 2000-2014 the FFmpeg developers<br> built on Mar 2 2014 11:06:45 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)<br>
configuration: --enable-gpl --enable-gray --enable-runtime-cpudetect
--enable-bzlib --enable-gnutls --enable-libass --enable-libfaac
--enable-libfreetype --enable-libgsm --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libcdio --enable-libdc1394
--enable-libopenjpeg --enable-libpulse --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libv4l2 --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264
--enable-libxvid --enable-openal --enable-openssl --enable-zlib
--enable-nonfree --enable-version3 --extra-libs=-ldl<div class="im"><br>
libavutil 52. 66.100 / 52. 66.100<br> libavcodec 55. 52.102 / 55. 52.102<br> libavformat 55. 33.100 / 55. 33.100<br> libavdevice 55. 10.100 / 55. 10.100<br> libavfilter 4. 2.100 / 4. 2.100<br>
libswscale 2. 5.101 / 2. 5.101<br>
libswresample 0. 18.100 / 0. 18.100<br> libpostproc 52. 3.100 / 52. 3.100<br>Input #0, video4linux2,v4l2, from '/dev/video0':<br></div> Duration: N/A, start: 55158.824431, bitrate: 147456 kb/s<div class="im">
<br> Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc<br></div>
[libx264 @ 0x3082360] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2<br>[libx264 @ 0x3082360] profile Constrained Baseline, level 3.1<br>Output #0, hls, to '640x360.m3u8':<br> Metadata:<br> encoder : Lavf55.33.100<br>
Stream #0:0: Video: h264 (libx264), yuv420p, 640x360, q=-1--1, 600 kb/s, 90k tbn, 24 tbc<div class="im"><br>Stream mapping:<br> Stream #0:0 -> #0:0 (rawvideo -> libx264)<br>Press [q] to stop, [?] for help<br></div>
frame=
21 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=12 drop=8
frame= 33 fps= 33 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=17
drop=16 frame= 44 fps= 29 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A
dup=22 drop=25 frame= 56 fps= 28 q=25.0 size=N/A time=00:00:00.50
bitrate=N/A dup=23 drop=29 frame= 68 fps= 27 q=28.0 size=N/A
time=00:00:01.00 bitrate=N/A dup=26 drop=36 frame= 81 fps= 27 q=26.0
size=N/A time=00:00:01.54 bitrate=N/A dup=31 drop=43 frame= 93 fps= 26
q=25.0 size=N/A time=00:00:02.04 bitrate=N/A dup=32 drop=47 frame= 106
fps= 26 q=25.0 size=N/A time=00:00:02.58 bitrate=N/A dup=38 drop=56
frame= 119 fps= 26 q=26.0 size=N/A time=00:00:03.12 bitrate=N/A dup=41
drop=62 frame= 130 fps= 25 q=26.0 size=N/A time=00:00:03.58 bitrate=N/A
dup=45 drop=70 frame= 143 fps= 25 q=25.0 size=N/A time=00:00:04.12
bitrate=N/A dup=45 drop=73 frame= 156 fps= 25 q=25.0 size=N/A
time=00:00:04.66 bitrate=N/A dup=45 drop=75 frame= 167 fps= 25 q=25.0
size=N/A time=00:00:05.12 bitrate=N/A dup=47 drop=81 frame= 180 fps= 25
q=25.0 size=N/A time=00:00:05.66 bitrate=N/A dup=52 drop=87 frame= 191
fps= 25 q=26.0 size=N/A time=00:00:06.12 bitrate=N/A dup=52 drop=93
frame= 204 fps= 25 q=26.0 size=N/A time=00:00:06.66 bitrate=N/A dup=57
drop=97 frame= 217 fps= 25 q=26.0 size=N/A time=00:00:07.20 bitrate=N/A
dup=60 drop=101frame= 229 fps= 25 q=25.0 size=N/A time=00:00:07.70
bitrate=N/A dup=62 drop=106frame= 240 fps= 25 q=25.0 size=N/A
time=00:00:08.16 bitrate=N/A dup=63 drop=110frame= 255 fps= 25 q=25.0
size=N/A time=00:00:08.79 bitrate=N/A dup=66 drop=114frame= 267 fps= 25
q=26.0 size=N/A time=00:00:09.29 bitrate=N/A dup=68 drop=119frame= 275
fps= 24 q=26.0 size=N/A time=00:00:09.62 bitrate=N/A dup=73
drop=131frame= 290 fps= 25 q=26.0 size=N/A time=00:00:10.25 bitrate=N/A
dup=80 drop=136frame= 317 fps= 26 q=25.0 size=N/A time=00:00:11.37
bitrate=N/A dup=105 drop=13frame= 608 fps= 41 q=16.0 size=N/A
time=00:00:23.50 bitrate=N/A dup=395 drop=13frame= 608 fps= 40 q=-1.0
Lsize=N/A time=00:00:25.33 bitrate=N/A dup=395 drop=154 <br>
video:1336kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead -100.001610%<br>[libx264 @ 0x3082360] frame I:9 Avg QP:11.73 size: 41943<br>[libx264 @ 0x3082360] frame P:599 Avg QP:14.77 size: 1653<br>
[libx264 @ 0x3082360] mb I I16..4: 41.8% 0.0% 58.2%<br>[libx264 @ 0x3082360] mb P I16..4: 0.5% 0.0% 0.1% P16..4: 23.6% 3.7% 1.9% 0.0% 0.0% skip:70.2%<br>[libx264 @ 0x3082360] final ratefactor: 15.75<br>[libx264 @ 0x3082360] coded y,uvDC,uvAC intra: 53.2% 77.5% 63.0% inter: 5.7% 20.6% 1.9%<br>
[libx264 @ 0x3082360] i16 v,h,dc,p: 44% 14% 13% 29%<br>[libx264 @ 0x3082360] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 19% 17% 3% 5% 7% 6% 2% 4%<br>[libx264 @ 0x3082360] i8c dc,h,v,p: 61% 16% 19% 3%<br>[libx264 @ 0x3082360] ref P L0: 59.8% 20.7% 19.5%<br>
[libx264 @ 0x3082360] kb/s:431.89</span><br><span class=""></span></font><font color="#00ff00"><span style="color:rgb(0,0,255)">tejas@tejas-ubuntu:~/ffmpeg-sources/ffmpeg$<br><br><br></span></font></div><div><font color="#00ff00"><span style="color:rgb(0,0,255)"><font color="#000000">During the second instance, it again started capturing properly, but at 10sec it stopped capturing and freezed at that point. So, I presses ctrl+c to terminate and I got "av_interleaved_write_frame(): Immediate exit requested" message. Here is the log.<br>
<br></font></span></font><font color="#ff9900">tejas@tejas-ubuntu:~/ffmpeg-sources/ffmpeg$
./ffmpeg -y -f video4linux2 -i /dev/video0 -t 60 -c:v libx264 -pix_fmt
yuv420p -profile:v baseline -level 31 -b:v 600K -r 24 -g 72 -f hls
-hls_time 2 -hls_list_size 300 -s 640x360 640x360_.m3u8<div class="im"><br>
ffmpeg version N-61046-g8b8ae29 Copyright (c) 2000-2014 the FFmpeg developers<br></div> built on Mar 2 2014 11:46:19 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)<div class="im"><br>
configuration: --enable-gpl --enable-gray --enable-runtime-cpudetect
--enable-bzlib --enable-gnutls --enable-libass --enable-libfaac
--enable-libfreetype --enable-libgsm --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libcdio --enable-libdc1394
--enable-libopenjpeg --enable-libpulse --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libv4l2 --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264
--enable-libxvid --enable-openal --enable-openssl --enable-zlib
--enable-nonfree --enable-version3 --extra-libs=-ldl<br>
libavutil 52. 66.100 / 52. 66.100<br> libavcodec 55. 52.102 / 55. 52.102<br> libavformat 55. 33.100 / 55. 33.100<br> libavdevice 55. 10.100 / 55. 10.100<br> libavfilter 4. 2.100 / 4. 2.100<br>
libswscale 2. 5.101 / 2. 5.101<br>
libswresample 0. 18.100 / 0. 18.100<br> libpostproc 52. 3.100 / 52. 3.100<br>Input #0, video4linux2,v4l2, from '/dev/video0':<br></div> Duration: N/A, start: 60383.724088, bitrate: 147456 kb/s<div class="im">
<br> Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc<br></div>
[libx264 @ 0x2aac360] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2<br>[libx264 @ 0x2aac360] profile Constrained Baseline, level 3.1<br>Output #0, hls, to '640x360_.m3u8':<div class="im"><br> Metadata:<br> encoder : Lavf55.33.100<br>
Stream #0:0: Video: h264 (libx264), yuv420p, 640x360, q=-1--1, 600 kb/s, 90k tbn, 24 tbc<br>Stream mapping:<br> Stream #0:0 -> #0:0 (rawvideo -> libx264)<br>Press [q] to stop, [?] for help<br></div>frame=
32 fps=0.5 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A dup=12 drop=14
frame= 45 fps=0.7 q=32.0 size=N/A time=00:00:00.04 bitrate=N/A dup=20
drop=24 frame= 59 fps=0.9 q=27.0 size=N/A time=00:00:00.62 bitrate=N/A
dup=25 drop=30 frame= 73 fps=1.2 q=27.0 size=N/A time=00:00:01.20
bitrate=N/A dup=28 drop=35 frame= 82 fps=1.3 q=28.0 size=N/A
time=00:00:01.58 bitrate=N/A dup=30 drop=43 frame= 95 fps=1.5 q=27.0
size=N/A time=00:00:02.12 bitrate=N/A dup=31 drop=47 frame= 107 fps=1.7
q=27.0 size=N/A time=00:00:02.62 bitrate=N/A dup=33 drop=52 frame= 120
fps=1.9 q=28.0 size=N/A time=00:00:03.16 bitrate=N/A dup=35 drop=56
frame= 132 fps=2.0 q=27.0 size=N/A time=00:00:03.66 bitrate=N/A dup=37
drop=62 frame= 145 fps=2.2 q=27.0 size=N/A time=00:00:04.20 bitrate=N/A
dup=40 drop=68 frame= 158 fps=2.4 q=27.0 size=N/A time=00:00:04.75
bitrate=N/A dup=41 drop=71 frame= 169 fps=2.5 q=26.0 size=N/A
time=00:00:05.20 bitrate=N/A dup=41 drop=74 frame= 200 fps=3.0 q=27.0
size=N/A time=00:00:06.50 bitrate=N/A dup=66 drop=80 frame= 205 fps=3.0
q=27.0 size=N/A time=00:00:06.70 bitrate=N/A dup=67 drop=108frame= 217
fps=3.2 q=27.0 size=N/A time=00:00:07.20 bitrate=N/A dup=70
drop=115frame= 230 fps=3.3 q=27.0 size=N/A time=00:00:07.75 bitrate=N/A
dup=73 drop=120frame= 241 fps=3.5 q=26.0 size=N/A time=00:00:08.20
bitrate=N/A dup=77 drop=128frame= 253 fps=3.6 q=26.0 size=N/A
time=00:00:08.70 bitrate=N/A dup=83 drop=136frame= 279 fps=3.9 q=26.0
size=N/A time=00:00:09.79 bitrate=N/A dup=102
drop=13^Cav_interleaved_write_frame(): Immediate exit requested<br>
^C Last message repeated 20 times<br>av_interleaved_write_frame(): Immediate exit requested<br>^C Last message repeated 175 times<br>Received signal 2: terminating.]] <br><br></font></div><div><font color="#ff9900"><font color="#000000">Can anyone please help me solve this problem? It is very very urgent. </font><br>
</font></div><div><div><div><div><div><div><div><br>-- <br>Tejas
</div></div></div></div></div></div></div></div>