Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th February 2024, 03:05   #2881  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
I can see from the StvG's test, his ffms still better when can decode Zenit.mkv, ffms2_seeking_issue.mp4, interlaced_h264.mkv, and 3d-parrot.mkv. They still don't add commits from StvG

Last edited by kedautinh12; 28th February 2024 at 03:08.
kedautinh12 is offline   Reply With Quote
Old 28th February 2024, 10:18   #2882  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
I have a question about the ffms2_seeking_issue.mp4 sample: Does anyone know exactly how it was generated or where it comes from? Was it remuxed from something else using ffmpeg?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 28th February 2024, 10:57   #2883  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
Quote:
Originally Posted by Myrsloik View Post
I have a question about the ffms2_seeking_issue.mp4 sample: Does anyone know exactly how it was generated or where it comes from? Was it remuxed from something else using ffmpeg?
I think i remuxed it with ffmpeg from the mkv version.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 28th February 2024, 11:08   #2884  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by ChaosKing View Post
I think i remuxed it with ffmpeg from the mkv version.
Here's an inconvenient truth for you: FFmpeg is buggy and marks all I-frames as proper seekpoints whe muxing mp4. This means there's an insane number of invalid mp4 files out there with no good workaround (you'd have to parse the whole bitstream or something which is outside the scope of FFMS2). Even FFmpeg itself will seek badly in these files. So if you want a small task try remuxing the mkv=>mp4 files again but this time don't use FFmpeg.

You may be surprised at the outcome.

Meanwhile I'll have a quick peek at interlaced h264 and vc1 do seem to have regressed a bit...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 28th February 2024, 11:18   #2885  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
I had a feeling that ffmpeg mp4 was kinda broken. But didn't expect it to be this bad...
What would be a good alternative tool for mp4 files?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 1st March 2024, 11:09   #2886  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by ChaosKing View Post
I had a feeling that ffmpeg mp4 was kinda broken. But didn't expect it to be this bad...
What would be a good alternative tool for mp4 files?
Answers to this question moved to a new thread MP4 muxers, because are off topic here.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 1st March 2024 at 14:16.
tebasuna51 is offline   Reply With Quote
Old 6th March 2024, 04:09   #2887  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 450
ffms2 20240306_r1390

ffms2_r2390

Differences compared to 5.0-RC2:
* In some cases can be seek accurate while `5.0-RC2` is not (for example, https://imgbb.com/bLzGmXX https://imgbb.com/vZsFK3J)
* AviSynth: GetParity and _FieldBased are set per frame
* AviSynth: rffmode=1 that uses every frame tff/bff
* AviSynth: set _EncodedFrameTop and _EncodedFrameBottom (rffmode > 0)
* AviSynth: both ANSI and UTF8 file names are supported
* _ColorRange is set per frame
* Supported older AviSynth+ version that doesn't have audio channel mask property

Last edited by StvG; 6th March 2024 at 07:22.
StvG is offline   Reply With Quote
Old 6th March 2024, 05:04   #2888  |  Link
kedautinh12
Registered User
 
Join Date: Jan 2018
Posts: 2,156
Nice, thank @StvG
kedautinh12 is offline   Reply With Quote
Old 6th March 2024, 12:22   #2889  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by FTLOY View Post
Confused, this new release is r1390, and the previous was r1393
StvG typo, modified to r2390
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 6th March 2024, 13:04   #2890  |  Link
FTLOY
Friend of a friend..
 
FTLOY's Avatar
 
Join Date: Feb 2023
Posts: 195
Quote:
Originally Posted by tebasuna51 View Post
StvG typo, modified to r2390
Has been rectified (:

Thanks @StvG & @teba
FTLOY is offline   Reply With Quote
Old 6th March 2024, 14:15   #2891  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Thank you for v5 r2390.
I tested it against the OpenGOP MPEG-2 file and it's working fine now.
FranceBB is offline   Reply With Quote
Old 7th March 2024, 21:16   #2892  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
5.0 RC3
Now with FFmpeg that has zlib and some other fun libraries included.

Don't bother reporting any of the listed known issues. They'll probably be resolved before the next release.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 15th March 2024, 06:30   #2893  |  Link
flossy_cake
Registered User
 
Join Date: Aug 2016
Posts: 609
Quote:
Originally Posted by StvG View Post
ffms2 20240306_r1390

ffms2_r2390

Differences compared to 5.0-RC2:
* In some cases can be seek accurate while `5.0-RC2` is not (for example, https://imgbb.com/bLzGmXX https://imgbb.com/vZsFK3J)
* AviSynth: GetParity and _FieldBased are set per frame
* AviSynth: rffmode=1 that uses every frame tff/bff
* AviSynth: set _EncodedFrameTop and _EncodedFrameBottom (rffmode > 0)
* AviSynth: both ANSI and UTF8 file names are supported
* _ColorRange is set per frame
* Supported older AviSynth+ version that doesn't have audio channel mask property


(and thanks for remembering to preserve the FFGetVersion() format)
flossy_cake is offline   Reply With Quote
Old 19th March 2024, 20:55   #2894  |  Link
rgr
Registered User
 
Join Date: Jun 2022
Posts: 53
VFR.

I have a question about VFR reading. Will:
Code:
ffms2 ("file.mp4")
read *all* frames with the average fps?

I want to make sure I don't have any missed or duplicate ones.
rgr is offline   Reply With Quote
Old 19th March 2024, 20:59   #2895  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,784
Avisynth supports only one frame rate per clip.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 19th March 2024, 21:10   #2896  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Yes and it will output the average FPS, so it will drop scenes with more frames and duplicate scenes with less frames.
Generally what you want to do is specify fpsnum and fpsden and set them to the maximum framerate.
For instance, if file.mp4 was shot on a mobile, has a maximum fps of 60fps (normal motion) and a minimum fps of 10fps (when it was recording static scenes), then:

Quote:
FFMpegSource2("file.mp4", atrack=-1)
would return a 35fps stream with duplicated frames and dropped frames, which is NOT what you want.
What you want is a 60fps stream so that motion is preserved and whenever frames were lower because there was no motion, they're duplicated, which they would be anyway if you were displaying it on a 60Hz monitor, so:

Quote:
FFMpegSource2("file.mp4", fpsnum=60000, fpsden=1000, atrack=-1)

Last edited by FranceBB; 20th March 2024 at 13:40.
FranceBB is offline   Reply With Quote
Old 20th March 2024, 09:31   #2897  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by FranceBB View Post
FFMpegSource2("file.mp4", attack=-1)
A typo, I suppose, for
FFMpegSource2("file.mp4", atrack=-1)
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 20th March 2024, 09:41   #2898  |  Link
rgr
Registered User
 
Join Date: Jun 2022
Posts: 53
Quote:
Originally Posted by FranceBB View Post
Yes and it will output the average FPS, so it will drop scenes with more frames and duplicate scenes with less frames.
And that's what I want to avoid. I just want all frames (without duplicating or dropping) like VirtualDub does. So I want to treat VFR as CFR. I'll change the FPS later anyway, and the audio doesn't matter.
rgr is offline   Reply With Quote
Old 20th March 2024, 13:51   #2899  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
Quote:
Originally Posted by tebasuna51 View Post
A typo
yep, fixed.

Quote:
Originally Posted by rgr View Post
And that's what I want to avoid. I just want all frames (without duplicating or dropping)
You... can't, I'm afraid. You can only output a certain framerate and to obtain that ffms2 will either drop or duplicate.
The best bet is to set fpsnum and fpsden to get the maximum output framerate so that it will never drop frames.
Sure, there will be dups scattered here and there, but that's not a problem.
Why? Simple. It's because it's exactly what you would see if you were to open a VFR video on any other player.
Simply put, if you have a video with VFR that oscillates from 10fps to 60fps as the example I mentioned above and you were to play it on your computer connected to a 60Hz monitor, the player would output 60fps all the time to the monitor (that's excluding FreeSync/GSync monitors which are not that common anyway).


In other words, trust me, just set fpsnum and fpsden to the maximum FPS of the video and you're gonna be fine.
Encoding it as CFR is gonna be fine anyway 'cause x264 is really good at spotting duplicated frames so it will just put a B frame there with a reference to the former frame, thus wasting virtually no bitrate. Besides, if you still wanna re-encode it to VFR instead of CFR post Avisynth, you still can anyway as FFMpeg->libx264 can automatically remove dups and encode it as VFR for you.
FranceBB is offline   Reply With Quote
Old 20th March 2024, 14:17   #2900  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
If the MP4 is timestamp VFR variety - It does not drop frames if you omit the fpsnum, fpsden options . You only get the encoded frames and average FPS .

If you enter fpsden, fpsnum, it will add duplicates and/or drop frames to achieve the desired CFR
poisondeathray is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 +1. The time now is 04:09.


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