VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Page 4 of 7
FirstFirst ... 2 3 4 5 6 ... LastLast
Results 91 to 120 of 181
Thread
  1. Originally Posted by hemstock View Post
    Try adding /r after "for" and placing the bat file in the root folder (D:\MB)
    Thanks @hemstock

    Thanks for the '/r' tip.
    Does it mean rescan subfolders?

    That will not give the desired conversion as I pointed out.
    Quote Quote  
  2. Yes it goes through subfolders too.

    Im not familiar with what files cd players play I can't help you with the convertion.
    Quote Quote  
  3. Originally Posted by hemstock View Post
    Yes it goes through subfolders too.

    Im not familiar with what files cd players play I can't help you with the convertion.
    This is a good tip.

    Thanks.
    Quote Quote  
  4. Hello,

    Taking a clue from @baldrick's example (#1 Post) and the other from @hemstock, I created a batch file with the following commands:

    for /r %%a in ("*.mpg") do "C:\ffmpeg-20151108\bin\ffmpeg" -i "%%a" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "D:\MB\%%~na.mp4"
    pause


    It is not what I intended to do but is working as of now without any hitch and creating backup for me.

    Thanks @baldrick's and @hemstock
    Quote Quote  
  5. Hi, I'm new here; I have a question:
    tengo un archivo .mkv que tiene 2 audios; inglés y español

    My question is how to convert to mp4 and choose the audio output between English or Spanish?

    currently I use the following code:

    Code:
    for %%a in ("*.*") do C:\ffmpeg\bin\ffmpeg -i "%%a" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "convert\%%~na.mp4"
    pause
    Quote Quote  
  6. Originally Posted by ConverterCrazy View Post
    Thanks for the '/r' tip.
    Does it mean rescan subfolders?
    R for Recurse through subfolders:

    http://www.computerhope.com/jargon/r/recurse.htm

    The term comes from the way this type of code works. Typically the function handles each file in a folder calls itself (recurses) to parse each sub folder.
    Last edited by jagabo; 11th Dec 2015 at 06:35.
    Quote Quote  
  7. Delete.
    Last edited by mikezz; 20th Dec 2015 at 20:22.
    Quote Quote  
  8. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by mikezz View Post
    ... MP4 format so that it is accepted by youtube...

    Hi
    Use a command like this to create one mp4 file (whatever.mp4) from one jpg file (Herringbone.jpg) and one mp3 file (filename.mp3).
    Code:
    ffmpeg -loop 1 -i Herringbone.jpg -i filename.mp3 -shortest -c:v libx264 -tune stillimage -c:a copy -movflags faststart whatever.mp4
    Make sure it uploads OK to YouTube.

    Then add the extras to make a batch command, see the previous examples in this thread.
    Last edited by bat999; 19th Dec 2015 at 20:01.
    Quote Quote  
  9. Originally Posted by bat999 View Post
    Originally Posted by mikezz View Post
    ... MP4 format so that it is accepted by youtube...

    Hi
    Use a command like this to create one mp4 file (whatever.mp4) from one jpg file (Herringbone.jpg) and one mp3 file (filename.mp3).
    Code:
    ffmpeg -loop 1 -i Herringbone.jpg -i filename.mp3 -shortest -c:v libx264 -tune stillimage -c:a copy -movflags faststart whatever.mp4
    Make sure it uploads OK to YouTube.

    Then add the extras to make a batch command, see the previous examples in this thread.
    Thank you for your help.
    Last edited by mikezz; 20th Dec 2015 at 20:22.
    Quote Quote  
  10. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by mikezz View Post
    ... how to do a batch command that convert all my mp3 files into flv or mp4 while keep the same original filename with spaces. ..
    Hi
    This works as a batch command...
    Code:
    for %a in ("*.mp3") do ffmpeg -loop 1 -i Herringbone.jpg -i "%a" -shortest -c:v libx264 -tune stillimage -c:a copy -movflags faststart "%~na.mp4"
    If you need to make a "batch.bat" file as in the tutorial it's like this...
    Code:
    for %%a in ("*.mp3") do ffmpeg -loop 1 -i Herringbone.jpg -i "%%a" -shortest -c:v libx264 -tune stillimage -c:a copy -movflags faststart "%%~na.mp4"
    pause
    Quote Quote  
  11. Originally Posted by bat999 View Post
    Originally Posted by mikezz View Post
    ... how to do a batch command that convert all my mp3 files into flv or mp4 while keep the same original filename with spaces. ..
    Hi
    This works as a batch command...
    Code:
    for %a in ("*.mp3") do ffmpeg -loop 1 -i Herringbone.jpg -i "%a" -shortest -c:v libx264 -tune stillimage -c:a copy -movflags faststart "%~na.mp4"
    If you need to make a "batch.bat" file as in the tutorial it's like this...
    Code:
    for %%a in ("*.mp3") do ffmpeg -loop 1 -i Herringbone.jpg -i "%%a" -shortest -c:v libx264 -tune stillimage -c:a copy -movflags faststart "%%~na.mp4"
    pause
    WOW thank you!!!
    Quote Quote  
  12. edit nevermind, got it!
    Last edited by VideoHelpPlz; 25th Jan 2016 at 18:03.
    Quote Quote  
  13. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by VideoHelpPlz View Post
    edit nevermind, got it!
    Instead of deleting your question tell us how you got it. It might help others!
    Quote Quote  
  14. Member
    Join Date
    Aug 2003
    Location
    Europe
    Search Comp PM
    only madmen does mkv > mp4
    alot of players these days support mkv, even my samsung ultrahd tv does it now, and the ironiy it works even better with 4k mkv than 4k mp4
    i suspect the samsung mp4 demuxer is horrible compared to samsung mkv demuxer (suspect this is either haali or the reference one)

    anyway thanks for the great article
    Quote Quote  
  15. Member
    Join Date
    Jun 2016
    Location
    Poland
    Search PM
    Hello.
    script that i use
    Code:
    for %%a in ("*.mkv") do "D:\PROGRAMY\ffmpeg\ffmpeg.exe" -i "%%a" -vf subtitles="%%a" -acodec copy -vcodec libx264 -preset medium -tune animation -crf 23  "C:\Users\DRAKO\Desktop\Nowy folder\newfiles\%%~na.mp4"
    
    pause
    and i want convert mkv to mp4 with .ass or .srt subtitles which are in the same folder
    Last edited by cartunek; 13th Jun 2016 at 17:49.
    Quote Quote  
  16. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Originally Posted by cartunek View Post
    Hello.
    script that i use
    Code:
    for %%a in ("*.mkv") do "D:\PROGRAMY\ffmpeg\ffmpeg.exe" -i "%%a" -vf subtitles="%%a" -acodec copy -vcodec libx264 -preset medium -tune animation -crf 23  "C:\Users\DRAKO\Desktop\Nowy folder\newfiles\%%~na.mp4"
    
    pause
    and i want convert mkv to mp4 with .ass or .srt subtitles which are in the same folder
    I would see if mkv2mp4 supports that. To avoid any video reconversion.
    Quote Quote  
  17. Member
    Join Date
    Jun 2016
    Location
    Poland
    Search PM
    Originally Posted by Baldrick View Post
    Originally Posted by cartunek View Post
    Hello.
    script that i use
    Code:
    for %%a in ("*.mkv") do "D:\PROGRAMY\ffmpeg\ffmpeg.exe" -i "%%a" -vf subtitles="%%a" -acodec copy -vcodec libx264 -preset medium -tune animation -crf 23  "C:\Users\DRAKO\Desktop\Nowy folder\newfiles\%%~na.mp4"
    
    pause
    and i want convert mkv to mp4 with .ass or .srt subtitles which are in the same folder
    I would see if mkv2mp4 supports that. To avoid any video reconversion.
    Yeah... i need to make hardsubs because I want to watch on my TV, and my tv not support any sub styles etc... that's why i need to convert mkv to mp4 hardsub with external subtitles!
    Quote Quote  
  18. Originally Posted by itzdjm View Post
    Hi, I'm new here; I have a question:
    tengo un archivo .mkv que tiene 2 audios; inglés y español

    My question is how to convert to mp4 and choose the audio output between English or Spanish?

    currently I use the following code:

    Code:
    for %%a in ("*.*") do C:\ffmpeg\bin\ffmpeg -i "%%a" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "convert\%%~na.mp4"
    pause
    You need to add map command and language:eng? language:esp?
    https://ffmpeg.org/ffmpeg.html#Advanced-options
    To pick the English audio stream:

    Code:
    ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
    Quote Quote  
  19. hello I have a folder with multiple avi files who all have mp3 as their audio format. I want to extract all the Audio tracks of the files at once.

    I put all the files in the bin folder off ffmpeg so they are in the same folder as "ffmpeg.exe", "ffplay.exe", "ffprobe.exe" and my bat.
    I used this command from user KneeGrow

    FOR %%i IN ("*.avi") DO (
    echo %%i
    ffmpeg -i %%i -vn -acodec copy "newfiles\%%i.mp3"
    )
    but it doesn't work. The cmd opens, shows the code for the first file, does nothing and I can't close it anymore. I'm shure it's gone when I reboot. I would be happy if anyone knows what the right command is ?
    Quote Quote  
  20. Originally Posted by Gwar View Post
    hello I have a folder with multiple avi files who all have mp3 as their audio format. I want to extract all the Audio tracks of the files at once.

    I put all the files in the bin folder off ffmpeg so they are in the same folder as "ffmpeg.exe", "ffplay.exe", "ffprobe.exe" and my bat.
    I used this command from user KneeGrow

    FOR %%i IN ("*.avi") DO (
    echo %%i
    ffmpeg -i %%i -vn -acodec copy "newfiles\%%i.mp3"
    )
    but it doesn't work. The cmd opens, shows the code for the first file, does nothing and I can't close it anymore. I'm shure it's gone when I reboot. I would be happy if anyone knows what the right command is ?
    You trying to pass 2 different commands at once (in one line) you may try to use & operator so perhaps this will work (not tested):

    Code:
    FOR %%i IN ("*.avi") DO (echo %%i & ffmpeg -i %%i -vn -acodec copy "newfiles\%%i.mp3")
    Quote Quote  
  21. Originally Posted by pandy View Post

    You trying to pass 2 different commands at once (in one line) you may try to use & operator so perhaps this will work (not tested):

    Code:
    FOR %%i IN ("*.avi") DO (echo %%i & ffmpeg -i %%i -vn -acodec copy "newfiles\%%i.mp3")
    thanks a lot Pandy. It almost works. It just doesn' accept filenames with blanks in it and skips them.
    If ffmpeg only able to demux files with filenames which don't contain any blanks ?

    let me know
    thanks a lot
    Quote Quote  
  22. Originally Posted by Gwar View Post
    Originally Posted by pandy View Post

    You trying to pass 2 different commands at once (in one line) you may try to use & operator so perhaps this will work (not tested):

    Code:
    FOR %%i IN ("*.avi") DO (echo %%i & ffmpeg -i %%i -vn -acodec copy "newfiles\%%i.mp3")
    thanks a lot Pandy. It almost works. It just doesn' accept filenames with blanks in it and skips them.
    If ffmpeg only able to demux files with filenames which don't contain any blanks ?

    let me know
    thanks a lot
    http://stackoverflow.com/questions/6376113/spaces-problem-in-cmd
    Quote Quote  
  23. sorry I don't understand it at all I guess my english is too bad. Could you please help me with the command and where I have to insert quotations marks?
    thanks a lot
    Quote Quote  
  24. Put quotes around %%i.
    Quote Quote  
  25. works perfect now. So I summarize it for everybody:

    If you want to extract the Audio Tracks of Avi files go to the bin directory of ffmpeg, move all avi files in there, create a new folder "newfiles" and run this batch command

    FOR %%i IN ("*.avi") DO (echo "%%i" & ffmpeg -i "%%i" -vn -acodec copy "newfiles\%%i.mp3")
    thanks goes to pandy and jagabo
    cheers
    -gwar
    Quote Quote  
  26. Nice guide, hoping someone can help me. I want to run a batch command to check the integrity of multiple .mp4

    This is the command for 1 file:
    Code:
    ffmpeg -v error -i "File Name".mp4 -f null - >error.log 2>&1
    I cant get the batch part to work, any help would be greatly appreciated.
    Last edited by badogblue; 14th Jul 2016 at 08:12.
    Quote Quote  
  27. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Tried?

    Code:
    FOR %%i IN ("*.mp4") DO  ffmpeg -v error -i "%%i" -f null - >"%%i"-error.log 2>&1
    And are you running windows?
    Quote Quote  
  28. Originally Posted by Baldrick View Post
    Tried?

    Code:
    FOR %%i IN ("*.mp4") DO  ffmpeg -v error -i "%%i" -f null - >"%%i"-error.log 2>&1
    And are you running windows?
    Yes running windows 7 32bit

    Above command unfortunately doesn't work, command prompt returns:
    Code:
    %%i was unexpected at this time.
    I've also tried:
    Code:
    find . -type f -exec sh -c 'ffmpeg -v error -i "{}" -f null - > "{}".log 2>&1' \;
    It produces an error file, though it always gives the following error:

    Code:
    Access denied - .
    File not found - -TYPE
    File not found - F
    File not found - -EXEC
    File not found - SH
    File not found - -C
    File not found - 'FFMPEG
    File not found - -V
    File not found - ERROR
    File not found - -I
    File not found - -F
    File not found - NULL
    File not found - -
    File not found - '
    File not found - \;
    Quote Quote  
  29. This worked for me:
    Code:
    for %%F in (*.mp4) do ("G:\Program Files\ffmpeg\bin\ffmpeg.exe" -v error -i "%%F" -f null - >error.log 2>&1)
    But I don't have any mp4 files with errors so error.log was empty.
    Quote Quote  
  30. Originally Posted by jagabo View Post
    This worked for me:
    Code:
    for %%F in (*.mp4) do ("G:\Program Files\ffmpeg\bin\ffmpeg.exe" -v error -i "%%F" -f null - >error.log 2>&1)
    But I don't have any mp4 files with errors so error.log was empty.
    Thanks, but again I get the same error as with Baldrick's command. (%%F was unexpected at this time.)

    I tried updating ffmpeg to lastest build: f41e37b (2016-07-14), though still can't get it to work.
    Quote Quote  



Similar Threads