Hi
I have been using this ffmpeg batch file to check for video errors
c:\ffmpeg\bin\ffmpeg -v error -i "%~dpnx1" -f null - >"%~dpnx1.error.txt" 2>&1
pause
I just drag and drop a file or folder onto the .bat file
Can someone convert this to a Linux shell script
TIA
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
Last edited by wiseant; 30th Aug 2023 at 19:45. Reason: spelling
-
#!/bin/bash
SAVEIFS=$IFS
for file in $*
do
ffmpeg -v error -i $file -f null - > $file.log
done
IFS=$SAVEIFS
Save as whatever.sh to run do sh whatever.sh file.mkv
To have dragband drop you need a whatever.desktop file. It doesn't have to actually be on the desktop. Example one chance to whatever you are the script as. On my phone so will clean up more later.
[Desktop Entry]
Type=Application
Name=ac-3 2 channel
GenericName[en]=ac-3 2 channel
Comment=ffmpeg convert to 256k 2 channel AC-3
Icon=ac3
Exec=sh /home/witzel/Desktop/work/ffmpeg-ac3-256k-2ch-out.sh %F
Terminal=true
Categories=Audio
Keywords=audio;avisynthif all else fails read the manual -
@dannyboy48888
Thank you for taking the time to reply
I was able to figure it out - here is my script
for mediafile in *.mkv *.mp4; do
echo $mediafile
ffmpeg -v error -i "$mediafile" -f null - >"$mediafile.error.txt" 2>&1
echo "finished error-check on $mediafile"
done
echo "all done"
$SHELL
and I did create a desktop file:
[Desktop Entry]
Encoding=UTF-8
Name=Drop Over Me
Comment=Execute the script with the file dropped
Exec=xfce4-terminal -e "/home/unoit/Downloads/auto_ffmpeg.sh"
Icon=utilities-terminal
Type=Application
Terminal=true
StartupNotify=true
I am not entirely sure what entries I should and should not have in my file.desktop
In Linux Mint I can drag a mp4 or mkv video from a directory to my desktop file and it will error-check all of the mp4 and mkv files
However this does not work for me in antiX distro - here I have to have the script in the same folder as my videos and I can double-click the script or run it from the terminal
In your desktop file for the Exec entry you are using %F - what does this do? -
The %F passes all file names to the script when you drop a list on the desktop file. %f would do one process per filename (you don't want that). Without %F the desktop file won't work as it's not passing a name to the script to process. Sorry about the late reply will write you a script/desktop file if needed. Works on xfce in my case
if all else fails read the manual -
@dannyboy48888
In order to work using antiX distro, my scripts need to be in the same directory as my video files - then I double-click the .sh file and it processed the videos in that directory - or I can run this:
cd /media/Backup/Walking; ./demux_audio.sh in terminal - or drag and drop demux_audio.sh to terminal
I have five scripts that I use - it would be easier if I could just drag and drop the folder or one file if it will also process the other relevant files
here is my demux_audo.sh:
for mediafile in *.mp4; do
echo $mediafile
ffmpeg -i "$mediafile" -vn -acodec copy "${mediafile%.mp4}.m4a"
echo "finished demuxing $mediafile"
done
$Shell
I made a .desktop file for demux_audio.sh
[Desktop Entry]
Type=Application
Name=DemuxAudio
Comment=demux audio from video file[s]
Icon=utilities-terminal
Exec=sh /media/Backup/Walking/demux_audio.sh %F
Terminal=true
when I drag the video folder onto demux_audio.desktop - "Failed to execute child process 'xterm" (No such file or directory"
when I drag a video file onto demux_audio.desktop - "Failed to execute child process 'xterm" (No such file or directory"
TIALast edited by wiseant; 2nd Sep 2023 at 19:28. Reason: add info
Similar Threads
-
Linux full ffmpeg x264 bash script for quick & dirty & fast video encoding
By M.Shiver in forum LinuxReplies: 16Last Post: 6th Nov 2023, 11:30 -
images to mkv and webp by using ffmpeg into a .bat file
By maudit in forum Video ConversionReplies: 2Last Post: 15th Aug 2023, 03:17 -
FFMpeg Auto output Name on .bat Script file
By Daringbaaz in forum Newbie / General discussionsReplies: 10Last Post: 6th Dec 2020, 09:44 -
ffmpeg in bat file
By windranger in forum Video ConversionReplies: 5Last Post: 25th Jul 2020, 03:27 -
How To Learn File Conversion Using ffmpeg on Linux.
By carlarogers in forum Video ConversionReplies: 1Last Post: 13th Jun 2020, 13:10