VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Hi, I'm doing some experimenting with ffmpegX to find the best encoding settings for a web service. I don't have too much command line experience, but my friend, who will handle the server side of the website, asked me to research video settings.

    So my goal was to try many different settings with a GUI like ffmpegX and then give him to corresponding commands that he can use in Linux on the web server.


    What I came up with from ffmpegX is this:


    Code:
    date | /Applications/ffmpegX.app//Contents/Resources/pbcopy && printf "Encoding started on " && date && /Applications/ffmpegX.app//Contents/Resources/movtoy4m 
    -w 1152 -h 672 -F 30000:1001 -a 16:9 -f -o raw -s 
    /Users/Mike/Desktop/source_clip.MOV | /Applications/ffmpegX.app//Contents/Resources/x264 
    -v -A i4x4 -b 0 --qpmin 10 --qpmax 51 -B 3000 
    --me hex --threads 2 --level 51 --fps 30000/1001 
    -o /Users/Mike/Desktop/output_clip.video.mp4 
    - 1152x672 && printf "Encoding audio..\n" && /Applications/ffmpegX.app//Contents/Resources/movtowav 
    -o /Users/Mike/Desktop/output_clip.wav
     /Users/Mike/Desktop/source_clip.MOV && /Applications/ffmpegX.app//Contents/Resources/normalize
     /Users/Mike/Desktop/output_clip.wav && /Applications/ffmpegX.app//Contents/Resources/ffmpeg -i /Users/Mike/Desktop/output_clip.video.mp4 
    -i /Users/Mike/Desktop/output_clip.wav -y -vn -f mp4 
    -acodec aac -ab 128 -ar 48000 -ac 2 
    -map 1.0:0.0 /Users/Mike/Desktop/output_clip.audio.mp4 && /Applications/ffmpegX.app//Contents/Resources/mp4box  -fps 30000:1001 -add /Users/Mike/Desktop/output_clip.video.mp4  
    -add /Users/Mike/Desktop/output_clip.audio.mp4 -new
     /Users/Mike/Desktop/andrewClip1.mp4 && rm /Users/Mike/Desktop/output_clip.wav  
    && rm /Users/Mike/Desktop/output_clip.video.mp4 && 
    rm /Users/Mike/Desktop/output_clip.audio.mp4 && 
    printf "Encoding completed on " && date && printf "\a" && printf "\n"

    I'm having some trouble translating it to plain commands. Can you guys help me? What I don't get is why it outputs it several times instead of just once... Thanks for any assistance.
    Quote Quote  
  2. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    It's impressive that a first post user is able to find these commands, as ffmpegX doesn't make it easy for you.

    What you see is not just the use of ffmpeg, but a series of commands from ffmpegX that use other tools as well. This may be quite inconvenient for your friend.

    The binary of ffmpeg that ffmpegX uses, was compiled in April of 2006. Your friend may want to run a newer, more up-to-date version of ffmpeg. Unfortunately, the syntax for these newer versions is a bit different. The abilities of newer versions allow ffmpeg to do more by itself without resorting to other tools.

    __________________
    I'll try to give a breakdown of your code below:

    /Applications/ffmpegX.app//Contents/Resources/pbcopy
    ffmpegX uses the pasteboard to transfer commands between itself and the various tools.

    printf "Encoding started on " && date
    This will "print" the start time to the terminal or log.

    /Applications/ffmpegX.app//Contents/Resources/movtoy4m
    -w 1152 -h 672 -F 30000:1001 -a 16:9 -f -o raw -s /Users/Mike/Desktop/source_clip.MOV
    ffmpegX uses movtoy4m to shift the video in .mov files to a different format. It does so only for .mov files.

    /Applications/ffmpegX.app//Contents/Resources/x264
    -v -A i4x4 -b 0 --qpmin 10 --qpmax 51 -B 3000 --me hex --threads 2 --level 51 --fps 30000/1001 -o /Users/Mike/Desktop/output_clip.video.mp4 - 1152x672
    The video gets converted to H.264 AVC using an x264 binary.

    printf "Encoding audio..\n"
    This will "print" a note that it is starting to encode the audio separately.

    /Applications/ffmpegX.app//Contents/Resources/movtowav
    -o /Users/Mike/Desktop/output_clip.wav
    /Users/Mike/Desktop/source_clip.MOV
    The audio in .mov files also gets a special treatment: it is converted to .wav (PCM). I suppose this may be needed for the next step.

    /Applications/ffmpegX.app//Contents/Resources/normalize
    /Users/Mike/Desktop/output_clip.wav
    The audio for .mov files gets a normalization treatment. I suppose this has to do with volume levels.

    /Applications/ffmpegX.app//Contents/Resources/ffmpeg -i /Users/Mike/Desktop/output_clip.video.mp4
    -i /Users/Mike/Desktop/output_clip.wav -y -vn -f mp4
    -acodec aac -ab 128 -ar 48000 -ac 2
    -map 1.0:0.0 /Users/Mike/Desktop/output_clip.audio.mp4
    Finally ffmpegX calls upon ffmpeg to convert the WAV audio to AAC.

    /Applications/ffmpegX.app//Contents/Resources/mp4box -fps 30000:1001 -add /Users/Mike/Desktop/output_clip.video.mp4
    -add /Users/Mike/Desktop/output_clip.audio.mp4 -new /Users/Mike/Desktop/andrewClip1.mp4
    MP4Box is used to mux the H.264 video and AAC audio into one file.

    rm /Users/Mike/Desktop/output_clip.wav
    rm /Users/Mike/Desktop/output_clip.video.mp4
    rm /Users/Mike/Desktop/output_clip.audio.mp4
    Temporary files get removed.

    printf "Encoding completed on " && date && printf "\a" && printf "\n"
    This will "print" the end time to the terminal or log.
    Quote Quote  
  3. Wow, thanks for the in-depth analysis. Yeah, I had to go through a few steps to find how to extract the commands from ffmpegX, using a clipboard logger. I did do some research

    I guess it's a bit more than just a dressed up ffmpeg, since it uses its own tools. Those might be difficult to replicate for me.


    We're doing a sports video analysis service, and the goal is to have users upload footage in various formats and to have our server convert them all to the same format, with the same resolution, and the same bitrate and framerate.


    From your explanation, that sounds like it might be tricky, since the tools, and I assume commands, used would depend on the incoming format. Would you have any tips on what the best way to go about this is, since the whole process has to be automated? Thanks again for your help.
    Quote Quote  
  4. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Give iFFmpeg a try. It allows 10 conversions in trial mode, but it is not too expensive to register.
    It will show the command line that it will use, before conversion, if set to do so in Preferences.
    As far as I can tell, it only relies on ffmpeg.
    It can use any of the more recent builds of ffmpeg.
    The approach is a bit different, compared to ffmpegX. It took me a while to get used to it, and there's lots more to explore for me in there.
    Quote Quote  



Similar Threads

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