Skip to content

Commit

Permalink
code
Browse files Browse the repository at this point in the history
  • Loading branch information
andr3medeiros committed Apr 27, 2018
1 parent 049c8d4 commit b45328d
Show file tree
Hide file tree
Showing 24 changed files with 2,806 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@

# Created by https://www.gitignore.io/api/java,maven,eclipse

### Eclipse ###

.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

### Eclipse Patch ###
# Eclipse Core
.project

# JDT-specific (Eclipse Java Development Tools)
.classpath

# Annotation Processing
.apt_generated

### Java ###
# Compiled class file
*.class

Expand All @@ -20,3 +86,20 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties

# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored)
!/.mvn/wrapper/maven-wrapper.jar


# End of https://www.gitignore.io/api/java,maven,eclipse
67 changes: 67 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>it.sauronsoftware</groupId>
<artifactId>jave</artifactId>
<version>1.0.3</version>
<packaging>jar</packaging>

<name>jave</name>
<url>http://www.sauronsoftware.it/projects/jave/index.php</url>

<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<description>JAVE
The JAVE (Java Audio Video Encoder) library is Java wrapper on the ffmpeg project. Developers can take take advantage of JAVE to transcode audio and video files from a format to another. In example you can transcode an AVI file to a MPEG one, you can change a DivX video stream into a (youtube like) Flash FLV one, you can convert a WAV audio file to a MP3 or a Ogg Vorbis one, you can separate and transcode audio and video tracks, you can resize videos, changing their sizes and proportions and so on. Many other formats, containers and operations are supported by JAVE.

Requirements
JAVE requires a J2SE environment 1.4 or later and a Windows or Linux OS on a i386 / 32 bit hardware architecture. JAVE can also be easily ported to other OS and hardware configurations, see the JAVE manual for details.

License
JAVE is Free Software and it is licensed under GPL (you will find a copy of the license bundled into the downloadable software distribution).

Feedback
You can send comments and requests to Carlo Pelliccia.

Make a donation
JAVE is free, but if you find it useful please make a donation via PayPal.</description>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<distributionManagement>
<repository>
<id>andr3medeiros</id>
<name>andr3medeiros Github Repository</name>
<url>https://github.com/andr3medeiros/jave</url>
</repository>

</distributionManagement>
</project>
182 changes: 182 additions & 0 deletions src/main/java/it/sauronsoftware/jave/AudioAttributes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
/*
* JAVE - A Java Audio/Video Encoder (based on FFMPEG)
*
* Copyright (C) 2008-2009 Carlo Pelliccia (www.sauronsoftware.it)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package it.sauronsoftware.jave;

import java.io.Serializable;

/**
* Attributes controlling the audio encoding process.
*
* @author Carlo Pelliccia
*/
public class AudioAttributes implements Serializable {

private static final long serialVersionUID = 1L;

/**
* This value can be setted in the codec field to perform a direct stream
* copy, without re-encoding of the audio stream.
*/
public static final String DIRECT_STREAM_COPY = "copy";

/**
* The codec name for the encoding process. If null or not specified the
* encoder will perform a direct stream copy.
*/
private String codec = null;

/**
* The bitrate value for the encoding process. If null or not specified a
* default value will be picked.
*/
private Integer bitRate = null;

/**
* The samplingRate value for the encoding process. If null or not specified
* a default value will be picked.
*/
private Integer samplingRate = null;

/**
* The channels value (1=mono, 2=stereo) for the encoding process. If null
* or not specified a default value will be picked.
*/
private Integer channels = null;

/**
* The volume value for the encoding process. If null or not specified a
* default value will be picked. If 256 no volume change will be performed.
*/
private Integer volume = null;

/**
* Returns the codec name for the encoding process.
*
* @return The codec name for the encoding process.
*/
String getCodec() {
return codec;
}

/**
* Sets the codec name for the encoding process. If null or not specified
* the encoder will perform a direct stream copy.
*
* Be sure the supplied codec name is in the list returned by
* {@link Encoder#getAudioEncoders()}.
*
* A special value can be picked from
* {@link AudioAttributes#DIRECT_STREAM_COPY}.
*
* @param codec
* The codec name for the encoding process.
*/
public void setCodec(String codec) {
this.codec = codec;
}

/**
* Returns the bitrate value for the encoding process.
*
* @return The bitrate value for the encoding process.
*/
Integer getBitRate() {
return bitRate;
}

/**
* Sets the bitrate value for the encoding process. If null or not specified
* a default value will be picked.
*
* @param bitRate
* The bitrate value for the encoding process.
*/
public void setBitRate(Integer bitRate) {
this.bitRate = bitRate;
}

/**
* Returns the samplingRate value for the encoding process.
*
* @return the samplingRate The samplingRate value for the encoding process.
*/
Integer getSamplingRate() {
return samplingRate;
}

/**
* Sets the samplingRate value for the encoding process. If null or not
* specified a default value will be picked.
*
* @param samplingRate
* The samplingRate value for the encoding process.
*/
public void setSamplingRate(Integer samplingRate) {
this.samplingRate = samplingRate;
}

/**
* Returns the channels value (1=mono, 2=stereo) for the encoding process.
*
* @return The channels value (1=mono, 2=stereo) for the encoding process.
*/
Integer getChannels() {
return channels;
}

/**
* Sets the channels value (1=mono, 2=stereo) for the encoding process. If
* null or not specified a default value will be picked.
*
* @param channels
* The channels value (1=mono, 2=stereo) for the encoding
* process.
*/
public void setChannels(Integer channels) {
this.channels = channels;
}

/**
* Returns the volume value for the encoding process.
*
* @return The volume value for the encoding process.
*/
Integer getVolume() {
return volume;
}

/**
* Sets the volume value for the encoding process. If null or not specified
* a default value will be picked. If 256 no volume change will be
* performed.
*
* @param volume
* The volume value for the encoding process.
*/
public void setVolume(Integer volume) {
this.volume = volume;
}

public String toString() {
return getClass().getName() + "(codec=" + codec + ", bitRate="
+ bitRate + ", samplingRate=" + samplingRate + ", channels="
+ channels + ", volume=" + volume + ")";
}

}
Loading

0 comments on commit b45328d

Please sign in to comment.