Hi,
I'm looking for the ideal transcoding software for xvid, and looking for suggestions. These are the features I'd like:
-mt2s/mkv (h.264/avc) or DVD/.vob/.mpg inputs
-proper ITU aspect ratio
-encoding to xvid/anamorphic with flagging
-use custom matrices besides mpeg/h.263 is a bonus
-copy 5.1 ac3 or convert stereo/mono to mp3
-output based on size, such as 1/6 dvd for tv episodes
-batch conversion
-GPU acceleration in the decoder (especially for HD source)
I've tried Staxrip, but got flashing green bars at the bottom of the video, and the quality was poor. Then I tried Hybrid, but it played back as 4:3 and didn't flag as anamorphic. I found MeGui too complicated to use. There was one software I tried a while ago that I liked but I can't recall which it was, but it did handle the anamorphic part well. Handbrake is out because it only supports mkv output. I'm using older video equipment so I need xvid in avi.
Thanks.
+ Reply to Thread
Results 1 to 24 of 24
-
Last edited by jmac698; 14th Feb 2014 at 05:04.
-
Perhaps this is a separate issue, but I thought I should tag my videos when making them. I'm not sure what the standards for this are. Is there a way to embed genre, title, date, poster like music files? I'm not worried about doing the iTunes way, but would like to tag it for mediaportal or xmbc, whatever they support.
-
Then I tried Hybrid, but it played back as 4:3 and didn't flag as anamorphic.
Attached a small 17s clip which according to MediaInfo is properly flagged and was created using Hybrid:
Code:G:\Hybrid>MediaInfo.exe h:\Output\xvid_pal_16_9.avi General Complete name : h:\Output\xvid_pal_16_9.avi Format : AVI Format/Info : Audio Video Interleave File size : 3.10 MiB Duration : 17s 160ms Overall bit rate : 1 513 Kbps Writing application : MEncoder SVN-r36824-4.8.2 Writing library : MPlayer Copyright : Hybrid 2014.02.14.1 Video ID : 0 Format : MPEG-4 Visual Format profile : Advanced Simple@L5 Format settings, BVOP : 2 Format settings, QPel : No Format settings, GMC : No warppoints Format settings, Matrix : Default (H.263) Codec ID : XVID Codec ID/Hint : XviD Duration : 17s 160ms Bit rate : 1 507 Kbps Width : 720 pixels Height : 576 pixels Display aspect ratio : 3:2 Original display aspect ratio : 16:9 Frame rate : 25.000 fps Standard : PAL Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Compression mode : Lossy Bits/(Pixel*Frame) : 0.145 Stream size : 3.08 MiB (100%) Writing library : XviD 64
I've tried Staxrip, but got flashing green bars at the bottom of the video,..
Got no problem using StaxRip, MeGui, and Hybrid to create the output you want.
Cu Selur -
Hello,
Thanks for the reply and sample, it really helps me verify things. And in fact, your sample plays back in 4:3. I also verified the aspect ratio with mpegmodifier, which says the aspect was custom, 16:11, which is correct for PAL I believe. It also reports h.263 matrix and 2 consecutive B-VOPs.
I played it back with VLC which shows a square, distorted image. When I fixed it with mpegmodifier, it played back correctly in VLC. I'd like to avoid this step. The quality was excellent, however.
https://www.videohelp.com/tools/MPEG4-Modifier
MediaInfo shows DAR (Display Aspect Ratio) as 3:2, which is squareish. After being fixed, Mediainfo shows DAR=16:9. So it's quite clear that Hybrid doesn't work. -
Confirmed. In mpc-hc, both the orginal and fixed files play at approximately 16:9. There is a difference in aspect however, and I expect that 16:9 from ITU PAL is not the correct value (I think it should be slightly wider). Whatever mpeg4modifier does, overrides the original file.
The question is, is this a bug in vlc, is mpc-hc doing something smart, but really that's irrelevant, is there a way to make a file that's more compatible? Perhaps there's two ways of signalling, the container and the codec? I'd need an expert opinion on this. I'll have to test this on my actual set-top boxes as well.
p.s. both are 16:9 on the WDTV and both 4:3 on the BlurayI'm pretty sure there were files that worked on the Bluray, I'll continue testing.
Last edited by jmac698; 14th Feb 2014 at 16:34.
-
Aspect ratio support for MP4/MKVs is fairly hit and miss when it comes to hardware players. Chances are outside a PC, it'd be somewhat rare for AVIs. If encoding with Xvid and using AVI, I'd be resizing to square pixels.
MeGUI isn't overly hard. Use the File/Open menu to open a file and MeGUI should offer to index it and extract the audio. Add the indexing job to the queue and run it. When it's done the script creator opens with a preview. It can add de-interlacing etc if need be, but for "output, same as input" in respect to aspect ratios, it should be just a matter of enabling anamorphic encoding and selecting the "encode non-mod16" setting. (I think that's what it's called, but it's the only one which doesn't resize and won't adjust any cropping at all). If cropping is also disabled, the resolution and aspect ratio of the encoded video should be the same as the source.
Save the script, and it'll be loaded into the video section for encoding. The extracted audio (or a script) should also be loaded into the audio section. You don't need to encode the audio. -
Maybe I can try other containers as well. A 640x368 file was displayed at 16:9 with the Bluray, though signalled to be 2.35:1. It seems it's making a simple decision based on resolution more than anything else.
I'd still like to make them compatible with VLC, as I have a lot of issues with mpc-hc. There's a bug in the Nvidia drivers so some forms of upscaling don't work, and it also crashes a lot on me. -
I don't know anything about aspect ratios in AVIs, however, from Selur's MediaInfo:
Display aspect ratio : 3:2
Original display aspect ratio : 16:9
Normally that'd mean the correct aspect ratio was written to the video stream, but not written to the container (AVI)., or the other way around, but I didn't think the AVI container itself could contain aspect ratio info as MP4s/MKVs can, so to display correctly it relies on the player paying attention to any aspect ratio written to the video stream. If AVIs can't have aspect ratios as such, I don't understand why there's two of them.
Normally, one player might use the stream aspect ratio while another might give preference to a container aspect ratio.... assuming they're not the same. MPC-HC has a setting for it in it's video decoder configuration.
When it comes to AVIs though, I'd have thought there could be only one aspect ratio.
MediaInfo, after using MeGUI for a quick test. I set an odd aspect ratio deliberately, but there's only one, and both MPC-HC and VLC obey it. It's Xvid/AVI.
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 0.750
Frame rate : 25.000 fps
Even if there's a stream aspect ratio and a container aspect ratio, if they're the same MediaInfo usually only shows a single "Display aspect ratio".
When I open the above video with MPC-HC, it opens using the correct aspect ratio. When I open the sample from post #3, it seems to open in two steps. First using a 720/576 aspect ratio, but it very quickly resizes to 16:9.
Maybe someone else will know how/if AVIs can have two aspect ratios.
The tooltip for the LAV video decoder aspect ratio setting mentions 3 different aspect ratios. Stream AR, Frame AR and Container AR. Is there a distinction between them, specifically the first two?
Sorry.... I'm all questions and no answers.Last edited by hello_hello; 14th Feb 2014 at 17:39.
-
Problem might be the difference between the aspect ratio in the container and the aspect ratio in the stream.
If these differ, the one in the container should overrule the aspect ratio of the stream.
From the looks of it VLC ignores the aspect ratio of the container or prefers the aspect ratio of the stream.
MPEG4Modifier changes the aspect ratio flag of the stream, which is probably why it helps fixing the file for VLC.
---
hello_hello was faster
btw. command lines to create the stream I posted were:
Code:mencoder -lavdopts threads=8 -ofps 25 -ovc xvid -xvidencopts pass=1:turbo:bitrate=1500:me_quality=6:quant_type=h263:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:max_key_interval=250:keyframe_boost=10:kfthreshold=1:kfreduction=20:quant_type=h263:max_bframes=2:bquant_ratio=150:bquant_offset=100:bf_threshold=0:vhq=2:bvhq=1:curve_compression_high=0:curve_compression_low=0:overflow_control_strength=10:max_overflow_improvement=10:max_overflow_degradation=10:trellis:noqpel:nogmc:nocartoon:chroma_opt:chroma_me:nointerlacing:par=ext:par_width=16:par_height=11:closed_gop:nopacked:threads=8 -passlogfile "H:\Temp\xvid_pal_16_9_12_55_12_3110_01.stats" -demuxer lavf -vfm ffmpeg -noskip -vf scale,format=i420,scale=720:576,scale,format=i420 -sws 10 -forcedsubsonly -nosub -nosound "F:\TESTCL~1\test.avi" -o NUL
Code:mencoder -lavdopts threads=8 -ofps 25 -ovc xvid -xvidencopts pass=2:bitrate=1500:me_quality=6:quant_type=h263:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:max_key_interval=250:keyframe_boost=10:kfthreshold=1:kfreduction=20:quant_type=h263:max_bframes=2:bquant_ratio=150:bquant_offset=100:bf_threshold=0:vhq=2:bvhq=1:curve_compression_high=0:curve_compression_low=0:overflow_control_strength=10:max_overflow_improvement=10:max_overflow_degradation=10:trellis:noqpel:nogmc:nocartoon:chroma_opt:chroma_me:nointerlacing:par=ext:par_width=16:par_height=11:closed_gop:nopacked:threads=8 -passlogfile "H:\Temp\xvid_pal_16_9_12_55_12_3110_01.stats" -demuxer lavf -vfm ffmpeg -noskip -vf scale,format=i420,scale=720:576,scale,format=i420 -sws 10 -forcedsubsonly -nosub -nosound "F:\TESTCL~1\test.avi" -of avi -o "H:\Temp\xvid_pal_16_9_12_55_12_3110_02.avi"
ar_width=16
ar_height=11" part should normally properly set the pixel aspect ratio,..
extending the mencoder calls with "-force-avi-aspect ..." might help to also change the other aspect ratio flag.
And yes in my example I used the MP4 aspect ratio not the ITU aspect ratio, since the output is an MPEG-4 file.Last edited by Selur; 14th Feb 2014 at 17:46.
-
I guess aspect ratios in an AVI container is some sort of a "hack" which players may or may not be able to use.
Even when encoding with x264 and using MKV I've given up on anamorphic encoding. The media players in the TVs here, as well as one of the Bluray players, are oblivious to MKV/MP4/AVI aspect ratios no matter how they're written.
So for 16:9 PAL I'd resize to 1024x576 and forget about anamorphic issues. Resizing "up" to square pixels that way retains more detail than resizing "down" to square pixels (ie 720x404 etc). Resizing "down" was more the norm for AVI, as most AVI capable DVD players are limited to a width of 720, but if you're playing the encoded video with almost any other type of hardware player it shouldn't be a problem these days.
Of course resizing "up" will require more bitrate, or x264 instead of Xvid would be a good idea, otherwise the file sizes might get a little out of control. Even when using the x264 encoder, I often resize 16:9 PAL to 960x540. I can't see a loss of detail compared to 1024x576, but there's a little less video to encode. -
The AVI container has no aspect ratio flags*, only the frame width and height. Display or Pixel aspect ratio information is in the encoded stream. So a program has to parse the encoded stream to get that information. It can't just look at the header.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd318189%28v=vs.85%29.aspx
http://www.the-labs.com/Video/odmlff2-avidef.pdf
* Actually, there are AR flags defined in the ODML extensions but nobody uses them. -
This is the command line MeGUI uses, it seems to only send the PAR to the encoder. If there's a container aspect ratio set, I'm not sure how that works. Ignore the odd resolution and PAR.... I was messing around.
--[Information] [15/02/14 9:45:15 AM] Job commandline: "C:\Program Files\MeGUI\tools\xvid_encraw\xvid_encraw.exe" -i "D:\test.avs" -single -cq 2.0 -max_key_interval 250 -lumimasking -max_bframes 1 -bvhq -par 69:176 -avi "D:\test.avi"
---[Information] [15/02/14 9:45:21 AM] Trying to retrieve width and height from input header
---[Information] [15/02/14 9:45:21 AM] xvid [info]: Avisynth detected
---[Information] [15/02/14 9:45:21 AM] xvid [info]: Input colorspace is YV12
---[Information] [15/02/14 9:45:21 AM] xvid [info]: Input is 704 x 368, 25.000fps (25/1), starting from frame 0
---[Information] [15/02/14 9:45:21 AM] xvid [info]: Number of frames to encode: 376
---[Information] [15/02/14 9:45:21 AM] xvid [info]: xvidcore build version: xvid-1.2.2
---[Information] [15/02/14 9:45:21 AM] xvid [info]: Bitstream version: 1.2.2
The output file seems to be written directly to AVI, so would the Xvid encoder be responsible for making sure the correct AVI aspect ratio is used, assuming the AVI can have an aspect ratio? I've no idea how it all works. Or why I'm thinking about it...... -
-
The Xvid stream indicates the PAR is 16:11. The AVI Stream Header contains an ODML vprop chunk. That indicates the dwFrameAspectRatio 16384:11263. That's essentially 16:11. As I understand the ODML spec that appears to be a mistake as it's the pixel aspect ratio not the display aspect ratio. Maybe that's what's confusing MediaInfo. If you mangle the "vprp" fourcc to "xprp" MediaInfo only shows a Display Aspect Ratio of 16:9.
-
ffmpeg libxvid implementation wasn't as good quality wise as xvidvfw
---
btw. can someone explain to me why using:
1st pass:
Code:mencoder -lavdopts threads=8 -ofps 25 -ovc xvid -xvidencopts pass=1:turbo:bitrate=1500:me_quality=6:quant_type=h263:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:max_key_interval=250:keyframe_boost=10:kfthreshold=1:kfreduction=20:quant_type=h263:max_bframes=2:bquant_ratio=150:bquant_offset=100:bf_threshold=0:vhq=2:bvhq=1:curve_compression_high=0:curve_compression_low=0:overflow_control_strength=10:max_overflow_improvement=10:max_overflow_degradation=10:trellis:noqpel:nogmc:nocartoon:chroma_opt:chroma_me:nointerlacing:par=ext:par_width=16:par_height=11:closed_gop:nopacked:threads=8 -passlogfile "H:\Temp\xvid_pal_16_9_avi-force-aspect_01_32_08_7010_01.stats" -demuxer lavf -vfm ffmpeg -noskip -vf scale,format=i420,scale=720:576,scale,format=i420 -sws 10 -forcedsubsonly -nosub -nosound "F:\TESTCL~1\test.avi" -o NUL
Code:mencoder -lavdopts threads=8 -ofps 25 -ovc xvid -xvidencopts pass=2:bitrate=1500:me_quality=6:quant_type=h263:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:max_key_interval=250:keyframe_boost=10:kfthreshold=1:kfreduction=20:quant_type=h263:max_bframes=2:bquant_ratio=150:bquant_offset=100:bf_threshold=0:vhq=2:bvhq=1:curve_compression_high=0:curve_compression_low=0:overflow_control_strength=10:max_overflow_improvement=10:max_overflow_degradation=10:trellis:noqpel:nogmc:nocartoon:chroma_opt:chroma_me:nointerlacing:par=ext:par_width=16:par_height=11:closed_gop:nopacked:threads=8 -passlogfile "H:\Temp\xvid_pal_16_9_avi-force-aspect_01_32_08_7010_01.stats" -demuxer lavf -vfm ffmpeg -noskip -vf scale,format=i420,scale=720:576,scale,format=i420 -sws 10 -forcedsubsonly -nosub -nosound "F:\TESTCL~1\test.avi" -force-avi-aspect 1.81818 -of avi -o "H:\Temp\xvid_pal_16_9_avi-force-aspect_01_32_08_7010_02.avi"
Code:mencoder -ovc copy -nosound "H:\Temp\xvid_pal_16_9_avi-force-aspect_01_32_08_7010_02.avi" -ffourcc XVID -force-avi-aspect 1.81818 -info copyright="Hybrid 2014.02.14.1" -ofps 25 -of avi -o "H:\Output\xvid_pal_16_9_avi-force-aspect.avi"
Code:Pixel aspect ratio : 1.454 Original pixel aspect ratio : 1.455 Display aspect ratio : 1.818 Display aspect ratio : 16:9
Last edited by Selur; 15th Feb 2014 at 01:53.
-
You would think they'd be the same, but they are not. Not all options are available or working, and there are bugs with some of the flags
For example, even if we disregard ffmpeg IVTC issues (e.g. use the same avs script, ivtc thru avisynth) , there are missing frames that are present when using another encoder with ffmpeg (eg. utvideo, libx264). There are quality issues with "ghosting" with some decoders like the default xvid decoder through VFW. Even the frames which are "ok", seem to be lower in quality
ffmpeg would be ideal in terms of decoding , batching, audio pass though, aspect ratio (even AVI intermediates like UTvideo get the correct AR flags for media players) , but the libxvid implementation is wonky. -
jagabo: how does DV-AVI convey AR info about 4:3 vs. 16:9? That method consistently works in all media players and applications
-
In xvidvfw, when you select the AR parameters, is that info embedded in the bitstream as well ?
It says "AR is written to the MPEG4 bitstream, but unfortunately likely to be ignored if encapsulated in a general purpose container (MKV, AVI)"
How is that different than DV-AVI's implementation of writing the info in the stream? Because DV-AVI works everywhere, but xvidvfw's AR info is sometimes ignored in some applications -
Similar Threads
-
Cinema Craft Encoder sp3 (cce sp3) & xvid source
By Genaugmen in forum Video ConversionReplies: 6Last Post: 16th Sep 2013, 22:55 -
Xvid encoder problems
By Nobility350 in forum Video ConversionReplies: 32Last Post: 13th Feb 2013, 16:29 -
which is better Mainconcept MPEG Encoder or H.254 Encoder
By d_unbeliever in forum Newbie / General discussionsReplies: 7Last Post: 4th Aug 2012, 18:14 -
How it possible Video: X264 encoder with Matroska encoder extension?
By flash_os in forum Newbie / General discussionsReplies: 1Last Post: 11th Feb 2012, 09:13 -
Best xvid encoder
By sanosuke in forum Video ConversionReplies: 4Last Post: 6th Oct 2010, 09:20