Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@rdp /test.c

C/java seem to run it reliably
#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);
printf("done file\n\n\n");
// 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];
System.out.println("hellostderr" + new String(bytes));
bytes = new byte[2000];
System.out.println("hellostdout" + new String(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.