VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. Hello all.

    I need some help with my input and output commands in FFMPEG.

    I need to convert multiple files at the same time. What do I need to do as input and output commands, if I want the same names on the files and the input name?

    I using:

    ffmpeg -i INPUT.MOV (-timecode 00:00:00) -c:v mpeg2video -dc 10 -sc_threshold 1000000000 -intra_vlc 1 -non_linear_quant 1 -qmin 1 -qmax 12 -bf 2 -g 12 -pix_fmt yuv422p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range mpeg -b 50M -minrate 50M -maxrate 50M -bufsize 17825792 -rc_init_occupancy 17825792 -flags +cgop+ilme+ildct -acodec pcm_s24le -ar 48000 OUTPUT.MXF
    Quote Quote  
  2. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    Perhaps can modify Baldricks bat file, shown here:

    https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg

    From:

    Code:
    for %%a in ("*.*") do ffmpeg -i "%%a" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "newfiles\%%~na.mp4"
    To:

    Code:
    for %%a in ("*.mov") do ffmpeg -i "%%a" your list of arguments "newfiles\%%~na.mxf"
    Assumes that the argument list is valid and a new folder called 'newfiles' exists.
    Last edited by sambat; 10th May 2016 at 14:18.
    Quote Quote  
  3. Hey Sambat.

    I just gives me: -bash: syntax error near unexpected token `('


    Originally Posted by sambat View Post
    Perhaps can modify Baldricks bat file, shown here:


    https://forum.videohelp.com/attachments/18041-1369651075/batch0.png

    From:

    Code:
    for %%a in ("*.*") do ffmpeg -i "%%a" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "newfiles\%%~na.mp4"
    To:

    Code:
    for %%a in ("*.mov") do ffmpeg -i "%%a" your list of arguments "newfiles\%%~na.mxf"
    Assumes that the argument list is valid and a new folder called 'newfiles' exists.
    Quote Quote  
  4. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    -bash:
    Sorry, not familiar with that term - is that Linux??
    Quote Quote  
  5. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Try remove the ( ) from

    Code:
    (-timecode 00:00:00)

    edit: Or are you using linux as sambat mentions?
    Quote Quote  
  6. No, it is on a mac.

    Im not using the timecode at all, so thats not the case.



    Originally Posted by Baldrick View Post
    Try remove the ( ) from

    Code:
    (-timecode 00:00:00)

    edit: Or are you using linux as sambat mentions?
    Quote Quote  
  7. No, I'm using a mac with os x


    Originally Posted by sambat View Post
    -bash:
    Sorry, not familiar with that term - is that Linux??
    Quote Quote  
  8. for %%a in ("*.mov") do ffmpeg -i "%%a" -c:v mpeg2video -dc 10 -sc_threshold 1000000000 -intra_vlc 1 -non_linear_quant 1 -qmin 1 -qmax 12 -bf 2 -g 12 -pix_fmt yuv422p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range mpeg -b 50M -minrate 50M -maxrate 50M -bufsize 17825792 -rc_init_occupancy 17825792 -flags +cgop+ilme+ildct -acodec pcm_s24le -ar 48000 "newfiles\%%~na.mxf"; for %%a in "*.mov" do ffmpeg -i "%%a" -c:v mpeg2video -dc 10 -sc_threshold 1000000000 -intra_vlc 1 -non_linear_quant 1 -qmin 1 -qmax 12 -bf 2 -g 12 -pix_fmt yuv422p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range mpeg -b 50M -minrate 50M -maxrate 50M -bufsize 17825792 -rc_init_occupancy 17825792 -flags +cgop+ilme+ildct -acodec pcm_s24le -ar 48000 "newfiles\%%~na.mxf"


    with a folder called 'newfiles'






    Originally Posted by sambat View Post
    -bash:
    Sorry, not familiar with that term - is that Linux??
    Quote Quote  
  9. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    I ran the following (from your code) as a bat file from a command line inside the avi file source folder and the files converted ok.

    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%a" -c:v mpeg2video -dc 10 -sc_threshold 1000000000 -intra_vlc 1 -non_linear_quant 1 -qmin 1 -qmax 12 -bf 2 -g 12 -pix_fmt yuv422p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range mpeg -b 50M -minrate 50M -maxrate 50M -bufsize 17825792 -rc_init_occupancy 17825792 -flags +cgop+ilme+ildct -acodec pcm_s24le -ar 48000 "newfiles\%%~na.mxf"
    Click image for larger version

Name:	Clipboard01.jpg
Views:	2416
Size:	23.0 KB
ID:	36956
    Quote Quote  
  10. cool. thanks

    I'm just not that good at this. But how did you do that? Did you make a .sh file and ran it in the terminal or ?


    Originally Posted by sambat View Post
    I ran the following (from your code) as a bat file from a command line inside the avi file source folder and the files converted ok.

    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%a" -c:v mpeg2video -dc 10 -sc_threshold 1000000000 -intra_vlc 1 -non_linear_quant 1 -qmin 1 -qmax 12 -bf 2 -g 12 -pix_fmt yuv422p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range mpeg -b 50M -minrate 50M -maxrate 50M -bufsize 17825792 -rc_init_occupancy 17825792 -flags +cgop+ilme+ildct -acodec pcm_s24le -ar 48000 "newfiles\%%~na.mxf"
    Image
    [Attachment 36956 - Click to enlarge]
    Quote Quote  
  11. "FOR %%a IN (*.*) DO..." is for the Windows Command Prompt, not for OS X.

    Code:
    #!/bin/bash
    
    mkdir "newfiles"
    
    for filename in ./*.mov
    	do
    		ffmpeg -i "./$filename" -c:v mpeg2video -dc 10 -sc_threshold 1000000000 -intra_vlc 1 -non_linear_quant 1 -qmin 1 -qmax 12 -bf 2 -g 12 -pix_fmt yuv422p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range mpeg -b 50M -minrate 50M -maxrate 50M -bufsize 17825792 -rc_init_occupancy 17825792 -flags +cgop+ilme+ildct -acodec pcm_s24le -ar 48000 "./newfiles/${filename%.*}.mxf"
    	done
    https://forum.videohelp.com/threads/374091-Mkvtoolnix-Batch-Remove-Audio-OSX
    Quote Quote  
  12. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    Phew!
    Got me off that hook, thanks.
    Quote Quote  
  13. That seems to do the trick. Thanks


    Originally Posted by sneaker View Post
    "FOR %%a IN (*.*) DO..." is for the Windows Command Prompt, not for OS X.

    Code:
    #!/bin/bash
    
    mkdir "newfiles"
    
    for filename in ./*.mov
    	do
    		ffmpeg -i "./$filename" -c:v mpeg2video -dc 10 -sc_threshold 1000000000 -intra_vlc 1 -non_linear_quant 1 -qmin 1 -qmax 12 -bf 2 -g 12 -pix_fmt yuv422p -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range mpeg -b 50M -minrate 50M -maxrate 50M -bufsize 17825792 -rc_init_occupancy 17825792 -flags +cgop+ilme+ildct -acodec pcm_s24le -ar 48000 "./newfiles/${filename%.*}.mxf"
    	done
    https://forum.videohelp.com/threads/374091-Mkvtoolnix-Batch-Remove-Audio-OSX
    Quote Quote  
  14. Thank you Sambat for helping me out.

    Originally Posted by sambat View Post
    Phew!
    Got me off that hook, thanks.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!