AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > Anime Related Topics > General Anime > Fansub Groups

Notices

Reply
 
Thread Tools
Old 2012-01-01, 22:35   Link #1
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
Timecodes in an mp4

Alright my source is an mp4 file that is apparently(from what media info says) a VFR. I want to try and keep it a VFR, so how do I go about doing that.
I usually deal with VFR MKV files so this is a little different. I extract the timecodes via FFMpegSource. Do I go about it the same way? I've tried that, but I may be entering something wrong in the command.

LoadPlugin("filepath\ffm2.dll")
FFMpegSource("filepath\filename.mp4, timecodes= "filename.txt")
DreGon45 is offline   Reply With Quote
Old 2012-01-02, 01:34   Link #2
Desbreko
Senior Member
*Fansubber
 
 
Join Date: Apr 2009
Age: 36
Send a message via AIM to Desbreko
Yes, you can extract the timecodes with ffms2 the same way as you would for an MKV.
Desbreko is offline   Reply With Quote
Old 2012-01-02, 03:16   Link #3
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
I doesn't seem to be working though. It keeps saying that there is something wrong in my command line.
Usually it's the " or (
DreGon45 is offline   Reply With Quote
Old 2012-01-02, 04:03   Link #4
Desbreko
Senior Member
*Fansubber
 
 
Join Date: Apr 2009
Age: 36
Send a message via AIM to Desbreko
Well, make sure you don't have any syntax errors in your script. This works fine for me:

Code:
ffvideosource("video.mp4", timecodes="timecodes.txt")
Desbreko is offline   Reply With Quote
Old 2012-01-02, 04:27   Link #5
TheRyuu
warpsharpened
 
Join Date: Sep 2008
Quote:
Originally Posted by DreGon45 View Post
I doesn't seem to be working though. It keeps saying that there is something wrong in my command line.
Usually it's the " or (
I seriously doubt the error message that gets printed is:
Code:
Usually it's the " or (
I guess the parser just got lazy.

Then there's your OP (which I'll wrap in code tags for you):
Code:
LoadPlugin("filepath\ffm2.dll")
FFMpegSource("filepath\filename.mp4, timecodes= "filename.txt")
You're asking for help with a possible syntax error where the original script you give is clearly edited/bullshit so I'm not exactly sure whether I should actually point out that it should be ffms2.dll or the missing end quote on the mp4 file since I would like to believe it's not something so trivial. Moral of the story, we can't read minds.
TheRyuu is offline   Reply With Quote
Old 2012-01-02, 19:13   Link #6
sneaker
Senior Member
 
Join Date: Dec 2008
Did you forget a quotation mark after the video source file name? (i.e. the ")?
sneaker is offline   Reply With Quote
Old 2012-01-03, 02:15   Link #7
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
Quote:
Originally Posted by sneaker View Post
Did you forget a quotation mark after the video source file name? (i.e. the ")?
Yes I did, and I feel like a damn idiot -.-'. But when I fixed the script and got my time codes file, I made a new script for encoding and made my video and audio and then muxed it together(timecodes included) via mkv merge GUI. But I watched the video to make sure nothing was wrong, and the audio slowly started get out of sync. The new videos frame rate is the same as the old one, 29.970. I didn't cut the video or do anything different really, just hard sub some karaoke and typesetting. What was I doing wrong? There were no warnings or error codes while muxing or encoding either, everything went smoothly.
DreGon45 is offline   Reply With Quote
Old 2012-01-03, 11:57   Link #8
sneaker
Senior Member
 
Join Date: Dec 2008
1. The audio went out of sync with the subtitles or with the video or both?
2. "new videos frame rate is the same as the old one, 29.970" - I thought you had VFR? (You can not trust mediainfo on detecting "VFR", btw.)
3. Did you use the original .mp4 file as the source for the audio track in mkvmerge or did you demux it first?
sneaker is offline   Reply With Quote
Old 2012-01-04, 01:27   Link #9
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
Both actually, the audio was faaaar ahead of the subtitles and the video. And I'm using the source itself as the audio. And MeGUI read it as 29.970 when I went to make a script. What methods could I use to find out if my orignal source id a VFR.
DreGon45 is offline   Reply With Quote
Old 2012-01-04, 02:49   Link #10
sneaker
Senior Member
 
Join Date: Dec 2008
Quote:
Originally Posted by DreGon45 View Post
Both actually, the audio was faaaar ahead of the subtitles and the video.
Audio being ahead means that the video plays too slowly. Are you absolutely sure you put in the timecodes of your original video correctly into mkvmerge?
What happens if you don't use the timecode file and instead choose "30000/1001" (or "24000/1001") as the fps in mkvmerge?
Are the hard-coded subtitles and the video in sync and did you load the timecode file for assrender/textsub?

Quote:
Originally Posted by DreGon45 View Post
And MeGUI read it as 29.970 when I went to make a script.
Does that mean you did not actually use the script you posted in your first post as input to MeGUI, but let it create a new script on its own instead?

Quote:
Originally Posted by DreGon45 View Post
What methods could I use to find out if my orignal source id a VFR.
Extract the timecodes, then convert them from v2 timecodes to v1 timecodes with on of the following tools:
http://www.mediafire.com/?0b3kdn4xy2te524
http://www.mediafire.com/?6z553mv548tec0b
I'm probably not up-to-date when it comes to v2->v1 conversion tools, though. Maybe someone else can post better alternatives.

Or upload the timecodes so we can take a quick look at them.
sneaker is offline   Reply With Quote
Old 2012-01-04, 17:12   Link #11
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
Yes, in MKVmergeGUI the option to load timecodes into the video was how I did it. But if I don't put the input the timecodes and choose "30000/1001", then everything is perfectly fine. Yes the hard coded material and the video are in-sync perfectly fine.

Quote:
Originally Posted by sneaker View Post
did you load the timecode file for assrender/textsub?
^I don't understand. Are you asking if I muxed the timecodes with the subtitles as well?


Yes, I created a new script after I got my timecodes. The one I posted was purely for extracting timecodes, that one was hand made....so to speak. I made another one via Avisynth Script Creator in MeGUI. I'm sure I could have done everything from a single script, but it's kind of a quirk I have -_-'.

So I'm guessing v1 timecodes are a better version then?
DreGon45 is offline   Reply With Quote
Old 2012-01-04, 17:34   Link #12
sneaker
Senior Member
 
Join Date: Dec 2008
Quote:
Originally Posted by DreGon45 View Post
^I don't understand. Are you asking if I muxed the timecodes with the subtitles as well?
Since AviSynth is purely CFR, you must know or at least be aware of the VFRaC concept for hard-subbing VFR content. Bottom line is: when hard-subbing VFR content, you need to pass the timecodes to the subtitle renderer. Example:
Code:
ffvideosource("source_video.mp4", timecodes="timecodes.txt")
AssRender("subtitles.ass", vfr="timecodes.txt")
Quote:
Originally Posted by DreGon45 View Post
Yes, I created a new script after I got my timecodes. The one I posted was purely for extracting timecodes, that one was hand made....so to speak. I made another one via Avisynth Script Creator in MeGUI. I'm sure I could have done everything from a single script, but it's kind of a quirk I have -_-'.
That is probably why the timecodes didn't fit anymore. I suspect MeGUI's Script Creator to have done a VFR->CFR conversion (by using "fpsnum", "fpsden" parameters for ffmpegsource or "convertfps=true" for DirectShowSource), so MeGUI's encode was purely CFR.
That's also why your subtitles fit to the video, although you did not know about VFRaC.

Quote:
Originally Posted by DreGon45 View Post
So I'm guessing v1 timecodes are a better version then?
It's not better to use timecodes_v1 in general, only to get a human viewable overview of the timecodes. It helps you identify if the source really is VFR or if it's CFR.

http://www.bunkus.org/videotools/mkv...timecode_files
You see that timecodes_v1 files are only a few lines long mostly, while timecodes_v2 have a line for every single frame. Not something a human can take a short look at and identify whether it's VRF or CFR.
sneaker is offline   Reply With Quote
Old 2012-01-04, 20:37   Link #13
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
I looked at the time codes, and I'm not sure what what format(v1, v2, v3, v4) it is, but it has the designated frames and then the frame rate from what it looks like(i.e 2309,4569. 29.970)
but the thing is, it's all 29.970. So I'm guessing it's not actually a VFR?

You were right, DSS did the covertfps, but I never paid attention to it. Thanks for that part.

So if the timecodes are in a v2 format, does that meant that the source has a high chance of not actually being a VFR?
DreGon45 is offline   Reply With Quote
Old 2012-01-04, 21:09   Link #14
sneaker
Senior Member
 
Join Date: Dec 2008
Quote:
Originally Posted by DreGon45 View Post
So if the timecodes are in a v2 format, does that meant that the source has a high chance of not actually being a VFR?
No, not at all. ffvideosource and mkvextract will always extract in timecodes_v2 format. That has nothing to do with whether it's VFR or CFR.

Quote:
Originally Posted by DreGon45 View Post
I looked at the time codes, and I'm not sure what what format(v1, v2, v3, v4) it is, but it has the designated frames and then the frame rate from what it looks like(i.e 2309,4569. 29.970)
but the thing is, it's all 29.970. So I'm guessing it's not actually a VFR?
You are now talking about the timecodes of your encode, and not your initial source, correct? If everything is "29.97", then its CFR, which was to be expected, because "convertfps=true" was used.

I can only recommend to just use your own script, instead of letting MeGUI create one. It has to look like the example in my last post.

That the timecodes didn't fit the VFR->CFR encode made by MeGUI (and its script creator) is an indication of your source really being VFR, btw.

My recommendation to convert the timecodes_v2 to timecodes_v1 was only so you can read them more easily in a text editor, not to actually use them as input for mkvmerge, x264 or whatever. Despite being long and thus not being easily readable, timecodes_v2 are perfectly fine.
I've never seen anyone use v3 or v4 timecodes and distinguishing v1 and v2 timecodes is very very easy. Just look at the examples I posted above:
http://www.bunkus.org/videotools/mkv...timecode_files
They also they what format they are explicitly in the very first line.
sneaker is offline   Reply With Quote
Old 2012-01-05, 01:49   Link #15
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
Alright, I'll shall redo. If further problems arise, then I'll shall post more stupid questions .
DreGon45 is offline   Reply With Quote
Old 2012-01-05, 15:34   Link #16
sneaker
Senior Member
 
Join Date: Dec 2008
I guess you should learn to read and understand timecodes_v2 and timecodes_v1 files. If someone asks you "what does this number in this line mean" you have to be able to answer that immediately. Ask yourself "What exactly are timecodes/timestamps? What is their meaning?"!
When looking at a timecodes_v1 file you have to be able to tell whether it's VFR or CFR within a single second. It's trivial, really.
Those are the very basics of dealing with VFR content. And read every article/blog post (like TheFluff's about VFR/VFRaC I posted above) or wiki anyone mentions here! Then read it again and again, until you understand! Seriously.
I know it takes some time to grasp the concept of VFR, but chances are that at some point it will fall like scales from your eyes.
sneaker is offline   Reply With Quote
Old 2012-01-05, 15:40   Link #17
DreGon45
Rouge Encoder
 
Join Date: Aug 2011
Location: wut?
Alright then that makes sense. Thanks for the help.
DreGon45 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
We use Silk.