Log in

View Full Version : Seek problems with Panasonic .MTS AVC files


HamsterLord
31st May 2011, 22:09
Am trying to process .MTS files from my Panasonic LX5 in AVISynth. These are AVC video 1280x720 50fps + AC-3 audio.

Trim() does strange things.

eg: Trim(clip,300,399) on a 1402 frame video gives me frames 300-399 of video followed by frame 399 repeated for 1140 frames - a total of 1240 frames. Preview in VirtualDubMod looks fine, its just when saving as an avi.

Have installed the latest Haali, ffdshow, AVISynth and ffmpegsource. Am using TsRemux on the panasonic .MTS and saving as a .m2ts file. This file is then loaded using FFmpegSource2()

Incidently, FFmpegSource2 seems to drop the 50fps video down to 25fps - thats exactly what i want, so thats fine (I guess the "ReFrames : 2 frames" flag in the video means duplicate frames?)

Am i doing anything wrong? would DGAVCDecDI+DiAVC be the solution? I'd really like to use AVISynth for editing.


Here is the .avs:

fhd=FFmpegSource2("00005b.m2ts",atrack=-1)
f=Lanczos4Resize(fhd,720,576)
f.Trim(400,499)


Media info for the clip:

General
ID : 0
Complete name : C:\pictures\201105_wales\20110519\00005.MTS
Format : BDAV
Format/Info : BluRay Video
File size : 77.9 MiB
Duration : 56s 307ms
Overall bit rate : 11.6 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 : No
Format settings, ReFrames : 2 frames
Duration : 56s 300ms
Bit rate : 10.9 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 50.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.238

Audio
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Duration : 56s 307ms
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48.0 KHz

Text
ID : 4608 (0x1200)
Menu ID : 1 (0x1)
Format : PGS

Lam3rD
31st May 2011, 22:19
1. Ref Frames is something completely different http://mewiki.project357.com/wiki/X264_Settings#ref
2. ffmpegsource doesn't work well with TS, Remux in matroska and try again, everything should work properly.

What version of avisynth are you using? Trim is a very basic function and it shouldn't behave this way regardless of how bugged the input was.

HamsterLord
1st June 2011, 10:15
1. Ref Frames is something completely different http://mewiki.project357.com/wiki/X264_Settings#ref
2. ffmpegsource doesn't work well with TS, Remux in matroska and try again, everything should work properly.

What version of avisynth are you using? Trim is a very basic function and it shouldn't behave this way regardless of how bugged the input was.

Hi Lam3rD, many thanks for the help, much appreciated.

Tried the following:

ffmpeg -i 00005.MTS -vcodec copy -acodec copy -sn 00005.mkv

then used the same .avs but with FFmpegSource2("00005.mkv",atrack=-1)

Exactly the same result unfortunately. When saving as an avi, VirtualDubMod still seems to think there is 1240 frames rather than 100, but only shows 100 frames when playing or scrubbing the trackbar. File information also shows only 100 frames.

My AVISynth version is 2.58.


Edited to add:
Ah, just done some further experiments. Am saving as XViD and using "Load Processing Settings" in VirtualDubMod - suspect this might be the problem, Trim() has always worked before, and i just tried a short uncompressed avi and got exactly the same behaviour - 1240 frames when saving.

Will try a different version of VirtualDubMod later tonight and report back...

HamsterLord
2nd June 2011, 00:20
Its an issue with "Load Processing Settings" in VirtualDubMod.

The last line of the .vcf settings file has this:

VirtualDub.subset.AddRange(0,1240);

Which is the actual length of the video, and you can't just delete that line or VirtualDub thinks the file is zero length. Therefore every time i do an encode, the settings have to be entered manually - bit of a pain when encoding to Xvid....

TheFluff
9th June 2011, 18:22
Simpler solution: use virtualdub, not virtualdubmod, and your problems will almost certainly go away