xSAVIKx/AndroidScreencast

Cannot record video ?

wzhy90 opened this issue · 4 comments

Why not use mp4 ? Using QuickTime have to install the apple QuickTime .

kjava.io.IOException: closed
    at javax.imageio.stream.ImageInputStreamImpl.checkClosed(ImageInputStreamImpl.java:110)
    at javax.imageio.stream.ImageInputStreamImpl.getStreamPosition(ImageInputStreamImpl.java:627)
    at com.github.xsavikx.android.screencast.api.recording.QuickTimeOutputStream$Atom.<init>(QuickTimeOutputStream.java:45)
    at com.github.xsavikx.android.screencast.api.recording.QuickTimeOutputStream$WideDataAtom.<init>(QuickTimeOutputStream.java:256)
    at com.github.xsavikx.android.screencast.api.recording.QuickTimeOutputStream.ensureStarted(QuickTimeOutputStream.java:425)
    at com.github.xsavikx.android.screencast.api.recording.QuickTimeOutputStream.writeFrame(QuickTimeOutputStream.java:1533)
    at com.github.xsavikx.android.screencast.api.injector.ScreenCaptureThread.display(ScreenCaptureThread.java:72)
    at com.github.xsavikx.android.screencast.api.injector.ScreenCaptureThread.fetchImage(ScreenCaptureThread.java:118)
    at com.github.xsavikx.android.screencast.api.injector.ScreenCaptureThread.run(ScreenCaptureThread.java:143)

And when click cancel in the file selection window , stop the record will show this error

java.lang.NullPointerException
    at com.github.xsavikx.android.screencast.api.injector.ScreenCaptureThread.stopRecording(ScreenCaptureThread.java:186)
    at com.github.xsavikx.android.screencast.ui.JFrameMain.stopRecording(JFrameMain.java:184)
    at com.github.xsavikx.android.screencast.ui.JFrameMain.access$200(JFrameMain.java:33)
    at com.github.xsavikx.android.screencast.ui.JFrameMain$1.actionPerformed(JFrameMain.java:121)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:308)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:706)
    at java.awt.EventQueue$3.run(EventQueue.java:704)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:720)
    at java.awt.EventQueue$4.run(EventQueue.java:718)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Yes, this feature is not working yet :-(

Video recording is fixed and enabled with c9bcca8.

And about mp4 - there is no easy way to convert screenshots (that are BufferedImages in Java) to video, while Apples QuickTime format is more or less easy to implement and well documented.

I can't play the video file. This is what mpv says

$ mpv test.mov 
Playing: test.mov
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: overread end of atom 'stts' by 8 bytes
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: stream 0, contradictionary STSC and STCO
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: error reading header
[lavf] avformat_open_input() failed
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: overread end of atom 'stts' by 8 bytes
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: stream 0, contradictionary STSC and STCO
[ffmpeg/demuxer] mov,mp4,m4a,3gp,3g2,mj2: error reading header
[lavf] avformat_open_input() failed
Failed to recognize file format

And this is what ffprobe says:

$ ffprobe test.mov 
ffprobe version n4.1.2 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20181127
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x555851153640] overread end of atom 'stts' by 8 bytes
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x555851153640] stream 0, contradictionary STSC and STCO
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x555851153640] error reading header
test.mov: Invalid data found when processing input