VFR Vegas 19 and FFMPEG - Choppy Video

eikira wrote on 8/24/2022, 3:02 AM

So i downloaded an HLS (its a chopped TS stream i think) video from a website, using Video DownloadHelper, since is pretty much the only one who manages to download HLS videos correctly.
The downloaded video plays. But it is choppy and its in VFR, meaning every second or so it lags a bit.
Now Vegas 19 can load it absolutely fine, and you can playback it too, but even here its choppy. Resampling is disabled. I also tryed resampling enabled. Same result.

Now Video DownloadHelper has the ability to reencode the downloading video too. And if i select that, it manages to turn it to CFR and makes it really smooth, no lagging no chopping and chocking video.
I know that Video DownloadHelper uses in the background FFMPEG, so it commands it to convert VFR to CFR and removes therefor the whole stuttering.

I use quiet often FFMPEG, but i do not know every command. '-r 25' turns the video from 15-40 fps to a constant frame rate video, but the stuttering remains.
I searched around on the web, but could not really find a helping solution.
And the reason i cant use the built in encoder of Video DownloadHelper is simple, it watermarks it, and right now i cant pay with a creditcard for a license (the only payment available...)

So is an FFMPEG genius here who has an ideo what to do? I would like to convert that video for good (i still will try around with HoS if i can convert it there to make it smooth).

Comments

wwaag wrote on 8/24/2022, 10:36 AM

Try the ImportAssist tool in HOS using the Rewrap option and tick VFR to CFR as shown. Rather than recode (which takes time and results in quality loss), this option simply rewrites the presentation timestamps and leaves the video stream unchanged (hence no loss of quality and it is very quick). It may or may not work depending how large a variation there is from one timestamp to another.

Perhaps you could upload a short sample of your footage?

Last changed by wwaag on 8/24/2022, 10:39 AM, changed a total of 1 times.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

eikira wrote on 8/24/2022, 10:59 AM

Try the ImportAssist tool in HOS using the Rewrap option and tick VFR to CFR as shown. Rather than recode (which takes time and results in quality loss), this option simply rewrites the presentation timestamps and leaves the video stream unchanged (hence no loss of quality and it is very quick). It may or may not work depending how large a variation there is from one timestamp to another.

Perhaps you could upload a short sample of your footage?

like i said in the end of my comment i will try HoS =)
and yes now i tryed it and it actually does a fantastic job.
now is it possible to know what exactly is it doing behind the scenes that it makes work so good? maybe its possible to replicate on other software somehow if i understand what exactly is happening.

eikira wrote on 8/24/2022, 11:08 AM

Try the ImportAssist tool in HOS using the Rewrap option and tick VFR to CFR as shown. Rather than recode (which takes time and results in quality loss), this option simply rewrites the presentation timestamps and leaves the video stream unchanged (hence no loss of quality and it is very quick). It may or may not work depending how large a variation there is from one timestamp to another.

Perhaps you could upload a short sample of your footage?

oh and something else wwag. i think you should put HoS as a regular download on your page. i havent worked since 4 months or so on any video project, therefor i missed 2 updates. it seems HoS cant handle to check for 2 updates further or something. gladly you put up the link here in the forum to download the newest version with the update infos.
HoS just complained it could not connect to the server...

Musicvid wrote on 8/24/2022, 11:10 AM

now is it possible to know what exactly is it doing behind the scenes that it makes work so good? maybe its possible to replicate on other software somehow if i understand what exactly is happening.

Yes. For a start:

https://www.vegascreativesoftware.info/us/forum/faq-how-to-post-mediainfo-and-vegas-pro-file-properties--104561/

Since you have ffmpeg, use ffprobe for more clues.

 

eikira wrote on 8/24/2022, 11:15 AM

now is it possible to know what exactly is it doing behind the scenes that it makes work so good? maybe its possible to replicate on other software somehow if i understand what exactly is happening.

Yes. For a start:

https://www.vegascreativesoftware.info/us/forum/faq-how-to-post-mediainfo-and-vegas-pro-file-properties--104561/

Since you have ffmpeg, use ffprobe for more clues.

 

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format-Profil                            : High@L3
Format-Einstellungen                     : CABAC / 4 Ref Frames
Format-Einstellungen für CABAC           : Ja
Format-Einstellungen für RefFrames       : 4 frames
Codec-ID                                 : avc1
Codec-ID/Info                            : Advanced Video Coding
Dauer                                    : 57s 300 ms
Source duration                          : 56s 893 ms
Bitrate                                  : 1 000 kb/s
Breite                                   : 848 Pixel
Höhe                                     : 480 Pixel
Bildseitenverhältnis                     : 16:9
Modus der Bildwiederholungsrate          : variabel
Bildwiederholungsrate                    : 25,029 FPS
minimale Bildwiederholungsrate           : 6,250 FPS
maximale Bildwiederholungsrate           : 100,000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scantyp                                  : progressiv
Bits/(Pixel*Frame)                       : 0.098
Stream-Größe                             : 6,78 MiB (91%)
Source stream size                       : 6,78 MiB (91%)
Codec configuration box                  : avcC

i never used ffprobe befor so i dont know what i can show you. this?:
 

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\John Cleese - Creativity How Modern Culture Has Stifled Come-00.01.59.233-00.02.56.532.mp4':
  Metadata:
    minor_version   : 512
    major_brand     : isom
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.16.100
  Duration: 00:00:57.31, start: 0.000000, bitrate: 1095 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 848x480, 1000 kb/s, 25.03 fps, 300 tbr, 90k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]

 

wwaag wrote on 8/24/2022, 11:25 AM

"now is it possible to know what exactly is it doing behind the scenes that it makes work so good?"

Do you expect me to give away all of my trade secrets? LOL.

First, I didn't write the code--it's well beyond my pay grade. HOS is simply an interface between Vegas and lots of open source assets. The VFR to CFR conversion makes use of a tiny mp4 timecode editor mp4fpsmod. If you google it, you can find the github repository where the source code (written in C++) can be downloaded.

Regarding the HOS server issue, that was fixed in 1.0.3.21. The current build is 1.0.3.22 and can be downloaded at https://tools4vegas.com/ru4f7l9rxql9ykg/

I always post new build information on the main HOS thread. Now that the DropBox issue has been resolved with inability to connect to the server, you should get an automatic notification when launching HOS.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

eikira wrote on 8/24/2022, 11:40 AM

"now is it possible to know what exactly is it doing behind the scenes that it makes work so good?"

Do you expect me to give away all of my trade secrets? LOL.

First, I didn't write the code--it's well beyond my pay grade. HOS is simply an interface between Vegas and lots of open source assets. The VFR to CFR conversion makes use of a tiny mp4 timecode editor mp4fpsmod. If you google it, you can find the github repository where the source code (written in C++) can be downloaded.

well to bad i have no clue about coding.
ok now i tryed the rewrap on the entire video, and it seems not want to do it on such a long almost 3 hours video (original resolution is 1920x1080). vegas is in freeze. in my temp folder a rewrap file on the similar size as the original is around but it will not playback...

Howard-Vigorita wrote on 8/24/2022, 1:29 PM

@eikira The -r option is what I use with ffmpeg and that usually does the trick for me. Not clear what codec option you're using. You might try comparing results of the libx264 with one of the hardware codecs like adding "-c:v h264_nvenc -pix_fmt yuv420p" if you have a 3080 gpu.

Also, this doom9 thread has a link to an already built mp4fpsmod.exe v0.26 ... and a 2-step ffmpeg process that might work too. The docs on using mp4fpsmod.exe are on github.

eikira wrote on 8/24/2022, 1:57 PM

@eikira Also, this doom9 thread has a link to an already built mp4fpsmod.exe v0.26 ... and a 2-step ffmpeg process that might work too. The docs on using mp4fpsmod.exe are on github.

no -r 25 did it not for me, as i wrote in my initial post. but good you found mp4fpsmod.exe on doom9! since it is en executable and the absolute basic command worked, with mp4fpsmod.exe my problem is solved. it playbacks buttery smooth!

i dont understand the creater of this wonderful tool, not to publish it in as an exe on their github. nevertheless i am happy. thanks all.

wwaag wrote on 8/24/2022, 4:16 PM

@Howard-Vigorita

Thanks for posting that doom-9 thread. I was unaware of the new version. HOS was still using v0.25. Actually, I found the original using the link in that thread that now returns a 404.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Former user wrote on 8/24/2022, 5:53 PM

@wwaag Have you ever looked into the apparent VFR of a typical phone video recording or the VFR caused by rewraping common formats such as mkv to mp4. I've heard it speculated in the case of phones, it's not really VFR, for some reason the beginning and end frame (frames?) are out, and in the case of rewrapping it's due to 'time base conversion' . Not sure if that means it's really VFR or a similar thing to what allegedly is going on with phones

eikira wrote on 8/25/2022, 5:27 AM

@Howard-Vigorita

Thanks for posting that doom-9 thread. I was unaware of the new version. HOS was still using v0.25. Actually, I found the original using the link in that thread that now returns a 404.

yes those dead links are there to, but at least version 0.26 as an exe was around.
what could have been the problem in HoS that it freezes the rewraping of an almost 3 hours video?
the 0.26 exe i downloaded took about 4-5 minutes to rewrap it, but it worked on its own.

wwaag wrote on 8/25/2022, 9:37 AM

@Former user

In all honesty, I've never taken the time to look at timestamps at that level to determine if indeed the variation occurs only at the beginning or throughout for selected files. I've only focused on trying to come up with an easy conversion to CFR--in this case, use of the app which does seem to work reasonably well. I routinely use it in a number of HOS tools including rewrapping MKVs to other formats and also combining region renders into a single output file.

@eikira

Since 0.26 works well, you can just copy that into the following folder C:\Program Files\HappyOtterScripts to replace the older file in HOS. I have no idea why the older build did not work. However, it was apparently a 32 bit app rather than 64 which may account for its failure on very long conversions.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

eikira wrote on 8/25/2022, 2:28 PM
@eikira

Since 0.26 works well, you can just copy that into the following folder C:\Program Files\HappyOtterScripts to replace the older file in HOS. I have no idea why the older build did not work. However, it was apparently a 32 bit app rather than 64 which may account for its failure on very long conversions.

@wwaag i replaced it as you said, and it actually fixed the problem and works now in vegas with hos with the very long video.

wwaag wrote on 8/25/2022, 2:56 PM

@eikira

Thanks so much. That's good news.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.