INDEX  F.A.Q.  SEARCH  LATEST POSTS     Rules  Register  Profile  Private messages  Login


Search all forums or this forum: Advanced search
HCenc "Invalid MPEG-2 Frame rate" error.

Forum Index -> Video -> Video Conversion Printer-friendly version
Reply to topic
Author Message
Maikeru-sama
Member


Joined: 09 Apr 2006
Location: United States

Post Posted: Jul 06, 2008 13:17 Posts Comp View users profile Send private message Reply with quote

I have an MKV that has video that has a frame rate of 25.689. This has been confirmed via GSpot, Mplayer and MediaInfo.

When I load the following scirpt into HCenc, I get the error in the thread title:

<SCRIPT>
FFMpegSource("C:\mymovie.mkv", atrack=-2)
LanczosResize(720,480,0,0,640,352)
ChangeFPS(25.689)
</SCRIPT>

I also took out the ChangeFPS filter and the same error is generated.

Is HCenc limited to 23.976, 25.00 and 29.97?


Maikeru-sama
Member


Joined: 09 Apr 2006
Location: United States

Post Posted: Jul 06, 2008 13:18 Posts Comp View users profile Send private message Reply with quote

<MEDIAINFO>
General #0
Complete name : C:\mymovie.mkv
Format : Matroska
File size : 233 MiB
PlayTime : 24mn 12s
Bit rate : 1347 Kbps
Encoded date : UTC 2004-08-13 06:55:24
Writing application : mkvmerge v0.9.2 built on Jun 29 2004 23:48:14
Writing library : libebml v0.7.0 + libmatroska v0.7.0

Video #0
Codec : DivX 5
Codec/Family : MPEG-4V
Codec settings, BVOP : Yes
Codec settings, QPel : No
Codec settings, GMC : 0
Codec settings, Matrix : Default
PlayTime : 23mn 54s
Bit rate : 1026 Kbps
Width : 640 pixels
Height : 352 pixels
Display Aspect ratio : 16/9
Frame rate : 25.689 fps
Resolution : 8 bits
Chroma : 4:2:0
Interlacement : Progressive
Title :mymovie
Writing library : DivX503b1263p
Language : English

Audio #0
Codec : MPEG-1 Audio layer 3
Codec profile : Joint stereo
PlayTime : 24mn 12s
Bit rate mode : CBR
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Language : English

Audio #1
Codec : MPEG-1 Audio layer 3
Codec profile : Joint stereo
PlayTime : 24mn 12s
Bit rate mode : CBR
Bit rate : 128 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Language : Japanese

Text #0
Codec : SSA
Codec/Info : Sub Station Alpha
Language : English

Chapters #0
Language : English
1 : 00:00:00.000 Preview
2 : 00:03:25.100 Intro
3 : 00:04:55.000 Act 1
4 : 00:11:28.510 Act 2
5 : 00:22:10.400 Credits
6 : 00:23:41.000 Preview
</MEDIAINFO>


45tripp
Dolphin Blue


Joined: 21 Dec 2004
Location: Triptonia

Post Posted: Jul 06, 2008 13:57 Posts Comp View users profile Send private message Reply with quote

Maikeru-sama wrote:

Is HCenc limited to 23.976, 25.00 and 29.97?



mpeg2 is
23.976, 24, 25, 29.97, 30, 50, 59.94, 60


tripp
_________________
"I'll give you five dollars if you let me throw a rock at you"


Midzuki
RETIRED


Joined: 25 Jun 2007
Location: Outside of VH.com

Post Posted: Jul 06, 2008 14:06 Posts Comp View users profile Send private message Reply with quote

I'd recommend this:

Code:
DirectShowSource("movie.mkv", fps=25.000, convertfps=true)


I don't like VFR, btw --- many times, the feature is used without a very-good reason.


Maikeru-sama
Member


Joined: 09 Apr 2006
Location: United States

Post Posted: Jul 06, 2008 14:38 Posts Comp View users profile Send private message Reply with quote

Midzuki wrote:
I'd recommend this:

Code:
DirectShowSource("movie.mkv", fps=25.000, convertfps=true)


I don't like VFR, btw --- many times, the feature is used without a very-good reason.


Yeah, I would rather use DSS, but I have been having problems with certain MKV files with DirectShowSource, so I haven't been using it lately.

Anyhoo, If I convert the fps, won't the audio be out-of-sync?

I think I am just going to roll with Quenc, as I have already tried it and know it works (I just wanted to use HCenc for a guide I am writing).


Maikeru-sama
Member


Joined: 09 Apr 2006
Location: United States

Post Posted: Jul 06, 2008 14:48 Posts Comp View users profile Send private message Reply with quote

Does ConvertXToDVD re-encode the video?

For this frame rate, I am going to go:

Quenc - no pulldown
DGpulldown
FFMpeg to get the audio
Subtitle Workshop to convert the ssa to srt.

I have already tested one file in TMPGenc, but I want to use ConvertXToDVD, but if it re-encodes, the audio files will be out of sync.


FulciLives
UNDEAD OVERLORD


Joined: 09 May 2003
Location: Pittsburgh, PA in the USA

Post Posted: Jul 06, 2008 14:54 Posts Comp View users profile Send private message Reply with quote

I seem to recall manono saying once that you would just encode at 25fps but since it is really 25.689fps it would still be 25.689fps when done. Just drop the line in the script: ChangeFPS(25.689)

Then afterwards run it through DGPulldown and use the custom option. Enter 25.689fps for the source and 29.970fps for the destination.

Maybe he will chime in but I think that is what he said ...

- John "FulciLives" Coleman

P.S.
I think you have to use HCenc to do this properly ... or CCE ... I don't think TMPGEnc will work.
_________________
"The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE


jagabo
Member


Joined: 09 Dec 2005
Location: none

Post Posted: Jul 06, 2008 16:01 Posts Comp View users profile Send private message Reply with quote

Maikeru-sama wrote:
Is HCenc limited to 23.976, 25.00 and 29.97?

MPEG only supports certain frame rates. Those you mentioned and a few others (24 ad 30 I think).


freebird73717
Member


Joined: 09 Dec 2003
Location: Buckle of the Bible Belt

Post Posted: Jul 06, 2008 16:24 Posts Comp View users profile Send private message Reply with quote

FulciLives wrote:
I seem to recall manono saying once that you would just encode at 25fps but since it is really 25.689fps it would still be 25.689fps when done.


It's been a long time since I have done this but if I remember correctly instead of using convertfps or changefps function I used assumefps(25.00) and then did a custom pulldown 25.689->29.97 with dgpulldown on that output. The result should be a m2v and audio file that should be in sync.

Yep... I even found the thread that I learned that trick from CLICK HERE
_________________
My Tools

Ready to Learn?


Midzuki
RETIRED


Joined: 25 Jun 2007
Location: Outside of VH.com

Post Posted: Jul 06, 2008 16:37 Posts Comp View users profile Send private message Reply with quote

Possibly 'DirectShowSource(convertfps=true)' will make the audio track be resampled,
'AssumeFPS(sync_audio=true)' surely will do it. Better add 'ResampleAudio(48000)'
to the script and use another application to recompress the audio
(VirtualDub ++ AC3 ACM, for example).

P.S.: I presume the "trick" indicated by Alex_ander would
only work if the value "25.689" were the actual constant framerate.
Maybe I'm wrong, but it seems Mplayer and MediaInfo are reporting just the
average framerate of a VFR video stream.

question.gif
confused.gif

P.P.S.: DSS also accepts .gfx (Graphedit files) as input.
Have you already tried them question.gif


45tripp
Dolphin Blue


Joined: 21 Dec 2004
Location: Triptonia

Post Posted: Jul 06, 2008 17:28 Posts Comp View users profile Send private message Reply with quote

Maikeru-sama wrote:

Anyhoo, If I convert the fps, won't the audio be out-of-sync?


not if you use directshowsource as midzuki showed. if it's vfr that's by far the simplest route.

and if it's not vfr,
not if you maintain duration.
or in changing speed concurrently change audio speed.

Maikeru-sama wrote:

I think I am just going to roll with Quenc as I have already tried it and know it works


what do you think quenc is doing?
it's changing fps.

freebird73717 wrote:

used assumefps(25.00) and then did a custom pulldown 25.689->29.97 with dgpulldown on that output.


yeah that's it.
and it actually came from a thread a week earlier. from me.

FulciLives wrote:

P.S.
I think you have to use HCenc to do this properly ... or CCE ... I don't think TMPGEnc will work.


anything that maintains framecount.
saying hc can and tmpg can;t is wrong.
as hc doesn;t do processing, it relies on avisynth.
so if you feed the avisynth process to any encoder they'll all work.
i guess what you mean is tmpg's actual internal framerate change filter
doesn;t maintain fframecount.

Midzuki wrote:

P.S.: I presume the "trick" indicated by Alex_ander would
only work if the value "25.689" is the actual constant framerate.


(anything coming out of avisynth is cfr)
yes it has to be constant,
yes the easiest way to do vfr->cfr (synced) is to use dss.


Maikeru-sama wrote:
Does ConvertXToDVD re-encode the video?


question.gif
that sort of dropped out of nowhere...

to author?
yeah i think convertx encodes all.

avstodvd, and the latest betas of dvdflick can take ready encoded parts and do
their simple authoring.

Maikeru-sama wrote:

For this frame rate, I am going to go:...
....the audio files will be out of sync.


if it's vfr, and you don;t use what midzuki proposed,
almost everything you do will not sync.


tripp
_________________
"I'll give you five dollars if you let me throw a rock at you"


jagabo
Member


Joined: 09 Dec 2005
Location: none

Post Posted: Jul 06, 2008 18:05 Posts Comp View users profile Send private message Reply with quote

freebird73717 wrote:
It's been a long time since I have done this but if I remember correctly instead of using convertfps or changefps function I used assumefps(25.00) and then did a custom pulldown 25.689->29.97 with dgpulldown on that output. The result should be a m2v and audio file that should be in sync.

That's a cool trick.


Maikeru-sama
Member


Joined: 09 Apr 2006
Location: United States

Post Posted: Jul 06, 2008 18:52 Posts Comp View users profile Send private message Reply with quote

Thanks for the comments.

I have a question, I just want to know why the following method is wrong? There are 26 of these files and I just put some on DVD using these steps and everything worked:

1) Used Quenc

2) Used Script below:
<script>
FFMpegSource("C:\mymovie.mkv", atrack=-2)
LanczosResize(720,480)
</script>

3) Used MKVExtract to get the SSA file from MKV

4) Used Subtitle Workshop to convert SSA to SRT

5) Used FFMpeg to get the English and Japanese audio

6) Used DGPulldown and went 25.689->29.97

7) Used ConvertXToDVD to render the DVD Files

Of course I didn't do any of this by hand (except for ConvertXToDVD) as the tool TShed did it all for me.

I tested the output and everything was insync. Why is this method wrong, is the DSS way Midzuki spoke of just more efficient and how would using DSS with audio sync work when your goal is Dual Audio.

Everyone that has posted on this forum knows more about this stuff than me. I want to write a guide for something and the above was how I was going to do it, that is why I am asking.


45tripp
Dolphin Blue


Joined: 21 Dec 2004
Location: Triptonia

Post Posted: Jul 06, 2008 21:43 Posts Comp View users profile Send private message Reply with quote

Maikeru-sama wrote:
I just want to know why the following method is wrong?


if it's working, it's not.

there's just been a stong hint of vfr material, because of the container
and the abnormal framerate.

if it's working it's not vfr,
or you're imagining sync.

Maikeru-sama wrote:

1) Used Quenc


that's interesting regarding quenc framerate change.
not what i'd guess if pushed to guess.
still,
i'd not want to rely on it.

Maikeru-sama wrote:

2) Used Script below:
<script>
FFMpegSource("C:\mymovie.mkv", atrack=-2)
LanczosResize(720,480)
</script>


rather, i'd do
Code:
FFMpegSource("C:\mymovie.mkv")
LanczosResize(720,480)
assumefps(25)


and use any encoder.

also remove audio loading in ffmpegsource,
costly.

Maikeru-sama wrote:

7) Used ConvertXToDVD to render the DVD Files
Of course I didn't do any of this by hand (except for ConvertXToDVD)


and that would mean one can author in convertx,
leaving sources untouched?

did you try the tools i mentioned?
if nothing else you could see how they automated authoring

Maikeru-sama wrote:

how would using DSS with audio sync work when your goal is Dual Audio.


the same


tripp
_________________
"I'll give you five dollars if you let me throw a rock at you"


Maikeru-sama
Member


Joined: 09 Apr 2006
Location: United States

Post Posted: Jul 06, 2008 22:48 Posts Comp View users profile Send private message Reply with quote

45Tripp, I have restarted my batch encode and will use your script:

Code:

FFMpegSource("C:\mymovie.mkv")
LanczosResize(720,480)
assumefps(25)


Sitting here looking at Quenc fire up, you are right that it seems to be alot quicker less the atrack. I thought it was standard to explicitly disable the audio, that is why I was doing it.

Also, the way I did it the audio/video was in-sync along with the subtitles.

As Freebird, Fulci and myself stated, I will again use DGPulldown.

I am familiar with both DVDFlick and AVSToDVD and along with FAVC, they are my backups in case ConvertXToDVD fail as I think it is a better product.

I am going to do something different with the audio. Instead of using FFMpeg, which works, I am going to extract the audio with MKVExtract. In the past, whenever I have used MKVExtract, there was always an a/v synch issue, that is why I started using Mencoder or FFMpeg to get the audio.

DirectShowSource has been acting up on both my PCs, when I use it with Quenc and HCenc (CCE is fine). Even when I disable the audio, I still get the basic windows error and they crash.


FulciLives
UNDEAD OVERLORD


Joined: 09 May 2003
Location: Pittsburgh, PA in the USA

Post Posted: Jul 06, 2008 22:52 Posts Comp View users profile Send private message Reply with quote

Well there is always DGAVCDec which is what I use when I have an MKV with H.264 video. First you demux so you get a video only file which will be called something like filename.h264 then load that into DGAVCDec which makes a project file. You then load that into an AviSynth script. Same principal as when you use DGMPGDec with an MPEG-2 source like a DVD rip.

- John "FulciLives" Coleman
_________________
"The eyes are the first thing that you have to destroy ... because they have seen too many bad things" - Lucio Fulci
EXPLORE THE FILMS OF LUCIO FULCI - THE MAESTRO OF GORE


Midzuki
RETIRED


Joined: 25 Jun 2007
Location: Outside of VH.com

Post Posted: Jul 07, 2008 00:22 Posts Comp View users profile Send private message Reply with quote

So your MKVs are CFR and evrything is going through the easy path?
Good! You're lucky! biggrin.gif

Still, I'd like to know how/where/why the value 25.689 fps was found...
even though Mr. 'Unknown Releaser' will never come give us an answer
to this question.

Quote:
I want to write a guide for something and the above was how I was going to do it,
that is why I am asking.


Do you plan/intend to get into "The Scene" question.gif wink2.gif wink2.gif wink2.gif laugh.gif


Maikeru-sama
Member


Joined: 09 Apr 2006
Location: United States

Post Posted: Jul 07, 2008 16:38 Posts Comp View users profile Send private message Reply with quote

Midzuki wrote:
So your MKVs are CFR and evrything is going through the easy path?
Good! You're lucky! biggrin.gif

Still, I'd like to know how/where/why the value 25.689 fps was found...
even though Mr. 'Unknown Releaser' will never come give us an answer
to this question.


Not sure. When dealing with Anime, I have seen a ton of weird frame rates and most of them were CFR. I'm just glad this thread didn't go 4 pages, as is usually the case when I post biggrin.gif .

I have 2 questions for everyone so I can get a better understanding of why everything works:

1) Why did you choose "AssumeFPS(25)"? Is it because the FPS of 25.689 is close to 25? I had an AVI file a while back that was 20 FPS, would you still have used 25?

2) As mentioned prior, I put AssumeFPS(25) in the avisynth script. How is it that the audio and video are insync, when the video was encoded at 25 fps and the audio is still 25.689? Is it because I did a custom pulldown with DGPulldown?


freebird73717
Member


Joined: 09 Dec 2003
Location: Buckle of the Bible Belt

Post Posted: Jul 07, 2008 18:42 Posts Comp View users profile Send private message Reply with quote

Maikeru-sama wrote:


1) Why did you choose "AssumeFPS(25)"? Is it because the FPS of 25.689 is close to 25?
Yep

Quote:
I had an AVI file a while back that was 20 FPS, would you still have used 25?

Not sure if it would have made a difference but I would have probably used 23.976 and then did a custom pulldown.

Quote:
2) As mentioned prior, I put AssumeFPS(25) in the avisynth script. How is it that the audio and video are in sync, when the video was encoded at 25 fps and the audio is still 25.689? Is it because I did a custom pulldown with DGPulldown?

Yep. Same just like when you do a pal to ntsc pulldown and the audio is in sync.
Ya gotta hand it to the guys at doom9 like donald graft (aka neuron2-author if dgpulldown) and Xesdeeni for even coming up with the idea of irregular pulldown
dgpulldown is just a damn handy tool.
_________________
My Tools

Ready to Learn?


Maikeru-sama
Member


Joined: 09 Apr 2006
Location: United States

Post Posted: Jul 07, 2008 19:24 Posts Comp View users profile Send private message Reply with quote

freebird73717 wrote:
Maikeru-sama wrote:


1) Why did you choose "AssumeFPS(25)"? Is it because the FPS of 25.689 is close to 25?
Yep

Quote:
I had an AVI file a while back that was 20 FPS, would you still have used 25?

Not sure if it would have made a difference but I would have probably used 23.976 and then did a custom pulldown.

Quote:
2) As mentioned prior, I put AssumeFPS(25) in the avisynth script. How is it that the audio and video are in sync, when the video was encoded at 25 fps and the audio is still 25.689? Is it because I did a custom pulldown with DGPulldown?

Yep. Same just like when you do a pal to ntsc pulldown and the audio is in sync.
Ya gotta hand it to the guys at doom9 like donald graft (aka neuron2-author if dgpulldown) and Xesdeeni for even coming up with the idea of irregular pulldown
dgpulldown is just a damn handy tool.


Thanks for the response Freebird.

Yes, DGPulldown is a great tool. Been using it for a long time, I just never really took the time to understand what was going on.


jagabo
Member


Joined: 09 Dec 2005
Location: none

Post Posted: Jul 07, 2008 20:42 Posts Comp View users profile