Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
16th September 2023, 20:50 | #1 | Link |
Registered User
Join Date: May 2007
Posts: 146
|
find Linux bash script equivalent to Windows batch file
Hi
I have some simple Windows batch files and Linux bash scripts using ffmpeg I can demux a folder of mp4 files to m4v files in Windows for %%a in *.mp4 do "c:\ffmpeg\bin\ffmpeg" -i "%%a" -an -c:v copy "%%a.demuxed.m4v" pause I can do the same thing in Linux with this bash script #!/bin/bash for mediafile in *.mp4; do ffmpeg -i "$mediafile" -an -vcodec copy "${mediafile%.*}.m4v" done However, I have been unable to find a Linux bash script equivalent for c:\ffmpeg\bin\ffmpeg -i "%~dpnx1" -an -c:v copy "%~dpn1.m4v" pause I can drag and drop a mp4 file and demux the video to a m4v file in Windows %~dpnx1 which expands to the drive, path, name and extension of the first argument I have searched far and wide and have not found a Linux equivalent for -i "%~dpnx1" TIA |
17th September 2023, 11:42 | #2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,990
|
I aint no linux guy (yet), I forgot everything I did know back in mid 90's -> about 2000.
Method would seem to be reliant upon OS Window Manager and maybe File Manager, so you might wanna say what you are using for better assistance. Maybe try look here for some clues:: FFMPEG Drag and Drop sh file:- https://stackoverflow.com/questions/...d-drop-sh-file Hope you find an answer. EDIT: Might wanna see this too (I aint watched it) Drag and Drop files to a BASH Shell Script:- https://www.youtube.com/watch?v=gUb5g0J963o EDIT: Above Youtube guy has lotsa clips on scripting and such.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 17th September 2023 at 11:49. |
17th September 2023, 21:32 | #4 | Link |
Registered User
Join Date: May 2007
Posts: 146
|
Looks like I found a solution
In Linux I created this bash script named audio_video_demux.sh #!/bin/bash ffmpeg -i "$1" -vn -acodec copy "${1%.*}.m4a" ffmpeg -i "$1" -an -vcodec copy "${1%.*}.m4v" $SHELL then with a right-click on a video file I use the "Open With" dialog - "Open With Other Application" then "> Use a custom command " and I typed in /home/unoit/audio_video_demux.sh the "${1%.*}.m4a" removes the original extension and adds the .m4a extension the "${1%.*}.m4v" removes the original extension and adds the .m4v extension I can select one or more video files and it processes them If i want to see the terminal with the ffmpeg banner and the output I need to drag the bash script to the terminal then drag the video[s] to the terminal Last edited by wiseant; 17th September 2023 at 22:27. Reason: add information |
Tags |
linux bash windows batch |
Thread Tools | Search this Thread |
Display Modes | |
|
|