LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Converting video from PAL to NTSC (https://www.linuxquestions.org/questions/linux-software-2/converting-video-from-pal-to-ntsc-668944/)

jspaceman 09-10-2008 10:36 AM

Converting video from PAL to NTSC
 
I'm running Ubuntu 8.04 on my laptop. I have an .avi file that is in PAL format. I want to convert it to NTSC. What is the best way to do this that won't degrade the video quality or size?

H_TeXMeX_H 09-10-2008 12:09 PM

Well, as you can see here:
http://en.wikipedia.org/wiki/Image:C...olutions_2.svg

There's only 3 ways that I can think of:
1) Compress it vertically, this will lead to distortions on that axis.
2) Crop it, this will lead to a missing chuck at the top and/or bottom.
3) Scale it down and add borders / pad it on the left and right.

I would personally go with #3.

jspaceman 09-10-2008 01:43 PM

Basically what I want to do is convert the .avi file to NTSC so it will play on my stand-alone DVD player. My DVD player can play DiVX files in NTSC, but not PAL.

I thought about using ffmpeg with the following command:

Code:

ffmpeg -i input.avi -target ntsc-dvd -o output.avi
Would that work?

H_TeXMeX_H 09-10-2008 04:04 PM

Yes, that will definitely work, but take a look at the output before you burn it. I'm betting it will use strategy #1. If you think it looks fine, burn it. Also, I don't believe that you need a '-o' for the output file so just:

Code:

ffmpeg -i input.avi -target ntsc-dvd output.avi

H_TeXMeX_H 09-11-2008 12:52 PM

Also, you may want to check the specs of your DVD player, it will tell you stuff like what's the maximum video bitrate, audio bitrate, FPS, resolutions, etc. for a divx file. But, I'm betting if you have an divx avi to start with on a PAL DVD and it works, then when you convert it, it will work too. To see more info on the movie you can run:

Code:

ffmpeg -i input.avi
If you want to preserve as much quality as possible you should know about '-pass' option, set it to 1, then 2 and it will improve quality in the final video. If you want to pad the video with borders use '-padleft', '-padright' option. Take a look at the ffmpeg documentation it will tell you more. If you want a GUI try avidemux. Dunno if this will help, but if you find the ffmpeg documentation a bit think, here are some notes I made on how to use it:

Code:

FFMPEG

Global: <option, list>, (units), [default], =description, #see description

Command:
ffmpeg <infile options> -i infile <outfile options> outfile

NOTE: Try to use as few options as possible, only those that are needed, usually
just bitrate, size, codecs.

General:
        -formats
        -y                        =overwrite output files
        -t <hh:mm:ss.xxx>        =duration of transcoded video sequence
        -fs #                        =file size
        -ss <hh:mm:ss.xxx>        =seek
        -target <vcd, svcd, dvd, dv, pal-vcd, ntsc-svcd>
        -dframes #                =number of frames to record
        -scodec <codec>        =subtitle force

Video:
        1)        -b <bitrate> (bps) [200k]
        2)        -sameq                =variable bitrate
                -bt # (bps)        =bitrate tolerance
                -maxrate <bitrate> (bps)
                -minrate <bitrate> (bps)
        -vcodec <codec>
        -r <fps> [25]
        -s <wxh> [same as source]
        -aspect <4:3, 16:9>
        -pass <1, 2> =two pass encoding, for more accurate bitrates, high quality
        -passlogfile <file>
        -crop<top, bottom, left, right> <size> (pixel)
        -pad<top, bottom, left, right> <size> (pixel)
        -padcolor (hex) [000000]
        -vframes # =number of video frames to record
        -vn =video null, disable video
       
Audio:
        -ab <bitrate> (bps) [64k]
        -ar <freq> (Hz) [44100]
        -acodec <codec>
        -aframes # =number of audio frames to record
        -an =audio null, disable audio


jspaceman 09-11-2008 05:13 PM

I tried to convert an avi file to NTSC, but when I burned it to DVD and tried to play it on my stand-alone DVD player it wouldn't play. I'm not sure what I'm doing wrong.

According to my DVD player's manual I must use either the .avi or .divx file extension, which I did.

I used the following command to run the conversion:

Quote:

ffmpeg -i TestVideo.avi -target ntsc-dvd -sameq TestVideoNTSC.avi
FFmpeg begins the conversion and produces the following info about the input avi file:

Quote:

Input #0, avi, from 'TestVideo.avi':
Duration: 01:50:29.8, start: 0.000000, bitrate: 885 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 576x320, 25.00 fps(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
Output #0, dvd, to 'TestVideoNTSC.avi':
Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 0 kb/s, 29.97 fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 448 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
Is there something I should be doing to get a file that will play on my stand-alone player? Adjusting the bitrate?

H_TeXMeX_H 09-12-2008 03:20 AM

Ok, try this command:
Code:

ffmpeg -i TestVideo.avi -b 885k -vcodec copy -r 29.97 -pass 1 -passlogfile out.log -ab 128k -ar 48000 -acodec copy TestVideoNTSC.avi
Then run it with '-pass 2' instead of '-pass 1'

Try to find the formats that your xvid player will support. It usually supports xvid, divx, and mpeg4.


All times are GMT -5. The time now is 05:52 PM.