• 社区 —频道 春城壹网 七彩云南 一网天下 2019-06-15
  • 全国网络举报工作会议 2019-06-15
  • 珍贵!“国宝”林麝现身重庆金佛山 2019-06-11
  • 亚冠前瞻:恒大权健皆不容有失 两将伤情成上港争胜关键 2019-06-09
  • 端午节回归传统习俗 西安市民排队买艾草端午节艾叶-要闻 2019-06-09
  • 湖州唤醒“沉睡”的土地 2019-06-01
  • 在美中国留学生江玥被枪杀案宣判 罪犯获刑25年 2019-05-31
  • 日本大阪6.1级强震4死逾300伤 工厂及店铺恢复运营 2019-05-31
  • 台湾“裤子大王”:百姓三餐不济谈啥“台湾价值” 2019-05-23
  • 韩国釜山海滩变“垃圾场” 清洁工叫苦不堪 2019-05-23
  • 浙江宣讲十九大:之江大地“好声音”“红船”精神入人心 2019-05-19
  • “回天地区”下月开放千套人才公寓 ——凤凰网房产北京 2019-05-13
  • 中国智能手机在东南亚受追捧 2019-04-25
  • 阜阳网络达人“点赞”颍泉绿化提升专项工作 2019-04-23
  • 《国家人文历史》往期杂志汇总 2019-04-22
  • Welcome to

    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 > NLE - Non Linear Editing

    Reply
     
    Thread Tools Search this Thread Display Modes
    Old 17th February 2019, 14:44   #1  |  Link
    Registered User
     
    Join Date: May 2006
    Posts: 3,447
    VFR to CFR conversion

    VEGAS still seems to have issues (creating blended frames or fields) with the handling of (pseudo) VFR files, so I have to convert these VFR files to CFR before importing into VEGAS. I can do this without re-encoding with mkvtoolnix and subsequent remux of the .mkv to a format which Vegas accepts, e.g. m2ts with tsmuxer.
    Can the VFR to CFR conversion be done in 1 step with ffmpeg? I tried various options but did not succeed without re-encoding.
    Sharc is offline   Reply With Quote
    Old 17th February 2019, 14:48   #2  |  Link
    Registered User
     
    Join Date: Dec 2002
    Posts: 5,367
    What is "pseudo VFR"? What is source codec? What is source container? What are you doing in mkvtoolnix exactly?
    sneaker_ger is offline   Reply With Quote
    Old 17th February 2019, 14:57   #3  |  Link
    Registered User
     
    Join Date: May 2006
    Posts: 3,447
    "Pseudo" VFR: These are for example .mp4 clips from mobile phones which are slightly off from the standard framerates, for example 30.007 fps or 29.884 fps instead of nominal 29.97 fps. Dumping the time stamps shows that the frames are pretty much CFR with the exception of say the first or last frame(s) which are way out.

    I fix these by remuxing the .mp4 to .mkv with mkvtoolnix, selecting the framerate as 30000/1001 and ticking "fix bitstream timing info" in the GUI.

    Last edited by Sharc; 17th February 2019 at 15:01.
    Sharc is offline   Reply With Quote
    Old 17th February 2019, 15:48   #4  |  Link
    Registered User
     
    Join Date: Dec 2002
    Posts: 5,367
    Try something like:
    Code:
    ffmpeg -y -i "input.mp4" -c:v copy -an -sn -bsf:v h264_metadata=tick_rate=1001/60000:fixed_frame_rate_flag=1 -f rawvideo - | ffmpeg -y -fflags +genpts -i - -i "input.mp4" -map 0:v -map 1:a -c copy "output.m2ts"
    But it seems there's a lot broken with ffmpeg so it may or may not work depending on the source...
    sneaker_ger is offline   Reply With Quote
    Old 17th February 2019, 17:33   #5  |  Link
    Registered User
     
    Join Date: May 2006
    Posts: 3,447
    Thanks a lot. Unfortunately no luck, getting the error
    Code:
    pipe:: Invalid data found when processing input
    av_interleaved_write_frame(): Broken pipe
    Error writing trailer of pipe:: Broken pipe
    frame=   14 fps=0.0 q=-1.0 Lsize=    1037kB time=00:00:00.43 bitrate=19595.8kbits/s speed=3.33x
    video:1108kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Conversion failed!
    Surprisingly, VMS (Vegas Movie Studio) seems to convert these VFR sources without blending fields and without skipping/doubling frames when I select the rendering quality in VMS to the lower levels like "preview" or "draft".
    Sharc is offline   Reply With Quote
    Old 22nd February 2019, 12:34   #6  |  Link
    Registered User
     
    Join Date: Sep 2005
    Location: Moscow, Russia
    Posts: 56
    Quote:
    Originally Posted by Sharc View Post
    Surprisingly, VMS (Vegas Movie Studio) seems to convert these VFR sources without blending fields...
    Vegas also can do this. Just set in Project Prefs > Video > Resample Mode = Disable.
    Also you can do this for any particular clip in project bu changing clip's properties.
    Kisa_AG is offline   Reply With Quote
    Old 22nd February 2019, 14:28   #7  |  Link
    Registered User
     
    Join Date: Sep 2007
    Posts: 3,800
    For those "pseudo" VFR files, I would use mp4fpsmod . You can batch, and even inplace edit with "-i" (the -i means inplace edit, not "input" like ffmpeg)

    eg.
    Code:
    "mp4fpsmod.exe" --fps 0:30000/1001  "input.mp4" -o "output_cfr.mp4"
    batch inplace edit all mp4 files in a directory
    Code:
    for %%a in ("*.mp4") do "mp4fpsmod" "%%a" -i --fps 0:30000/1001
    pause
    poisondeathray is offline   Reply With Quote
    Old 22nd February 2019, 17:10   #8  |  Link
    Registered User
     
    Join Date: May 2006
    Posts: 3,447
    Quote:
    Originally Posted by Kisa_AG View Post
    Vegas also can do this. Just set in Project Prefs > Video > Resample Mode = Disable.
    Also you can do this for any particular clip in project bu changing clip's properties.
    Thank you for the hint. Apparently it worked for "Draft" and "Preview" project quality setting because these settings disable the resampling by default.
    I found that it is also advisable to import the file at project framerate in order to obtain the desired exact output framerate. New to Vegas, still learning.
    Sharc is offline   Reply With Quote
    Old 22nd February 2019, 17:14   #9  |  Link
    Registered User
     
    Join Date: May 2006
    Posts: 3,447
    Quote:
    Originally Posted by poisondeathray View Post
    For those "pseudo" VFR files, I would use mp4fpsmod . You can batch, and even inplace edit with "-i" (the -i means inplace edit, not "input" like ffmpeg)

    eg.
    Code:
    "mp4fpsmod.exe" --fps 0:30000/1001  "input.mp4" -o "output_cfr.mp4"
    batch inplace edit all mp4 files in a directory
    Code:
    for %%a in ("*.mp4") do "mp4fpsmod" "%%a" -i --fps 0:30000/1001
    pause
    Nice, thank you. I tried and it works. These "VFR" files are still a pain. Better to convert them all to CFR before processing them further.
    Sharc is offline   Reply With Quote
    Old 4th March 2019, 07:09   #10  |  Link
    Registered User
     
    Join Date: Oct 2009
    Location: crow-land
    Posts: 522
    What happens to audio sync, if the first frame is way off ?
    hydra3333 is offline   Reply With Quote
    Old 4th March 2019, 08:35   #11  |  Link
    Registered User
     
    Join Date: May 2006
    Posts: 3,447
    Quote:
    Originally Posted by hydra3333 View Post
    What happens to audio sync, if the first frame is way off ?
    I didn't notice an obvious problem, like an offset or drift. I should perhaps double-check. The clips are all very short, typically less than 30 seconds
    Sharc is offline   Reply With Quote
    Old 4th March 2019, 18:31   #12  |  Link
    Registered User
     
    Join Date: Sep 2007
    Posts: 3,800
    Quote:
    Originally Posted by hydra3333 View Post
    What happens to audio sync, if the first frame is way off ?
    If the first frame is way off, then usually other frames are way off. That would not be a "psuedo VFR" file with minor jitter in the timecodes that you could "treat" as CFR . If you look at mediainfo (view=>text) it will usually report a min/max framerate for those types of files and that will only deviate by a tiny fraction.

    VFR with large deviations cannot be "fixed" with this method, you would have to convert to CFR by using the conventional re-encoding methods - adding duplicate "placeholder" frames to keep sync
    poisondeathray is offline   Reply With Quote
    Old 4th March 2019, 22:46   #13  |  Link
    Registered User
     
    Join Date: May 2006
    Posts: 3,447
    How does MediaInfo determine the min. and max. framerates for VFR video files? Does it scan all timestamps of the entire video file? If so it seems to do this pretty fast.
    Sharc is offline   Reply With Quote
    Old 5th March 2019, 20:04   #14  |  Link
    Registered User
     
    Join Date: Sep 2007
    Posts: 3,800
    Quote:
    Originally Posted by Sharc View Post
    How does MediaInfo determine the min. and max. framerates for VFR video files? Does it scan all timestamps of the entire video file? If so it seems to do this pretty fast.
    I don't know, but I doubt it scans the entire video

    But the videos that have large deviations usually cannot be treated as CFR with that method. Only the ones that are very slightly off can be 29.979, 30.001 etc.. can usually be treated successfully in sync
    poisondeathray is offline   Reply With Quote
    Reply


    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 14:39.


    Powered by vBulletin® Version 3.8.11
    Copyright ©2000 - 2019, vBulletin Solutions Inc.
  • 社区 —频道 春城壹网 七彩云南 一网天下 2019-06-15
  • 全国网络举报工作会议 2019-06-15
  • 珍贵!“国宝”林麝现身重庆金佛山 2019-06-11
  • 亚冠前瞻:恒大权健皆不容有失 两将伤情成上港争胜关键 2019-06-09
  • 端午节回归传统习俗 西安市民排队买艾草端午节艾叶-要闻 2019-06-09
  • 湖州唤醒“沉睡”的土地 2019-06-01
  • 在美中国留学生江玥被枪杀案宣判 罪犯获刑25年 2019-05-31
  • 日本大阪6.1级强震4死逾300伤 工厂及店铺恢复运营 2019-05-31
  • 台湾“裤子大王”:百姓三餐不济谈啥“台湾价值” 2019-05-23
  • 韩国釜山海滩变“垃圾场” 清洁工叫苦不堪 2019-05-23
  • 浙江宣讲十九大:之江大地“好声音”“红船”精神入人心 2019-05-19
  • “回天地区”下月开放千套人才公寓 ——凤凰网房产北京 2019-05-13
  • 中国智能手机在东南亚受追捧 2019-04-25
  • 阜阳网络达人“点赞”颍泉绿化提升专项工作 2019-04-23
  • 《国家人文历史》往期杂志汇总 2019-04-22
  • 北京赛车规律和走势图 剑网3指尖江湖怎样合成五行石 天津时时彩开奖号码 psp圣女贞德合成日文 大乐透12144 云南时时彩福彩网 河南快三预测推荐 香港赛马会69期 逆水寒怎么摆地摊 部落冲突永久在线 玩北京pk10刷水钱教程 混合过关3串1怎么算赢 psp棋牌类合集 体彩浙江6+1开奖结果查询 稳定的时时彩计划王 完美世界手游助力礼包