Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/main/java/net/bramp/ffmpeg/FFmpeg.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ public class FFmpeg extends FFcommon {
public static final int AUDIO_SAMPLE_48000 = 48000;
public static final int AUDIO_SAMPLE_96000 = 96000;

static final Pattern CODECS_REGEX =
Pattern.compile("^ ([ D][ E][VAS][ S][ D][ T]) (\\S+)\\s+(.*)$");
static final Pattern CODECS_REGEX = Pattern.compile("^ ([.D][.E][VASD][.I][.L][.S]) (\\S{2,})\\s+(.*)$");
static final Pattern FORMATS_REGEX = Pattern.compile("^ ([ D][ E]) (\\S+)\\s+(.*)$");

/** Supported codecs */
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/net/bramp/ffmpeg/info/Codec.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public class Codec {
enum Type {
VIDEO,
AUDIO,
SUBTITLE
SUBTITLE,
DATA
}

final String name;
Expand All @@ -41,9 +42,9 @@ enum Type {
* ..V... = Video codec
* ..A... = Audio codec
* ..S... = Subtitle codec
* ...S.. = Supports draw_horiz_band
* ....D. = Supports direct rendering method 1
* .....T = Supports weird frame truncation
* ...I.. = Intra frame-only codec
* ....L. = Lossy compression
* .....S = Lossless compression
* </pre>
*/
public Codec(String name, String longName, String flags) {
Expand All @@ -65,8 +66,11 @@ public Codec(String name, String longName, String flags) {
case 'S':
this.type = Type.SUBTITLE;
break;
case 'D':
this.type = Type.DATA;
break;
default:
throw new IllegalArgumentException("Invalid codec type '" + flags.charAt(3) + "'");
throw new IllegalArgumentException("Invalid codec type '" + flags.charAt(2) + "'");
}

// TODO There are more flags to parse
Expand Down
Loading