View Full Version : Converting mts files.
castellanos
31st August 2013, 01:31
Hi there!
It's been a long time! :scared:
I've recorded a video of a concert in 1080p with a Panasonic video camera. The final file is an mts file. (AVC, 29.97fps, Interlaced, 1920x1080)
I would like to do some sound corrections and encode the file into an mp4.
For the video encoding job I'm using MeGui.
Here is the thing:
After MeGui analyses the mts file, the filter suggestion is:
Source type: Interlaced
Field order: Top Field First
Deinterlace: Yadif
The final encoded mp4 with those filters, was not good at all, full of artifacts.
I've tried another Deinterlaced possibilities but the result was kind of the same.
Can somebody suggest another filter settings for this encoding?
Thanks in advance.
EDIT: One more thing:
I got between 10-12fp of encoding velocity using MeGui, which I believe it's kind of slow.
My machine is an Acer Aspire, Windows 8 Pro 64 bits, Intel Core i7 2.2GHz, 16GB of RAM, NVIDIA GeForceGT-555M. It's not the newest hardware on earth, but I think MeGui should be quicker than that under this hardware... or is it normal?
M+AUDIO
31st August 2013, 10:18
Hi,
As you said your video is interlaced, you should call your video 1080(i), instead of 1080(p)
Anyway,
witch artifacts? you refer to "combing"? right?
you said your video was recorded with a camera, maybe your video is BFF, or Bottom field first. did you check that?
And for slow encoding, you can pick a "faster" x264 preset with just one-pass CRF method, it's always good (for me at least).
castellanos
31st August 2013, 12:55
Thanks for your answer.
1080p, the "p" was referring to "pixels" and not "progressive".
I call artifacts to "squares on the image",,, I hope you now what I mean.
Video source is definitely Top Field First, I've checked it.
I never use One Pass encoding, the result is not satisfactory, at least for me.
Any other ideas?
Guest
31st August 2013, 13:06
Please post your script and the MEGUI command line for the encoding. Also a link to an unprocessed source sample that shows the issue.
If the source video is PAFF and you are using AVCSource() you may get blocking artifacts. Try a different source filter.
castellanos
31st August 2013, 14:16
Here the script:
LoadPlugin("C:\Program Files (x86)\MeGUI\tools\dgavcindex\DGAVCDecode.dll")
AVCSource("D:\Film\00453.dga")
Load_Stdcall_Plugin("C:\Program Files (x86)\MeGUI\tools\yadif\yadif.dll")
Yadif(order=1)
#crop
#resize
#denoise
Command line:
program --profile baseline --tune film --pass 2 --bitrate 1500 --stats ".stats" --qpmin 10 --qpmax 51 --output "output" "input"
Example:
http://www.mediafire.com/download/59otjm55f8g16ja/example.rar
And just in case:
General
ID : 1 (0x1)
Complete name : D:\Film\00453.MTS
Format : BDAV
Format/Info : Blu-ray Video
File size : 2.19 GiB
Duration : 24mn 11s
Overall bit rate mode : Variable
Overall bit rate : 13.0 Mbps
Maximum Overall bit rate : 18.0 Mbps
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=3, N=15
Codec ID : 27
Duration : 24mn 11s
Bit rate mode : Variable
Bit rate : 12.1 Mbps
Maximum bit rate : 16.8 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.194
Stream size : 2.04 GiB (93%)
Audio
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : 129
Duration : 24mn 11s
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -66ms
Stream size : 66.4 MiB (3%)
Text
ID : 4608 (0x1200)
Menu ID : 1 (0x1)
Format : PGS
Codec ID : 144
Duration : 24mn 10s
Delay relative to video : -66ms
Guest
31st August 2013, 15:02
To rule out AVCSource(), open the script directly in VirtualDub and see whether the artifacts are present. I'm thinking a camera would not use PAFF, so maybe it is your encoding. Your chosen bitrate looks very low for 1080, so try using a higher rate, such as 5-10 Mb/sec.
castellanos
31st August 2013, 16:26
Ok. I'll try ASAP.
Thanks.
castellanos
31st August 2013, 18:22
Artifact are still present if I open the script in VirtualDub.
Guest
1st September 2013, 14:47
For your sample, the artifacts are showing up even when previewing in DGAVCIndex, so I conclude that the version of libavcodec that is used (an old one) has problems with this interlaced stream.
The stream is handled correctly by DGDecNV. You could also try the FFMPEG-based source filters.
castellanos
1st September 2013, 16:14
Thanks a lot neuron2!!
You are very kind explaining this things to me... remember that I use to be a middle range DVD converter... now with the years you can't even call me a newbie. ;)
Please, If you can and will, point me out how to use an FFmpeg filter. Thanks.
Greetings!
Guest
1st September 2013, 16:42
I've never used those filters but you can find help with google, e.g., http://ffmpegsource.googlecode.com/svn/trunk/doc/ffms2-avisynth.html.
These FFMPEG-based filters apparently also have issues with some interlaced streams, so I can't guarantee proper functioning, but it may be worth a try.
DGDecNV is the most reliable solution but it requires a supported nVidia graphics card. The stream is also handled correctly by DGAVCDecDI, which does not require nVidia, but does require inexpensive licenses both from me and from DiAVC.
castellanos
1st September 2013, 17:03
Some things are coming to my mind... very slowly.
I've tried Directshowsource(). No artifacts, but poor quality.
I've also tried:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
FFVideoSource("D:\Film\00453.mts")
No artifacts, but kind of slow.
Would you recommend something else?
I've an NVIDIA GeForce GT 555M on my Laptop, do I need a licence for using DGDecNV?
Guest
1st September 2013, 17:15
Some things are coming to my mind... very slowly.
I've tried Directshowsource(). No artifacts, but poor quality. What do you mean by poor quality here?
I've also tried:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
FFVideoSource("D:\Film\00453.mts")
No artifacts, but kind of slow.
Would you recommend something else? I already recommended DGDecNV or DGAVCDecDI. With DirectShowSource() or DSS2() you can use any good DirectShow decoder.
I've an NVIDIA GeForce GT 555M on my Laptop, do I need a licence for using DGDecNV? Yes, you need a license.
castellanos
1st September 2013, 17:19
What do you mean by poor quality here?
Video was kind of grain.
Guest
1st September 2013, 18:20
That wouldn't be a result of the decoding.
castellanos
1st September 2013, 18:43
That wouldn't be a result of the decoding.
Ok.
I've tried DirectShowSource(), 720p resize, 2Mb/s and the encoded mp4 was very bad, grainy and full of artifacts.
Is 2Mb/s not enough for a 720p video?
Guest
1st September 2013, 21:15
DirectShowSource() uses a decoder installed on your PC and you haven't told us which decoder that is.
I did this:
Made a project with DGDecNV and then served this to x264.
loadplugin("h:\don\Programming\C++\dgdecnv\DGDecodeNV\x32\Release\dgdecodenv.dll")
dgsource("example.dgi",deinterlace=2)
lanczosresize(1280,720)
That produces 1280x720p @ 59.94 fps.
Then I used x264 as follows:
x264 --pass 1 --bitrate 5000 -o out.mp4 example.avs
x264 --pass 2 --bitrate 5000 -o out.mp4 example.avs
The result looks just fine to me. No artifacts and no graininess.
The average bitrate of your source is about 12 Mb/s. So after your resize to keep the same quality you would need about 0.44 * 12 Mb/s = ~5 Mb/s. With deinterlace=2 we would actually need more, but it still looks fine. With deinterlace=1, producing 29.97 fps, it looks even better.
Your 2Mb/s is simply too low.
Also, regarding grain, that is not something caused by a decoder, or using too small of a bitrate. You may be confusing graininess with simple lack of detail. A screenshot from your encode may be helpful.
castellanos
1st September 2013, 22:17
Thanks neuron2!
I'll do more tests.
I have ffdshow installed on my computer. I didn't load any plugin in the script when I used DirectSchowSource (), so I think I just used the default decoder. Would you recommend an special plugin for DirectShowSource (), besides the DGDecNV or DGAVCDecD?
Anyway, I try pushing up the bitrates and see what happens.
Greetings.
Guest
1st September 2013, 23:57
There is no "default decoder".
I think for your purposes any correct decoder will be fine.
Please report the results at higher bitrates.
castellanos
2nd September 2013, 01:05
No luck. The final mp4 at 5mb/s was not good at all.
Less artifacts than before, but still there.
This is the script I used:
DirectShowSource("D:\Film\example.mts")
Load_Stdcall_Plugin("C:\Program Files (x86)\MeGUI\tools\yadif\yadif.dll")
Yadif(order=1)
#crop
LanczosResize(1280,720) # Lanczos (Sharp)
#denoise
ConvertToYV12()
A strange thing playing back the mp4: It looks fine at the beginning, after a few seconds it shows a few artifacts, then suddenly the artifacts disappears (like a refresh) and after a few seconds shows artifacts again.
Guest
2nd September 2013, 02:24
Use a reliable source filter! DirectShowSource() is known to be unreliable.
The FFMPEG based filters are not slow. You probably got confused by the indexing time.
I assume you verified the field order for yadif.
castellanos
3rd September 2013, 18:35
Thanks Neuron2 for all your help!
I've tried:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
FFVideoSource("D:\Film\example.mts")
The result was even worse.
At this point I think I need to try another converter and see how it goes.
Greetings! ;-)
Guest
3rd September 2013, 19:37
Can you to provide a screenshot showing your result and giving us your encode line(s)?
As I said I have no issues at all with a reliable source filter and using CLI x264.
castellanos
3rd September 2013, 20:32
Script:
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
FFVideoSource("D:\Film\example.mts")
Load_Stdcall_Plugin("C:\Program Files (x86)\MeGUI\tools\yadif\yadif.dll")
Yadif(order=1)
#crop
LanczosResize(1280,720) # Lanczos (Sharp)
#denoise
ConvertToYV12()
Command line:
program --pass 2 --bitrate 5000 --stats ".stats" --b-pyramid none --qpmin 10 --qpmax 51 --output "output" "input"
With a screenshot you will no see what the problem was in this case. Playback was totally choppy.
Anyway I'm having very good results using my old TMPGEnc Xpress. ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.