# Create and Run .bat file for FFMPEG code

**URL:** <https://discourse.processing.org/t/create-and-run-bat-file-for-ffmpeg-code/33482>\
**Category:** Coding Questions\
**Created:** [November 13, 2021, 12:18am UTC](https://discourse.processing.org/t/create-and-run-bat-file-for-ffmpeg-code/33482 "2021-11-13T00:18:26Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tribblesontoast](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tribblesontoast](https://discourse.processing.org/u/tribblesontoast)\
**Post date:** [November 15, 2021, 1:03am UTC](https://discourse.processing.org/t/create-and-run-bat-file-for-ffmpeg-code/33482/4 "2021-11-15T01:03:43Z")

</div>

Hi Deanomite,

- I have no idea why the file selection dialogs need to be backwards, could you set a boolean that is true once the user has selected the file and then from there call the output selection?

- Why not also have the conversion happen automatically once the output has been selected? no more need for a mouse click to trigger it.

- The redirection of the error log is allowing me (you) to print the stderror stream from ffmpeg to a text file. I did this in my program so that I could get hold of the progress of the capture i was doing and then read it back in to processing as a progress bar.

- When you convert a file you will see that in the selected folder there is also the ffmpeglog.txt file, that’s what the redirecterrorstream is doing.  
Have a look at the [thread I linked to last time](https://discourse.processing.org/t/monitoring-process-of-ffmpeg-in-processing/17950/3) and you can see hamoid and jeremy making just this suggestion.

Glad you got it to work, and I hope this has helped to clarify things. I am by no means an expert in this, Hamoid and JeremyDouglass were the reason I go this working in the first place.

edit:  
I’d also point you toward the fileFilter class from java.  
goToLoop has an example [here.](https://forum.processing.org/two/discussion/3651/selectfolder-image-filter.html).  
This will make it easier when using the select file dialog as you can filter for only .avi files.

---

_[View the full topic](https://discourse.processing.org/t/create-and-run-bat-file-for-ffmpeg-code/33482)._
