File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public IVideoStreamCodec newInstance() {
106106
107107 @ Override
108108 public String getMimeType () {
109- return "vp08" ;
109+ return "vp08" ; // vp8 / ffmpeg LE = 08pv / 0x76703038
110110 }
111111
112112 }, // VP8 / vp08 / vp8
@@ -119,7 +119,7 @@ public IVideoStreamCodec newInstance() {
119119
120120 @ Override
121121 public String getMimeType () {
122- return "vp09" ;
122+ return "vp09" ; // vp9 / ffmpeg LE = 09pv / 0x76703039
123123 }
124124
125125 }, // VP9 / vp09
@@ -159,7 +159,7 @@ public IVideoStreamCodec newInstance() {
159159
160160 @ Override
161161 public String getMimeType () {
162- return "av01" ;
162+ return "av01" ; // av1 / ffmpeg LE = 10va / 0x61763031
163163 }
164164
165165 }; // AV1 / av01
Original file line number Diff line number Diff line change 11package org .red5 .codec ;
22
3+ import org .apache .mina .core .buffer .IoBuffer ;
34import org .junit .Test ;
45import org .red5 .io .utils .IOUtils ;
6+ import java .nio .ByteOrder ;
57
68public class FourCCTest {
79
810 @ Test
911 public void test () {
1012 VideoCodec [] values = VideoCodec .values ();
1113 for (VideoCodec codec : values ) {
12- System .out .println (codec .name () + " fourcc: " + codec .getFourcc ());
13- System .out .println ("mimeType: " + codec .getMimeType () + " fourcc from mime: " + IOUtils .makeFourcc (codec .getMimeType ()));
14+ int fourcc = codec .getFourcc ();
15+ System .out .println (codec .name () + " fourcc: " + fourcc + " mimeType: " + codec .getMimeType () + " fourcc from mime: " + IOUtils .makeFourcc (codec .getMimeType ()));
16+ IoBuffer buffer = IoBuffer .allocate (4 );
17+ buffer .order (ByteOrder .BIG_ENDIAN ); // native order is BIG_ENDIAN in linux
18+ buffer .putInt (fourcc );
19+ buffer .flip ();
20+ System .out .println ("fourcc bytes: " + buffer .getHexDump ());
1421 }
1522 AudioCodec [] audioValues = AudioCodec .values ();
1623 for (AudioCodec codec : audioValues ) {
17- System .out .println (codec .name () + " fourcc: " + codec .getFourcc ());
18- System .out .println ("mimeType: " + codec .getMimeType () + " fourcc from mime: " + IOUtils .makeFourcc (codec .getMimeType ()));
24+ int fourcc = codec .getFourcc ();
25+ System .out .println (codec .name () + " fourcc: " + fourcc + " mimeType: " + codec .getMimeType () + " fourcc from mime: " + IOUtils .makeFourcc (codec .getMimeType ()));
26+ IoBuffer buffer = IoBuffer .allocate (4 );
27+ buffer .order (ByteOrder .BIG_ENDIAN ); // native order is BIG_ENDIAN in linux
28+ buffer .putInt (fourcc );
29+ buffer .flip ();
30+ System .out .println ("fourcc bytes: " + buffer .getHexDump ());
1931 }
2032 }
2133
You can’t perform that action at this time.
0 commit comments