desktop-mirror icon indicating copy to clipboard operation
desktop-mirror copied to clipboard

Mac OS support

Open sudar opened this issue 10 years ago • 5 comments

I know that you have mentioned in the README, that it only supports Windows, Ubuntu and XBMC.

I want to know if there is any specific reason why this may not work in Mac OS.

I installed wxPython in Mac and then when I run the command python lib/advanced.py I am able to get the UI to appear. But when I select another system in the network and click stream, nothing happens. Similarly if I try to stream from my Ubuntu desktop to Mac, nothing happens.

sudar avatar Jun 04 '15 06:06 sudar

Is anyone interested in proposing a pull request?

Here is the method https://trac.ffmpeg.org/wiki/Capture/Desktop?

Use the avfoundation device:

ffmpeg -f avfoundation -list_devices true -i ""
This will enumerate all the available input devices including screens ready to be captured.

Once you've figured out the device index corresponding to the screen to be captured use:

ffmpeg -f avfoundation -i "<screen device index>:<audio device index>" out.mov
This will capture the screen from <screen device index> and audio from <audio device index> into the         output file out.mov.

fcwu avatar Jun 04 '15 07:06 fcwu

@fcwu Thanks for the instructions. I will give it a try and if it works will send the pull request.

sudar avatar Jun 04 '15 08:06 sudar

@fcwu I tried the above commands in my mac.

When I executed the first command I got the following output. Not sure why I received an input/output error at the end but I was able to get the index of the video and audio devices.

ffmpeg -f avfoundation -list_devices true -i ""
ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[AVFoundation input device @ 0x7fe781422c00] AVFoundation video devices:
[AVFoundation input device @ 0x7fe781422c00] [0] FaceTime HD Camera
[AVFoundation input device @ 0x7fe781422c00] [1] Capture screen 0
[AVFoundation input device @ 0x7fe781422c00] AVFoundation audio devices:
[AVFoundation input device @ 0x7fe781422c00] [0] Built-in Microphone
: Input/output error

When I tried to execute the second command using capture screen as video and Built-in Microphone ffmpeg just hanged after the following output.

ffmpeg -f avfoundation -i "1:0" ~/Downloads/out.mov
ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[avfoundation @ 0x7fb5b100da00] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x7fb5b100da00] Supported pixel formats:
[avfoundation @ 0x7fb5b100da00]   uyvy422
[avfoundation @ 0x7fb5b100da00]   yuyv422
[avfoundation @ 0x7fb5b100da00]   nv12
[avfoundation @ 0x7fb5b100da00]   0rgb
[avfoundation @ 0x7fb5b100da00]   bgr0
[avfoundation @ 0x7fb5b100da00] Overriding selected pixel format to use uyvy422 instead.
[avfoundation @ 0x7fb5b100da00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, avfoundation, from '1:0':
  Duration: N/A, start: 0.309176, bitrate: 2822 kb/s
    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 2880x1800, 1000k tbr, 1000k tbn, 1000k tbc
    Stream #0:1: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
File '/Users/sudar/Downloads/out.mov' already exists. Overwrite ? [y/N] y
[mov @ 0x7fb5b1052400] Frame rate very high for a muxer not efficiently supporting it.
Please consider specifying a lower framerate, a different muxer or -vsync 2
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7fb5b1050800] MB rate (20340000000) > level limit (2073600)
[libx264 @ 0x7fb5b1050800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7fb5b1050800] profile High 4:2:2, level 5.2, 4:2:2 8-bit
[libx264 @ 0x7fb5b1050800] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mov @ 0x7fb5b1052400] WARNING codec timebase is very high. If duration is too long,
file may not be playable by quicktime. Specify a shorter timebase
or choose different container.
Output #0, mov, to '/Users/sudar/Downloads/out.mov':
  Metadata:
    encoder         : Lavf56.25.101
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 2880x1800, q=-1--1, 1000k fps, 1000k tbn, 1000k tbc
    Metadata:
      encoder         : Lavc56.26.100 libx264
    Stream #0:1: Audio: aac (libvo_aacenc) (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc56.26.100 libvo_aacenc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_f32le (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help

The screen hanged after this and the output file was empty.

Then I tried by using the built-in camera as video input device.

ffmpeg -f avfoundation -i "0:0" ~/Downloads/out.mov
ffmpeg version 2.6.3 Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[avfoundation @ 0x7f84eb00da00] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x7f84eb00da00] Supported pixel formats:
[avfoundation @ 0x7f84eb00da00]   uyvy422
[avfoundation @ 0x7f84eb00da00]   yuyv422
[avfoundation @ 0x7f84eb00da00]   nv12
[avfoundation @ 0x7f84eb00da00]   0rgb
[avfoundation @ 0x7f84eb00da00]   bgr0
[avfoundation @ 0x7f84eb00da00] Overriding selected pixel format to use uyvy422 instead.
Input #0, avfoundation, from '0:0':
  Duration: N/A, start: 0.764278, bitrate: N/A
    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1280x720, 30 tbr, 1000k tbn, 1000k tbc
    Stream #0:1: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7f84eb821800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x7f84eb821800] profile High 4:2:2, level 3.1, 4:2:2 8-bit
[libx264 @ 0x7f84eb821800] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mov, to '/Users/sudar/Downloads/out.mov':
  Metadata:
    encoder         : Lavf56.25.101
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 1280x720, q=-1--1, 30 fps, 15360 tbn, 30 tbc
    Metadata:
      encoder         : Lavc56.26.100 libx264
    Stream #0:1: Audio: aac (libvo_aacenc) (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      encoder         : Lavc56.26.100 libvo_aacenc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_f32le (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
Past duration 0.851936 too large      0kB time=00:00:01.57 bitrate=   0.2kbits/s    
Past duration 0.938240 too large
Past duration 0.884377 too large
Past duration 0.901726 too large
Past duration 0.970055 too large
Past duration 0.855263 too large     375kB time=00:00:02.59 bitrate=1181.1kbits/s dup=1 drop=0    
Past duration 0.948448 too large     710kB time=00:00:03.59 bitrate=1617.0kbits/s dup=1 drop=0    
Past duration 0.912346 too large
Past duration 0.949516 too large     802kB time=00:00:04.10 bitrate=1600.8kbits/s dup=1 drop=0    
Past duration 0.901253 too large
Past duration 0.993660 too large
Past duration 0.911537 too large
Past duration 0.747704 too large
Past duration 0.926064 too large
Past duration 0.620567 too large
Past duration 0.798027 too large     961kB time=00:00:04.61 bitrate=1705.7kbits/s dup=1 drop=0    
Past duration 0.942696 too large
Past duration 0.981178 too large
Past duration 0.994957 too large
Past duration 0.958641 too large
Past duration 0.991188 too large
Past duration 0.982018 too large
Past duration 0.947777 too large
Past duration 0.883080 too large    1338kB time=00:00:05.12 bitrate=2137.0kbits/s dup=1 drop=0    
Past duration 0.804298 too large
Past duration 0.820854 too large
Past duration 0.985619 too large
Past duration 0.953835 too large
Past duration 0.972710 too large
Past duration 0.981453 too large
Past duration 0.970070 too large
Past duration 0.971458 too large
Past duration 0.984245 too large
Past duration 0.974861 too large
Past duration 0.968788 too large
Past duration 0.981789 too large
Past duration 0.981560 too large
Past duration 0.968697 too large
Past duration 0.983253 too large    1537kB time=00:00:05.63 bitrate=2232.1kbits/s dup=1 drop=0    
Past duration 0.937065 too large
Past duration 0.963646 too large
Past duration 0.967857 too large
Past duration 0.945671 too large
Past duration 0.958702 too large
Past duration 0.972130 too large
Past duration 0.963249 too large
Past duration 0.966805 too large
Past duration 0.962257 too large
Past duration 0.969429 too large
Past duration 0.972618 too large
Past duration 0.965218 too large
Past duration 0.879738 too large
Past duration 0.953087 too large
Past duration 0.951607 too large    1754kB time=00:00:06.14 bitrate=2336.1kbits/s dup=1 drop=0    
Past duration 0.955986 too large
Past duration 0.952522 too large
Past duration 0.963905 too large
Past duration 0.921455 too large
Past duration 0.963676 too large
Past duration 0.956978 too large
Past duration 0.943092 too large
Past duration 0.947060 too large
Past duration 0.938164 too large
Past duration 0.948189 too large
Past duration 0.947273 too large
Past duration 0.946022 too large
Past duration 0.940361 too large
Past duration 0.921776 too large
Past duration 0.942451 too large    1918kB time=00:00:06.63 bitrate=2367.0kbits/s dup=1 drop=0    
Past duration 0.870583 too large
Past duration 0.930351 too large
Past duration 0.934502 too large
Past duration 0.919548 too large
Past duration 0.942299 too large
Past duration 0.947472 too large
Past duration 0.947197 too large
Past duration 0.939461 too large
Past duration 0.932686 too large
Past duration 0.931465 too large
Past duration 0.914421 too large
Past duration 0.894188 too large    2164kB time=00:00:07.14 bitrate=2479.9kbits/s dup=1 drop=0    
Past duration 0.932137 too large
Past duration 0.865166 too large
Past duration 0.848289 too large
Past duration 0.827858 too large
Past duration 0.870766 too large
Past duration 0.840813 too large
Past duration 0.921318 too large
Past duration 0.824242 too large
Past duration 0.920464 too large
Past duration 0.845558 too large
Past duration 0.923363 too large
Past duration 0.824516 too large
Past duration 0.928368 too large
Past duration 0.856575 too large
Past duration 0.863106 too large    2329kB time=00:00:07.63 bitrate=2498.9kbits/s dup=1 drop=0    
Past duration 0.841118 too large
Past duration 0.865700 too large
Past duration 0.816689 too large
Past duration 0.919243 too large
Past duration 0.813087 too large
Past duration 0.834297 too large
Past duration 0.787148 too large
Past duration 0.918648 too large
Past duration 0.871651 too large
Past duration 0.890923 too large
Past duration 0.805580 too large
Past duration 0.848259 too large
Past duration 0.800087 too large
Past duration 0.820854 too large
Past duration 0.825005 too large    2459kB time=00:00:08.14 bitrate=2472.4kbits/s dup=1 drop=0    
Past duration 0.804527 too large
Past duration 0.802437 too large
Past duration 0.908318 too large
Past duration 0.870857 too large
Past duration 0.916649 too large
Past duration 0.862419 too large
Past duration 0.872780 too large
Past duration 0.836037 too large
Past duration 0.860695 too large
Past duration 0.870049 too large
Past duration 0.791298 too large
Past duration 0.809196 too large
Past duration 0.833382 too large
Past duration 0.821510 too large
Past duration 0.881767 too large    2557kB time=00:00:08.65 bitrate=2419.0kbits/s dup=1 drop=0    
Past duration 0.841423 too large
Past duration 0.913170 too large
Past duration 0.833397 too large
Past duration 0.895241 too large
Past duration 0.838585 too large
Past duration 0.894096 too large
Past duration 0.795067 too large
Past duration 0.856133 too large
Past duration 0.774879 too large
Past duration 0.880211 too large
Past duration 0.834114 too large
Past duration 0.886986 too large
Past duration 0.746025 too large
Past duration 0.881279 too large
Past duration 0.813988 too large    2650kB time=00:00:09.16 bitrate=2368.1kbits/s dup=1 drop=0    
Past duration 0.878929 too large
Past duration 0.870171 too large
Past duration 0.882790 too large
Past duration 0.772118 too large
Past duration 0.888557 too large
Past duration 0.813835 too large
Past duration 0.867973 too large
Past duration 0.831627 too large
Past duration 0.865288 too large
Past duration 0.862816 too large
Past duration 0.871376 too large
Past duration 0.778831 too large
Past duration 0.871361 too large
Past duration 0.665901 too large
Past duration 0.860878 too large
Past duration 0.841179 too large    2749kB time=00:00:09.67 bitrate=2326.8kbits/s dup=1 drop=0    
Past duration 0.717659 too large
Past duration 0.834480 too large
Past duration 0.723305 too large
Past duration 0.715858 too large
Past duration 0.817848 too large
Past duration 0.700233 too large
Past duration 0.642387 too large
Past duration 0.813225 too large    2975kB time=00:00:10.19 bitrate=2391.4kbits/s dup=1 drop=0    
Past duration 0.808922 too large
Past duration 0.777840 too large
Past duration 0.835655 too large
Past duration 0.849678 too large
Past duration 0.839546 too large
Past duration 0.846367 too large
Past duration 0.846245 too large
Past duration 0.832130 too large
Past duration 0.718437 too large
Past duration 0.833504 too large
Past duration 0.833717 too large
Past duration 0.806313 too large
Past duration 0.827354 too large    3229kB time=00:00:10.70 bitrate=2472.0kbits/s dup=1 drop=0    
Past duration 0.791969 too large
Past duration 0.831184 too large
Past duration 0.819496 too large
Past duration 0.825172 too large
Past duration 0.800133 too large
Past duration 0.811485 too large
Past duration 0.821190 too large
Past duration 0.818306 too large
Past duration 0.780769 too large
Past duration 0.822685 too large
Past duration 0.779625 too large
Past duration 0.742577 too large
Past duration 0.790077 too large
Past duration 0.820213 too large
Past duration 0.796043 too large    3380kB time=00:00:11.21 bitrate=2469.6kbits/s dup=1 drop=0    
Past duration 0.804176 too large
Past duration 0.793846 too large
Past duration 0.806816 too large
Past duration 0.764458 too large
Past duration 0.807915 too large
Past duration 0.802223 too large
Past duration 0.792458 too large
Past duration 0.802025 too large
Past duration 0.799767 too large
Past duration 0.741814 too large
Past duration 0.789467 too large
Past duration 0.775826 too large
Past duration 0.820168 too large
Past duration 0.733604 too large
Past duration 0.801140 too large    3485kB time=00:00:11.72 bitrate=2435.3kbits/s dup=1 drop=0    
Past duration 0.731880 too large
Past duration 0.796059 too large
Past duration 0.793648 too large
Past duration 0.797325 too large
Past duration 0.775169 too large
Past duration 0.717186 too large
Past duration 0.776680 too large
Past duration 0.789467 too large
Past duration 0.757713 too large
Past duration 0.771767 too large
Past duration 0.744957 too large
Past duration 0.774300 too large
Past duration 0.769005 too large
Past duration 0.772972 too large    3562kB time=00:00:12.23 bitrate=2385.4kbits/s dup=1 drop=0    
Past duration 0.737404 too large
Past duration 0.768044 too large
Past duration 0.789024 too large
Past duration 0.781837 too large
Past duration 0.757576 too large
Past duration 0.787224 too large
Past duration 0.776619 too large
Past duration 0.779045 too large
Past duration 0.738899 too large
Past duration 0.776527 too large
Past duration 0.668022 too large
Past duration 0.769554 too large
Past duration 0.734825 too large
Past duration 0.773140 too large
Past duration 0.748726 too large    3636kB time=00:00:12.74 bitrate=2337.4kbits/s dup=1 drop=0    
Past duration 0.728676 too large
Past duration 0.756676 too large
Past duration 0.771263 too large
Past duration 0.728859 too large
Past duration 0.769966 too large
Past duration 0.711052 too large
Past duration 0.763023 too large
Past duration 0.736244 too large
Past duration 0.760674 too large
Past duration 0.674309 too large
Past duration 0.764381 too large
Past duration 0.651527 too large
Past duration 0.764793 too large
Past duration 0.722710 too large
Past duration 0.757790 too large
Past duration 0.700920 too large    3713kB time=00:00:13.23 bitrate=2298.8kbits/s dup=1 drop=0    
Past duration 0.743050 too large
Past duration 0.701454 too large
Past duration 0.728340 too large
Past duration 0.676399 too large
Past duration 0.700829 too large
Past duration 0.730232 too large
Past duration 0.750038 too large
Past duration 0.733803 too large
Past duration 0.720375 too large
Past duration 0.682289 too large
Past duration 0.726967 too large
Past duration 0.725471 too large
Past duration 0.744957 too large
Past duration 0.722923 too large    3802kB time=00:00:13.74 bitrate=2266.4kbits/s dup=1 drop=0    
Past duration 0.739815 too large
Past duration 0.678688 too large
Past duration 0.730690 too large
Past duration 0.701057 too large
Past duration 0.736778 too large
Past duration 0.704765 too large
Past duration 0.713066 too large
Past duration 0.615486 too large
Past duration 0.717339 too large
Past duration 0.673637 too large
Past duration 0.721687 too large
Past duration 0.620079 too large
Past duration 0.734398 too large
Past duration 0.622414 too large    3881kB time=00:00:14.25 bitrate=2230.4kbits/s dup=1 drop=0    
Past duration 0.716011 too large
Past duration 0.705437 too large
Past duration 0.722008 too large
Past duration 0.723579 too large
Past duration 0.705788 too large
Past duration 0.718208 too large
Past duration 0.702003 too large
Past duration 0.700127 too large
Past duration 0.719688 too large
Past duration 0.705482 too large    3956kB time=00:00:14.74 bitrate=2198.6kbits/s dup=1 drop=0    
Past duration 0.643669 too large
Past duration 0.720985 too large
Past duration 0.683128 too large
Past duration 0.702309 too large
Past duration 0.663170 too large
Past duration 0.713875 too large
Past duration 0.718620 too large
Past duration 0.698875 too large
Past duration 0.708519 too large
Past duration 0.650978 too large
Past duration 0.639885 too large
Past duration 0.602730 too large    4037kB time=00:00:15.25 bitrate=2168.5kbits/s dup=1 drop=0    
Past duration 0.713951 too large
Past duration 0.693932 too large
Past duration 0.701439 too large
Past duration 0.653542 too large
Past duration 0.698845 too large
Past duration 0.675591 too large
Past duration 0.692558 too large
Past duration 0.691704 too large
Past duration 0.681908 too large
Past duration 0.691277 too large
Past duration 0.675789 too large    4120kB time=00:00:15.76 bitrate=2141.4kbits/s dup=1 drop=0    
Past duration 0.669975 too large
Past duration 0.675560 too large
Past duration 0.656395 too large
Past duration 0.676399 too large
Past duration 0.673714 too large
Past duration 0.652245 too large
Past duration 0.659615 too large
Past duration 0.618080 too large
Past duration 0.657722 too large    4190kB time=00:00:16.27 bitrate=2109.4kbits/s dup=1 drop=0    
Past duration 0.645851 too large
Past duration 0.664131 too large
Past duration 0.646111 too large
Past duration 0.645378 too large
Past duration 0.651421 too large
Past duration 0.648048 too large
Past duration 0.643715 too large
Past duration 0.643929 too large
frame=  503 fps= 28 q=-1.0 Lsize=    5322kB time=00:00:16.73 bitrate=2604.9kbits/s dup=1 drop=0    
video:5034kB audio:265kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.444437%
[libx264 @ 0x7f84eb821800] frame I:3     Avg QP:23.10  size: 43299
[libx264 @ 0x7f84eb821800] frame P:293   Avg QP:24.68  size: 15369
[libx264 @ 0x7f84eb821800] frame B:207   Avg QP:25.01  size:  2518
[libx264 @ 0x7f84eb821800] consecutive B-frames: 30.4% 35.8% 25.0%  8.7%
[libx264 @ 0x7f84eb821800] mb I  I16..4: 14.1% 75.6% 10.4%
[libx264 @ 0x7f84eb821800] mb P  I16..4:  0.7%  3.5%  0.2%  P16..4: 58.4%  7.5%  9.9%  0.0%  0.0%    skip:19.9%
[libx264 @ 0x7f84eb821800] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 31.5%  0.1%  0.0%  direct: 1.8%  skip:66.5%  L0:36.3% L1:63.0% BI: 0.8%
[libx264 @ 0x7f84eb821800] 8x8 transform intra:78.7% inter:82.8%
[libx264 @ 0x7f84eb821800] coded y,uvDC,uvAC intra: 55.1% 83.7% 40.8% inter: 12.0% 49.8% 1.2%
[libx264 @ 0x7f84eb821800] i16 v,h,dc,p: 12%  9%  6% 74%
[libx264 @ 0x7f84eb821800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13%  7% 43%  7%  7%  6%  6%  6%  5%
[libx264 @ 0x7f84eb821800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 10% 31%  8% 11%  9%  6%  4%  4%
[libx264 @ 0x7f84eb821800] i8c dc,h,v,p: 71%  8% 17%  3%
[libx264 @ 0x7f84eb821800] Weighted P-Frames: Y:17.4% UV:11.3%
[libx264 @ 0x7f84eb821800] ref P L0: 61.3%  7.7% 20.8%  9.8%  0.3%
[libx264 @ 0x7f84eb821800] ref B L0: 78.7% 19.3%  1.9%
[libx264 @ 0x7f84eb821800] ref B L1: 95.3%  4.7%
[libx264 @ 0x7f84eb821800] kb/s:2459.34
Received signal 2: terminating.

After a couple of seconds I terminated the program. This time the video was recorded.

I have two questions for you.

  • How to stream the out.mov file to XBMC
  • Do you have any idea why I am getting the first error. Is there a way to fix it?

Thanks for all your help so far on this.

If I can get this to work on Mac, then I will send you a pull request.

sudar avatar Jun 14 '15 07:06 sudar

@fcwu Any idea why this is happening?

Any help on this would be greatly appreciated. Thanks.

sudar avatar Jul 01 '15 06:07 sudar

@sudar

It's a really late response because of another interesting project...

OK, let me reply second question first. Not to use .mov to do screen recording. Following is my trial that everything looks great

$ ./ffmpeg -f avfoundation -i "1" -vcodec libx264 -preset ultrafast -tune zerolatency -r 25 -fflags nobuffer -f mpegts out.ts
ffmpeg version 2.6.3-tessus Copyright (c) 2000-2015 the FFmpeg developers
  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --as=yasm --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[avfoundation @ 0x7fa914800000] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x7fa914800000] Supported pixel formats:
[avfoundation @ 0x7fa914800000]   uyvy422
[avfoundation @ 0x7fa914800000]   yuyv422
[avfoundation @ 0x7fa914800000]   nv12
[avfoundation @ 0x7fa914800000]   0rgb
[avfoundation @ 0x7fa914800000]   bgr0
[avfoundation @ 0x7fa914800000] Overriding selected pixel format to use uyvy422 instead.
[avfoundation @ 0x7fa914800000] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, avfoundation, from '1':
  Duration: N/A, start: 0.608073, bitrate: N/A
    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1440x900, 1000k tbr, 1000k tbn, 1000k tbc
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x7fa91404b000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7fa91404b000] profile High 4:2:2, level 4.0, 4:2:2 8-bit
Output #0, mpegts, to 'out.ts':
  Metadata:
    encoder         : Lavf56.25.101
    Stream #0:0: Video: h264 (libx264), yuv422p, 1440x900, q=-1--1, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.26.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame=  213 fps= 25 q=12.0 Lsize=    3217kB time=00:00:08.52 bitrate=3093.4kbits/s dup=84 drop=0
video:2964kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.548747%
[libx264 @ 0x7fa91404b000] frame I:1     Avg QP:20.00  size:236905
[libx264 @ 0x7fa91404b000] frame P:212   Avg QP:15.03  size: 13199
[libx264 @ 0x7fa91404b000] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x7fa91404b000] mb P  I16..4:  4.8%  0.0%  0.0%  P16..4: 10.6%  0.0%  0.0%  0.0%  0.0%    skip:84.6%
[libx264 @ 0x7fa91404b000] coded y,uvDC,uvAC intra: 22.6% 18.1% 16.5% inter: 5.0% 5.7% 4.7%
[libx264 @ 0x7fa91404b000] i16 v,h,dc,p: 16% 80%  3%  1%
[libx264 @ 0x7fa91404b000] i8c dc,h,v,p: 78% 13%  8%  1%
[libx264 @ 0x7fa91404b000] kb/s:2849.82
$ open out.ts
# Open with VLC(in my environment)

The first question how to scream to XBMC. You may refer master branch https://github.com/fcwu/desktop-mirror/blob/master/share/default.ini#L2 and win7 branch https://github.com/fcwu/desktop-mirror/blob/win7/share/default_win7.ini#L2 that given different video_input configuration.

I think you may correct video_input of OSX version and replace ffmpeg of OSX version. When clicking "Scream" button, it will through https://github.com/fcwu/desktop-mirror/blob/win7/lib/streamserver.py#L83 to stream video on a dedicated port and send a HTTP request to XBMC to play on that URL.

fcwu avatar Jul 01 '15 16:07 fcwu