Skip to content

Commit

Permalink
* Add more appropriate default pixel formats for JPEG formats in `FF…
Browse files Browse the repository at this point in the history
…mpegFrameRecorder` (issue #410)
  • Loading branch information
saudet committed May 19, 2016
1 parent 70020f5 commit 477b8ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

* Add more appropriate default pixel formats for JPEG formats in `FFmpegFrameRecorder` ([issue #410](https://github.com/bytedeco/javacv/issues/410))

### May 15, 2016 version 1.2
* Optimize `AndroidFrameConverter` a bit and add a test ([pull #379](https://github.com/bytedeco/javacv/pull/379))
* Fix `DC1394FrameGrabber` on the Windows platform ([issue bytedeco/procamcalib#4](https://github.com/bytedeco/procamcalib/issues/4))
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ void startUnsafe() throws Exception {
} else if (video_c.codec_id() == AV_CODEC_ID_RAWVIDEO || video_c.codec_id() == AV_CODEC_ID_PNG ||
video_c.codec_id() == AV_CODEC_ID_HUFFYUV || video_c.codec_id() == AV_CODEC_ID_FFV1) {
video_c.pix_fmt(AV_PIX_FMT_RGB32); // appropriate for common lossless formats
} else if (video_c.codec_id() == AV_CODEC_ID_JPEGLS) {
video_c.pix_fmt(AV_PIX_FMT_BGR24);
} else if (video_c.codec_id() == AV_CODEC_ID_MJPEG || video_c.codec_id() == AV_CODEC_ID_MJPEGB) {
video_c.pix_fmt(AV_PIX_FMT_YUVJ420P);
} else {
video_c.pix_fmt(AV_PIX_FMT_YUV420P); // lossy, but works with about everything
}
Expand Down

0 comments on commit 477b8ad

Please sign in to comment.