Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

C/java seem to run it reliably

View test.c
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#include <stdio.h>
 
void main(char **argv) {
int a = 0;
for(a = 0; a < 100; a++) {
FILE *lsofFile_p = popen("temp\\ffmpeg.exe -list_devices true -f dshow -i dummy 2>&1", "r");
 
if (!lsofFile_p)
{
printf("bad p");
return -1;
}
 
int b;
for(b = 0; b < 20; b++) {
char buffer[1024];
char *line_p = fgets(buffer, sizeof(buffer), lsofFile_p);
printf("got %s", buffer);
}
pclose(lsofFile_p);
printf("done file\n\n\n");
}
 
}
View test.c
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// also appears to run fine
 
class test {
 
public static void main(String... args) throws Exception {
 
Process process = Runtime.getRuntime().exec("temp\\ffmpeg.exe -list_devices true -f dshow -i dummy");
byte[] bytes = new byte[4000];
process.getErrorStream().read(bytes);
System.out.println("hellostderr" + new String(bytes));
bytes = new byte[2000];
process.getInputStream().read(bytes);
System.out.println("hellostdout" + new String(bytes));
 
process.getErrorStream().read(bytes);
System.out.println("hellostderr2" + new String(bytes));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.