Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Video Conversion For Mobile / PC

  1. #11
    Join Date
    Jun 2011
    Beans
    44

    Re: Video Conversion For Mobile / PC

    Quote Originally Posted by Olle Wiklund View Post

    I will come back with a couple of simple examples to make 3gp and mkv files (but I will be busy for a while now).
    Ok! Till that time, would be reading forum for this problem. Thanks !

  2. #12
    Join Date
    Sep 2006
    Beans
    3,713

    Re: Video Conversion For Mobile / PC

    Quote Originally Posted by msinfo View Post
    3. How can I convert video or audio using Winff or any other converter, when I can't find preset of my choice.
    You will have to make your own preset or use ffmpeg directly.

    Quote Originally Posted by msinfo View Post
    4. Will audio/video converters would be using mine installed codecs, or they would use their custom codecs.
    It depends on the audio/video converters. WinFF uses ffmpeg directly, but Avidemux uses customised versions of the FFmpeg libraries. I'm not sure what Handbrake does since I'm not very familiar with it.

    Quote Originally Posted by msinfo View Post
    5. Can I make custom presets in Winff or any other converter.
    Yes. I don't have WinFF installed, but I believe it would be easy to make your own presets.

    Quote Originally Posted by msinfo View Post
    6. How can I know what should be right values for factors like bitrate, frame, resolution etc. for various devices like pc, mobile, etc.
    Sometimes you don't and you will have to experiment or search for examples. I usually start by looking at the manufacturer's web site for specifications of the device as a starting point, but they are often not very useful. You can also find a video that does work on the device and try to make something similar with ffmpeg.

    Quote Originally Posted by msinfo View Post
    7. Can anyone please, give me a example of command line code, for converting an .avi movie to 3gp, and another one to .mkv. By keeping that as a base I would try to experiment with conversion process
    3gp and mkv are container formats. They can utilise a number of audio and video formats, so you need to be more specific as to what you want. For example, 3gp can contain three different video formats, and two different audio formats (with variations of each), and mkv can handle just about any format. See Comparison of container formats for a nice chart.

  3. #13
    WasMeHere is offline Iced Almond Soy Ubuntu, No Foam
    Join Date
    May 2008
    Location
    Sverige
    Beans
    1,133

    Re: Video Conversion For Mobile / PC

    I am including a script, that is modified from my script to convert files from my video camera to files that can be played by computers (in general) and my TV set. That script converts from 1920x1080-50p MTS files to 1920x1080-30p, 1280x720-50p and 960x540-50p mp4 files encoded with libx264, which as far as i understand should be used for 3g2 files.

    According to information on the internet (you can easily browse to find tutorials and detailed examples) ffmpeg can be told to select suitable formats and codecs by specifying the extensions of the file names. This feature needs some 'help' in certain cases; you need to specify more using options. I have run the included script and it works for me in Ubuntu Studio 11.04 (and I can play files converted from my old photo camera's avi files), but as FakeOutdoorsman wrote, you need to be more specific or tweak the options yourself, to make it work for your particular purpose. And it might need modifications to run in another version of Ubuntu. Regard it as a starting point, not something to use as it is!

    Code:
    #! /bin/bash
    
    if [ "$2" == "" ]
    then
     echo "Usage: $0 <avi file> <output video resolution>"
     echo "ex:    $0 file.avi 640x480  or"
     echo "       $0 file.avi 320x240"
     exit
    fi
    
    typeset infile="$1"
    
    if test -f $infile
    then
     if [ $infile == ${infile/\.avi} ]
     then
      echo "$infile is not an avi file"
      exit
     fi
    else
     echo "$infile not found"
     exit
    fi
    
    if [ "$2" != "" ]
    then
     typeset namex="$2"
     typeset res="$2"
     typeset framerate=30
     typeset bitrate=512k
    fi
    
    typeset infile="${infile/\.avi}.mp4"
    typeset tmpfile="${infile/.mp4}_tmp.3g2"
    typeset outfile="${infile/.mp4}_$namex.3g2"
    typeset mkvfile="${infile/.mp4}_$namex.mkv"
    
    if test -f "$infile"
    then
     echo "$infile exists, no need to make it again"
    sleep 5
    else
     ffmpeg  -i $1 -vcodec mpeg2video -sameq "$infile"
    sleep 5
    fi
    
    # 3g2
    typeset options="-vcodec libx264 -s $res -r $framerate -b $bitrate -flags +loop+mv4 -cmp 256 \
    	   -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 \
    	   -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 \
    	   -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 \
               -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 2\
    	   -qmax 51 -qdiff 4"
    
    ffmpeg -y -i "$infile" -an -pass 1 -threads 2 $options "$tmpfile"
    ffmpeg -y -i "$infile" -acodec libfaac -ar 48000 -ab 192k -pass 2 -threads 2 $options "$tmpfile"
    
    qt-faststart "$tmpfile" "$outfile"
    touch -r "$1" "$outfile"
    rm ffmpeg2pass-0.log x264_2pass.log x264_2pass.log.mbtree "$tmpfile"
    
    # mkv
    ffmpeg -i "$outfile" -sameq "$mkvfile"
    touch -r "$1" "$mkvfile"

  4. #14
    Join Date
    Jun 2011
    Beans
    44

    Re: Video Conversion For Mobile / PC

    Originally Posted by : FakeOutdoorsman
    You can also find a video that does work on the device and try to make something similar with ffmpeg.
    1. Million Thanks for your replies and threads, it helped me to clear my doubts about multimedia conversiona and ffmpeg also.
    2. Yes, I will now experiment with ffmpeg as you guided above.

    Originally Posted by : Olle Wiklund
    you can easily browse to find tutorials and detailed examples
    1. I am happy to see ffmpeg command including script you wrote.
    2. Yep, I saw many tutorials and sample code of ffmpeg. But thought before executing anything blindly, I should know what I am doing.

    To,
    FakeOutdoorsman and Olle Wiklund,
    Thanks for helping and giving solid foundation on conversion subject.

  5. #15
    WasMeHere is offline Iced Almond Soy Ubuntu, No Foam
    Join Date
    May 2008
    Location
    Sverige
    Beans
    1,133

    Re: Video Conversion For Mobile / PC

    You are welcome

    Finally, when you succeed, please share your result at the Ubuntu Forums (for example by posting some scripts)!

    Olle

  6. #16
    Join Date
    Jun 2011
    Beans
    44

    Re: Video Conversion For Mobile / PC

    Quote Originally Posted by Olle Wiklund View Post
    You are welcome

    Finally, when you succeed, please share your result at the Ubuntu Forums (for example by posting some scripts)!

    Olle

    Why not sure!
    Right now, just chopping some big 700 mb videos to test file of 10 mb (using windows Format factory) and would be experimenting with them for conversion under linux environment.

  7. #17
    Join Date
    Mar 2007
    Location
    Outer Milky Way
    Beans
    Hidden!
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Video Conversion For Mobile / PC

    I'm not sure why no one mentions mencoder.

    I love mencoder. It uses many ffmpeg libraries, but is far faster and more efficient, IMO. I tend to get some strange artifacts with ffmpeg from time to time.

    I convert everything with mencoder, including NTSC DVDs.

    I converted a 100 movie DVD collection to AVI (with XVID/MP3) in about 3 days. I use .AVI with XVID/MP3 because that is the only format that is recognized on every one of my devices: DVD players, Windows computers, (K)Ubuntu computers, Android tablets/eBook readers, and even MP3 players (although these require a specific 320x240 size). No other format combination works on all of these. (I don't use any Apple products, so I can't vouch for those).

    (Yes, yes, .MKV is a superior container, X264/H.264 is a superior video codec, and there are superior audio codecs, but if my devices can't play them what's the point?)

    Mencoder will convert to/from any format (provided you have the codecs), including X264/H.264, MP4, whatever. Handbrake is a great program and can handle a lot of encryption (since it rips by streaming), but it has a limited number of output formats and almost none of my devices (except computers) can handle its formats.

    I happen to like using mencoder with k9copy as a front end, which I think is a great utility. (k9copy is a frontend for both mencoder and ffmpeg).

    The instructions I use for mencoder are here:

    http://ubuntuguide.org/wiki/Video_Conversion
    Last edited by perspectoff; June 11th, 2012 at 04:34 PM.

    UbuntuGuide/KubuntuGuide

    Right now the killer is being surrounded by a web of deduction, forensic science,
    and the latest in technology such as two-way radios and e-mail.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •