We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code:
public static void recordCamera(String outputFile, double frameRate) throws FrameGrabber.Exception, FrameRecorder.Exception { OpenCVFrameGrabber grabber = OpenCVFrameGrabber.createDefault(0); grabber.start(); FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(outputFile,1280,720,0); recorder.setInterleaved(true); recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264); recorder.setFormat("flv"); recorder.setFrameRate(frameRate); recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P); recorder.start(); CanvasFrame canvasFrame = new CanvasFrame("camera", CanvasFrame.getDefaultGamma() / grabber.getGamma()); canvasFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); while (canvasFrame.isVisible()) { canvasFrame.showImage(grabber.grab()); recorder.record(grabber.grab()); } canvasFrame.dispose(); recorder.stop(); grabber.stop(); }
Maven pom:
<properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>org.bytedeco</groupId> <artifactId>javacv-platform</artifactId> <version>1.5.4</version> </dependency> </dependencies>
Output:
[libx264 @ 0x7ff939cb9c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x7ff939cb9c00] profile High, level 3.1, 4:2:0, 8-bit [libx264 @ 0x7ff939cb9c00] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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=6 lookahead_threads=1 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=abr mbtree=1 bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, flv, to 'output.mkv': Metadata: encoder : Lavf58.45.100 Stream #0:0: Video: h264 (Constrained Baseline) ([7][0][0][0] / 0x0007), yuv420p, 1280x720, q=2-31, 400 kb/s, 25 fps, 1k tbn, 25 tbc # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x0000000131d19950, pid=8733, tid=0x0000000000008293 # # JRE version: Java(TM) SE Runtime Environment (8.0_231-b11) (build 1.8.0_231-b11) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode bsd-amd64 compressed oops) # Problematic frame: # C [libavcodec.58.dylib+0xfd9950] aver_isf_history+0x2c4f60 # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/robert/IdeaProjects/Camera/hs_err_pid8733.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp #
The text was updated successfully, but these errors were encountered:
system: macos version: 10.15.7
Sorry, something went wrong.
Duplicate of #1519
No branches or pull requests
code:
Maven pom:
Output:
The text was updated successfully, but these errors were encountered: