Advertisement
Guest User

high speed encoding problem

a guest
Jul 30th, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | None | 0 0
  1. INRES="1920x1080" # input resolution
  2. OUTRES="640x360"
  3. VBITRATE="300K"
  4. FPS="30" # target FPS
  5. QUAL="ultrafast" # one of the many FFMPEG preset
  6.  
  7. #justin.tv
  8. STREAM_KEY="my private key" #ffmpeg
  9. URL="rtmp://live.justin.tv/app/$STREAM_KEY"
  10.  
  11. #No Audio
  12. #ffmpeg -f x11grab -y -s "$INRES" -r "$FPS" -i :0.0 -an \
  13. # -vcodec libx264 -preset "$QUAL" -pix_fmt yuv420p -s "$OUTRES" -b:v 1650k \
  14. # -f flv "$URL"
  15.  
  16. ffmpeg -f x11grab -y -s "$INRES" -r "$FPS" -i :0.0 \
  17. -f video4linux2 -s 320x240 -r "$FPS" -i /dev/video0 -filter_complex 'overlay=10:main_h-overlay_h-10' -an \
  18. -vcodec libx264 -preset "$QUAL" -pix_fmt yuv420p -s "$OUTRES" -b:v "$VBITRATE" \
  19. -f flv "$URL"
  20.  
  21.  
  22.  
  23.  
  24. vitrums@vitrums:~/stream$ ./run640x360camera.sh
  25. ffmpeg version git-2012-07-28-a2f91e7 Copyright (c) 2000-2012 the FFmpeg developers
  26. built on Jul 28 2012 12:01:28 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  27. configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-x11grab
  28. libavutil 51. 65.100 / 51. 65.100
  29. libavcodec 54. 45.100 / 54. 45.100
  30. libavformat 54. 21.100 / 54. 21.100
  31. libavdevice 54. 2.100 / 54. 2.100
  32. libavfilter 3. 3.100 / 3. 3.100
  33. libswscale 2. 1.100 / 2. 1.100
  34. libswresample 0. 15.100 / 0. 15.100
  35. libpostproc 52. 0.100 / 52. 0.100
  36. [x11grab @ 0x2c13440] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1920 height: 1080
  37. [x11grab @ 0x2c13440] shared memory extension found
  38. [x11grab @ 0x2c13440] Estimating duration from bitrate, this may be inaccurate
  39. Input #0, x11grab, from ':0.0':
  40. Duration: N/A, start: 1343685102.657378, bitrate: 1990656 kb/s
  41. Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1920x1080, 1990656 kb/s, 30 tbr, 1000k tbn, 30 tbc
  42. [video4linux2,v4l2 @ 0x2c203c0] Estimating duration from bitrate, this may be inaccurate
  43. Input #1, video4linux2,v4l2, from '/dev/video0':
  44. Duration: N/A, start: 2283.039194, bitrate: 36864 kb/s
  45. Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 tbr, 1000k tbn, 30 tbc
  46. [libx264 @ 0x2c244e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
  47. [libx264 @ 0x2c244e0] profile Constrained Baseline, level 3.0
  48. [libx264 @ 0x2c244e0] 264 - core 125 r2 d9d2288 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_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=0 intra_refresh=0 rc=abr mbtree=0 bitrate=300 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
  49. Output #0, flv, to 'rtmp://live.justin.tv/app/MyPrivateKey':
  50. Metadata:
  51. encoder : Lavf54.21.100
  52. Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 640x360, q=-1--1, 300 kb/s, 1k tbn, 30 tbc
  53. Stream mapping:
  54. Stream #0:0 (rawvideo) -> overlay:main
  55. Stream #1:0 (rawvideo) -> overlay:overlay
  56. overlay -> Stream #0:0 (libx264)
  57. Press [q] to stop, [?] for help
  58. frame= 2224 fps= 25 q=32766.0 Lsize= 2994kB time=00:01:14.13 bitrate= 330.9kbits/s
  59. video:2951kB audio:0kB subtitle:0 global headers:0kB muxing overhead 1.481149%
  60. [libx264 @ 0x2c244e0] frame I:9 Avg QP:17.22 size: 45033
  61. [libx264 @ 0x2c244e0] frame P:2215 Avg QP:18.82 size: 1181
  62. [libx264 @ 0x2c244e0] mb I I16..4: 100.0% 0.0% 0.0%
  63. [libx264 @ 0x2c244e0] mb P I16..4: 1.0% 0.0% 0.0% P16..4: 9.2% 0.0% 0.0% 0.0% 0.0% skip:89.7%
  64. [libx264 @ 0x2c244e0] final ratefactor: 26.65
  65. [libx264 @ 0x2c244e0] coded y,uvDC,uvAC intra: 58.5% 46.4% 29.7% inter: 3.8% 3.1% 1.0%
  66. [libx264 @ 0x2c244e0] i16 v,h,dc,p: 27% 61% 4% 8%
  67. [libx264 @ 0x2c244e0] i8c dc,h,v,p: 44% 32% 15% 9%
  68. [libx264 @ 0x2c244e0] kb/s:326.00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement