VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Member
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    I'm new to the Mac world, and have done much of my work in Windows and linux. I have some old video that was imported from Pannicle Studio on Windows that is stored in mpeg-2 format. I would like to convert these .mpg files to anything that will be able to be imported into. I was wondering if anyone could give me any advice on the command line of ffmpeg (as I have a linux box with it also), or the ffmpegx options. Just not sure what iMovie will import as what I have tried (avi/dv) did not take. Ideas?

    Quella
    Quote Quote  
  2. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Whatever format (.mov/.mp4/.dv) you import into iMovie, will be converted to DV anyway. So to reduce the number of transcodes, you may as well convert to a .dv stream (which is slightly different from an dv-in-avi-wrapper).
    Quote Quote  
  3. Member
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    Thank for the reply. I did seem to have issues when I tried DV (AVI) as iMovie did not see it as a valid import. If oyu use handbrake or some other tool to convert witg, can you provide any additional info on the conversion options I would need? I tried "ffmpeg -i mpeg2movie.mpg -t dv newmovie.avi" and that this not work. I tried Handbrake and told it to convery to quicktime, which iMovie liked, but it said that it would take 435minutes to create the images after the import. Ideas?

    Quella.
    Quote Quote  
  4. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    I would use the Mac GUI app ffmpegX or else MPEG Streamclip to convert MPEG-2 to DV.

    ffmpegX sets a lot of options, giving a command line something like this:
    Code:
    ffmpeg -i infile.mpg -y -threads 2 -map 0.0:0.0 -f dv -vcodec dvvideo -b 25000 -aspect 16:9 -s 720x576 -r pal -g 240 -me epzs -qmin 2 -qmax 15 -acodec pcm_s16le -ab 1411 -ar 48000 -ac 2 -map 0.1:0.1 -benchmark outfile.dv
    Substitute PAL for NTSC, frame size value and 16:9 for 4:3 as needed.
    Quote Quote  
  5. Member
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    I do have the latest ffmpeg on my Linux box where the video is stored, so I may just issue the command and then see if iMovie will import it. Thanks for the help and command line. I think the big thing I was missing were all the switches you provided. I have used ffmpeg in the past to convert avi to mp4, but never to convert mpeg2 so I can import to iMovie. Let me give it a shot and let you know; if you care.

    Quella
    Quote Quote  
  6. Member
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    Here is what I get when I think I have made the corrections you spoke of...

    ffmpeg -i 2004_AZ_Tape_2.mpg -y -threads 2 -map 0.0:0.0 -f dv -vcodec dvvideo -b 25000 -aspect 4:3 -s 720x480 -r ntsc -g 240 -me epzs -qmin 2 -qmax 15 -acodec pcm_s16le -ab 1411 -ar 48000 -ac 2 -map 0.1:0.1 -benchmark 2004_AZ_Tape_2.dv
    FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
    configuration: --prefix=/usr --libdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include/ffmpeg --enable-libmp3lame --enable-libogg --enable-libvorbis --enable-libogg --enable-libtheora --enable-libfaad --enable-libfaac --enable-libgsm --enable-xvid --enable-x264 --enable-liba52 --enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl --disable-strip
    libavutil version: 49.4.0
    libavcodec version: 51.40.4
    libavformat version: 51.12.1
    built on May 30 2007 15:17:57, gcc: 4.1.2 20070502 (Red Hat 4.1.2-12)
    Input #0, mpeg, from '2004_AZ_Tape_2.mpg':
    Duration: 00:43:32.8, start: 0.222222, bitrate: 6315 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480, 5999 kb/s, 29.97 fps(r)
    Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, 224 kb/s
    Output #0, dv, to '2004_AZ_Tape_2.dv':
    Stream #0.0: Video: dvvideo, yuv420p, 720x480, q=2-15, 25 kb/s, 29.97 fps(c)
    Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    [dv @ 0xdb5a14]Can't initialize DV format!
    Make sure that you supply exactly two streams:
    video: 25fps or 29.97fps, audio: 2ch/48Khz/PCM
    (50Mbps allows an optional second audio stream)
    Could not write header for output file #0 (incorrect codec parameters ?)
    bench: utime=0.000s
    Quote Quote  
  7. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    Mea culpa. I didn't research enough how ffmpegX works with ffmpeg. Apparently the developer made two compiled versions of ffmpeg to be used by ffmpegX: ffmpeg and ffmpeg2. That fact may be related to why the CL didn't work with your binary.

    I now think this CL should do it right, tho':
    Code:
    ffmpeg -i infile.mpg -target ntsc-dv outfile.dv
    (Found on the web and tested by me with the other binary.)
    Quote Quote  
  8. Member
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    I will give this a try when I get home. I will let you know the results. Thanks again. maybe it was that I did not try ntsc-dv rather just DV. and I think I named it .avi also. Thanks.

    Quella
    Quote Quote  
  9. Member
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    Sorry for the delay in getting back to you, but we had a few issues around the house that kept me from trying your solution. I did get it to work and I'm converting the 5-6 old mpeg2 tapes to DV, but wow what a size difference. The mpeg2 is 1.3 gigs and when converted to DV it is 8+gigs! Ouch on the disk space, but good that now I can get the raw video into iMovie. Thanks so much for your help!

    Quella.
    Quote Quote  
  10. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    DV is approx 13 GB per hour. That's the cost of our 'hobby'
    Read my blog here.
    Quote Quote  



Similar Threads

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