import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public Ffmpeg(IpCameraHandler handle, FFmpegFormat format, String ffmpegLocation, String inputArguments,
String input, String outArguments, String output, String username, String password) {
this.format = format;
- this.password = password;
+ this.password = URLEncoder.encode(password, StandardCharsets.UTF_8);
+
ipCameraHandler = handle;
String altInput = input;
// Input can be snapshots not just rtsp or http
if (!password.isEmpty() && !input.contains("@") && input.contains("rtsp")) {
- String credentials = username + ":" + password + "@";
+ String credentials = username + ":" + this.password + "@";
// will not work for https: but currently binding does not use https
altInput = input.substring(0, 7) + credentials + input.substring(7);
}