bramp / ffmpeg-cli-wrapper

Java wrapper around the FFmpeg command line tool
BSD 2-Clause "Simplified" License
1.67k stars 412 forks source link

Specify default FFMPEG and FFPROBE constants #85

Open mayras opened 7 years ago

mayras commented 7 years ago

Please specify default constants for FFMPEG and FFPROBE to use instead of String, for example:

public class FFmpegConstants {

// File Extensions
public static final String AVI = "avi";
public static final String MP4 = "mp4";
public static final String OGG = "ogg";
public static final String MOV = "mov";
public static final String _3GP = "3gp";

//  Formats
public static final String MP4_FORMAT = "mp4";

// Audio
public static final String AAC_CODEC = "aac";

// Video
public static final String H264_CODEC = "libx264";

// Presets
public static final String ULTRAFAST_PRESET = "ultrafast";

}

bramp commented 7 years ago

I had actually tried to avoid doing this, because I didn't want to give the impression that the local ffmpeg supported those formats, or codecs, etc. You can however do new FFmpeg().formats() and get a list of formats supported by this instance.

I do have some constants, such as FPS_30, or AUDIO_STEREO, but these are universally accepted across all ffmpegs. Where as H264_CODEC = "libx264" would only be available on a ffmpeg compiled with x264 support.

Thoughts?

mayras commented 7 years ago

Anyway, usage of constants is right approach even it's supported optionally. I believe - it can be under developer's choice what constants to use and it's really nice to have constants to avoid creation of own ones

Euklios commented 5 months ago

Related to PR #321