VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 36
Thread
  1. Hello

    I would like to deinterlace a NTSC source to double framerate and save it as mpeg4. Unfortunately the aspect ratio gets wrong during the conversion because the pixel aspect ratio is set to 1. I could resize the video to 4:3 but I wonder if there is a way to set the correct pixel aspect ratio in my mpeg output file.

    Thank you in advance for your advices.
    Quote Quote  
  2. Normally the aspect ratio is automatically set while encoding using some sort of anamorphic encoding option. Which program are you using for encoding?

    Alternatively you could try remuxing/resaving the MP4 you've already created using the correct aspect ratio with something like YAMB. I don't use it much but I think you need to specify the pixel aspect ratio, not the display aspect ratio.
    Display aspect ratio/storage aspect ratio (resolution)=pixel aspect ratio.

    There's two ways the aspect ratio is saved. At the container level and within the video stream. Remuxing the video while changing the aspect ratio changes it at the container level. Most, but not all players, will obey the container aspect ratio. I'm pretty sure my Sony Bluray player ignores the container aspect ratio and follows the aspect ratio written to the video stream. It can also be changed using this command line tool. http://forum.doom9.org/showthread.php?t=152419
    Quote Quote  
  3. MeGui encoder has SAR option box, it can give SAR to videostream, Config/Misc/ Force SAR,
    you can find your value here: https://forum.videohelp.com/threads/323384-MeGUI-x264-Aspect-Ratio-Tag

    I prefer to resize, to get rid of any possible aspect ratio conflicts for good in the future and also to get rid of interlace.
    Quote Quote  
  4. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    ntsc dvd to square pixel video - 4:3 is 640x480 16/9 is 854x480 or 848x480 if you need mod16.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  5. Originally Posted by Baldrick View Post
    Originally Posted by hello_hello View Post
    Normally the aspect ratio is automatically set while encoding using some sort of anamorphic encoding option. Which program are you using for encoding?
    I use xvid mpeg-4 codec... but I could use anything else if there are some more suitable encoders. I just want to save it deinterlaced to 59.94fps and keep a correct aspect ratio. What would be the best format for my conversion?

    Originally Posted by hello_hello View Post
    Alternatively you could try remuxing/resaving the MP4 you've already created using the correct aspect ratio with something like YAMB. I don't use it much but I think you need to specify the pixel aspect ratio, not the display aspect ratio.
    Display aspect ratio/storage aspect ratio (resolution)=pixel aspect ratio.

    There's two ways the aspect ratio is saved. At the container level and within the video stream. Remuxing the video while changing the aspect ratio changes it at the container level. Most, but not all players, will obey the container aspect ratio. I'm pretty sure my Sony Bluray player ignores the container aspect ratio and follows the aspect ratio written to the video stream. It can also be changed using this command line tool. http://forum.doom9.org/showthread.php?t=152419
    I tried to change the PAR using mp4box GUI, but it didn't turn out to work finally.. I'll try with YAMB, but I wonder if these 2 options can't be set in the encoder directly..

    Originally Posted by _Al_ View Post
    MeGui encoder has SAR option box, it can give SAR to videostream, Config/Misc/ Force SAR,
    you can find your value here: https://forum.videohelp.com/threads/323384-MeGUI-x264-Aspect-Ratio-Tag

    I prefer to resize, to get rid of any possible aspect ratio conflicts for good in the future and also to get rid of interlace.
    Thank you, I'll have a try with MeGui encoder. Do you think it's better to directly resize before encoding? I was afraid it could cause some quality loss rather than keeping the original pixels places and shapes.
    Quote Quote  
  6. Originally Posted by mathmax View Post
    Do you think it's better to directly resize before encoding? I was afraid it could cause some quality loss rather than keeping the original pixels places and shapes.
    If you have good deintelacer, such as QTGMC, you have better material to work with. So you can resize (640x480). I tried to compare resized DV avi and not resized (both QTGMC deinterlaced), both encoded into H.264 with MeGui (CQ, CRF=18), watching on full HD screen, my nose sticked to screen, hardly see any differences. I'm sure there are differences, such as some lines at certain angle while moving, maybe some textures, that can make some visual effect, but hard to notice at all. I use a good DV avi source, from VX2000 camcorder, not sure if it would make any difference. I decided to resize, I sleep better somehow .
    Quote Quote  
  7. Originally Posted by _Al_ View Post
    Originally Posted by mathmax View Post
    Do you think it's better to directly resize before encoding? I was afraid it could cause some quality loss rather than keeping the original pixels places and shapes.
    If you have good deintelacer, such as QTGMC, you have better material to work with. So you can resize (640x480). I tried to compare resized DV avi and not resized (both QTGMC deinterlaced), both encoded into H.264 with MeGui (CQ, CRF=18), watching on full HD screen, my nose sticked to screen, hardly see any differences. I'm sure there are differences, such as some lines at certain angle while moving, maybe some textures, that can make some visual effect, but hard to notice at all. I use a good DV avi source, from VX2000 camcorder, not sure if it would make any difference. I decided to resize, I sleep better somehow .
    yes I use QTGMC. I think it's a pity to downscale the video. Wouldn't it be better to up-resize the height (though it's not a standard).. or to upscale to 720p?

    What do you mean by "you have better material to work with"?
    Quote Quote  
  8. Originally Posted by mathmax View Post
    What do you mean by "you have better material to work with"?
    good double frame rate resize

    This is the situation you can easily try yourself, to have some samples and to compare them. I did and choose to resize as oppose to keep original size. 720 is more than 640, understood, and original. I decided not to resize to 720x540 because upscale introduces artifacts. Maybe I was wrong. DV avi is always upscaled quite heavily, mostly to full HD so who cares if you start from 640 or 720 etc., it always look "heavily upscaled" on full HD . As I said, test it , it is 5 minutes. Original DV avi I keep anyway so no permanent loss is happening anyway ...

    Upscale to 720p does not make sense, it is not worthy an effort. Just to store lots of data that were created out of thin air anyway. Not realy I know but think of it. Upscale will not make original look better. TV or players can upscale too.
    Last edited by _Al_; 27th Mar 2012 at 15:21.
    Quote Quote  
  9. Yes I agree with upscale to 720p.. it's only longer to process on avisynth and I could notice it stores lots of data for almost no visible difference finally.

    Is it a common practice to resize to 720x540?

    I understand you prefer to resize and not to worry about the pixel aspect ratio implementations... but isn't to the detriment of some quality loss (even if very small)?

    For playing on computer, that should be the same since it would translate the pixel aspect ratio to resizing.. but how does the player process? Would it first resize to 640*480 (or 720*540) and then upscale to fit the screen?
    Quote Quote  
  10. I encode all my 720x480 sources at 720x480 (unless I crop black borders) and use aspect ratio flags. Let the player do the scaling.
    Quote Quote  
  11. Originally Posted by jagabo View Post
    I encode all my 720x480 sources at 720x480 (unless I crop black borders) and use aspect ratio flags. Let the player do the scaling.
    I'll try each method. How do you encode and set the ratio flags?
    Quote Quote  
  12. Originally Posted by mathmax View Post
    How do you encode and set the ratio flags?
    It depends on the encoder. I usually use x264 directy these days. With that you just set the command lines options for the SAR:

    --sar=8:9 (4:3 NTSC)
    --sar=32:27 (16:9 NTSC)

    For example: x264 --preset=slow --crf=18 --sar=8:9 Output.MKV Input.AVS

    In Xvid you use the PAR/DAR settings:
    Click image for larger version

Name:	xvid_ar.png
Views:	446
Size:	22.5 KB
ID:	11629

    Try the attached files in your player. Do they play 16:9? The ring of stars around the Paramount logo should be a circle, not an oval.
    Image Attached Files
    Last edited by jagabo; 27th Mar 2012 at 19:23.
    Quote Quote  
  13. Thank you Why do you choose x264 rather than Xvid?
    Quote Quote  
  14. x264 gives better image quality at equivalent bitrates.
    Quote Quote  
  15. I watched the samples that you made. They all play 16:9 in VLC

    The avi files have more compression artifacts for higher file size. Are they encoded with x264?
    Which is better: To set the pixel aspect ratio or to set the display aspect ratio?

    What did you set for the other two files ? PAR or DAR?
    Which encoder did you use for the mkv?
    Quote Quote  
  16. The AVI files are Xvid, target quantizer 3.

    PAR is easier to use. If you crop away black borders or junk at the edges of the frame the PAR does not change, the DAR does.

    I used the x264 command line encoder for the MKV file.
    Quote Quote  
  17. ok

    and what is the difference between the mp4 and the mkv?
    Quote Quote  
  18. Originally Posted by mathmax View Post
    and what is the difference between the mp4 and the mkv?
    Just different boxes in which to put your videos. MKV is more flexible. MP4 is a little better supported (PS3 and XBOX 360 can play MP4).
    Quote Quote  
  19. mmm.. what do you mean by more flexible?
    Quote Quote  
  20. Originally Posted by mathmax View Post
    mmm.. what do you mean by more flexible?
    MKV handles more codecs and other types of data. MP4 is restricted to a few codecs. For example, AC3 was added to MP4 spec only a year or two ago. But still many players can't handle AC3 in MP4.
    Quote Quote  
  21. I just tried the command line you posted above. It works fine except there is no sound. My avisynth script is just a avisource(). Should I set any additional parameters for the audio?

    Which settings should I use to get DVD quality ?
    Last edited by mathmax; 30th Mar 2012 at 16:01.
    Quote Quote  
  22. Originally Posted by mathmax View Post
    I just tried the command line you posted above. It works fine except there is no sound. My avisynth script is just a avisource(). Should I set any additional parameters for the audio?
    x264 doesn't handle the audio. After encoding I mux the audio and video together with mmg.

    Originally Posted by mathmax View Post
    Which settings should I use to get DVD quality ?
    That's hard to answer because the two codecs differ a lot in the way they handle video. And there is no single "DVD quality". CRF=18 is better image quality than your average DVD. Except for retaining grain (usually visible as blocking or posterization artifacts in dark areas). If you want to retain that grain better you can lower the CRF value to 15 or even 12. Or add "--aq-mode=2 --aq-strength=1.5" to the command line. Vary the strength between 1.0 (the default) and 2.0, to your liking. The higher the value, the more grain you retain in dark areas, and the bigger the file will be. There's also a --tune=grain option you can try using. Examples:

    x264 --preset=slow --crf=12 --sar=8:9 Output.MKV Input.AVS
    x264 --preset=slow --crf=18 --aq-mode=2 --aq-strength=1.5 --sar=8:9 Output.MKV Input.AVS
    x264 --preset=slow --crf=18 --tune=grain --sar=8:9 Output.MKV Input.AVS
    Last edited by jagabo; 30th Mar 2012 at 17:57.
    Quote Quote  
  23. Originally Posted by jagabo View Post
    Originally Posted by mathmax View Post
    I just tried the command line you posted above. It works fine except there is no sound. My avisynth script is just a avisource(). Should I set any additional parameters for the audio?
    x264 doesn't handle the audio. After encoding I mux the audio and video together with mmg.

    Originally Posted by mathmax View Post
    Which settings should I use to get DVD quality ?
    That's hard to answer because the two codecs differ a lot in the way they handle video. And there is no single "DVD quality". CRF=18 is better image quality than your average DVD. Except for retaining grain (usually visible as blocking or posterization artifacts in dark areas). If you want to retain that grain better you can lower the CRF value to 15 or even 12. Or add "--aq-mode=2 --aq-strength=1.5" to the command line. Vary the strength between 1.0 (the default) and 2.0, to your liking. The higher the value, the more grain you retain in dark areas, and the bigger the file will be. There's also a --tune=grain option you can try using. Examples:

    x264 --preset=slow --crf=12 --sar=8:9 Output.MKV Input.AVS
    x264 --preset=slow --crf=18 --aq-mode=2 --aq-strength=1.5 --sar=8:9 Output.MKV Input.AVS
    x264 --preset=slow --crf=18 --tune=grain --sar=8:9 Output.MKV Input.AVS
    well.. there is not much grain on that video. So I think I'll go with the third example. My video is a concert.. should I specify tune=film or let the default value?

    I just don't want any compression artifacts. Is crf=18 ok? Or should I be perfectionist and lower it to 16?

    There are many other parameters like --level (which I saw in quite examples on the web) but I don't know if they are needed in my case:
    http://mewiki.project357.com/wiki/X264_Settings

    Thank you for the advice about audio. Can I directly mux the AC3 of the DVD without reencoding?
    Quote Quote  
  24. Originally Posted by mathmax View Post
    My video is a concert.. should I specify tune=film or let the default value?
    It depends on your perferences. Watch the dark background when there's only a little motion. Or maybe a shot with smoke/fog effects. You may see posterization with the film option, less with the grain option.

    Originally Posted by mathmax View Post
    I just don't want any compression artifacts. Is crf=18 ok? Or should I be perfectionist and lower it to 16?
    I suggest you try encoding some difficult shots (where it's easiest to see differences) at different settings and watch the results. Then decide what's appropriate for you. All settings except CRF=0 (lossless) will result in some degradation. But it's almost impossible to see any differences below CRF=12.

    Originally Posted by mathmax View Post
    There are many other parameters like --level (which I saw in quite examples on the web) but I don't know if they are needed in my case
    You probably don't need to worry about them. Most are set by the preset and tuning you select. Or x264 will calculate an appropriate value (--level, for example). Sometimes you might need to override some of the presets. Like when encoding for Blu-ray compatibility, or for a cell phone.

    Originally Posted by mathmax View Post
    Thank you for the advice about audio. Can I directly mux the AC3 of the DVD without reencoding?
    When working with DVD sources I use DgIndex to build the index file (for Mpeg2Source() in AviSynth) and demux the audio. After encoding I use mmg to mux the x264 video and AC3 audio together.
    Quote Quote  
  25. I tried to render some tests as you advised, but I have a problem..
    When playing the encoded video with windows media player (VLC is fine). The video get highly pixelated like it can't read well the format.

    Here are the settings I use:
    x264 input.avs -o output.mp4 --preset=slower --tune=film --crf=18 --sar=8:9

    and here is a short sample:
    http://www.mediafire.com/file/5tfxp7...ypf/Output.mp4

    Any idea of the problem?
    Last edited by mathmax; 30th Mar 2012 at 20:51.
    Quote Quote  
  26. The sample looks fine here. You probably have a problem with the DirectShow MP4 reader/splitter and h.264 decoder. Try using MKV. See if that works any better. A quick remux with mmg attached.
    Image Attached Files
    Quote Quote  
  27. yes, it works using mkv. Thank you.

    Here was the problem with wmp:

    Click image for larger version

Name:	wmp.png
Views:	152
Size:	711.1 KB
ID:	11697
    Quote Quote  
  28. I encoded the video... but it's a bit slow to read on my PC (core I5 - 4gb RAM). I wonder if that is because of the double framerate

    You can download the video here:

    http://www.mediafire.com/?22w6x81vusdcslz
    http://www.mediafire.com/?968om1x458lki4f
    Quote Quote  
  29. A Core i5 should have no problems playing a 60 fps, standard definition, h.264 video. You probably have a player or DirectShow problem. My Core i5 2500K playing your video with MPCHC and software decoding:

    Click image for larger version

Name:	playback.jpg
Views:	401
Size:	70.5 KB
ID:	11720
    Last edited by jagabo; 1st Apr 2012 at 19:24.
    Quote Quote  



Similar Threads

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