• 《国家人文历史》往期杂志汇总 2019-04-22
  • 一师一团土地确权登记颁证工作全面展开 2019-04-14
  • 德州扑克赌场披“俱乐部”外衣 打竞技旗号难掩赌博实质 2019-04-12
  • 自治区党委召开常委(扩大)会议 陈全国主持 2019-04-12
  • 17年来首次!塔利班组织宣布停火3天 与阿富汗民众自拍 2019-04-04
  • 2022年冬奥会筹备进行时 2019-04-03
  • 人家80年前就造航母,我们现在才造航母,基础不一样。 2019-04-03
  • 葡萄牙首都上演城市节狂欢 2019-04-01
  • RED EARTH红地球展现自我丝绒唇膏全新发布 2019-03-24
  • 龙船礼 有讲究 百岁龙 抖精神 2019-03-17
  • 新加坡航空将开通 全球最长商业航线 2019-03-17
  • 传说中的自由飞“翔” 当厕所被狂风吹上天 2019-03-12
  • 导游强迫交易获刑 曾辱骂威胁强迫游客消费上万元--旅游频道 2019-03-09
  • 北京正式推出租赁型职工集体宿舍 每间居住人数不超8人 2019-03-09
  • 美元短线拉升 随后回吐涨幅 2019-03-07
  • 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,427
    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,286
    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,427
    "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,286
    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,427
    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,758
    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,427
    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,427
    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: 520
    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,427
    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,758
    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,427
    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,758
    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 09:56.


    Powered by vBulletin® Version 3.8.11
    Copyright ©2000 - 2019, vBulletin Solutions Inc.
  • 《国家人文历史》往期杂志汇总 2019-04-22
  • 一师一团土地确权登记颁证工作全面展开 2019-04-14
  • 德州扑克赌场披“俱乐部”外衣 打竞技旗号难掩赌博实质 2019-04-12
  • 自治区党委召开常委(扩大)会议 陈全国主持 2019-04-12
  • 17年来首次!塔利班组织宣布停火3天 与阿富汗民众自拍 2019-04-04
  • 2022年冬奥会筹备进行时 2019-04-03
  • 人家80年前就造航母,我们现在才造航母,基础不一样。 2019-04-03
  • 葡萄牙首都上演城市节狂欢 2019-04-01
  • RED EARTH红地球展现自我丝绒唇膏全新发布 2019-03-24
  • 龙船礼 有讲究 百岁龙 抖精神 2019-03-17
  • 新加坡航空将开通 全球最长商业航线 2019-03-17
  • 传说中的自由飞“翔” 当厕所被狂风吹上天 2019-03-12
  • 导游强迫交易获刑 曾辱骂威胁强迫游客消费上万元--旅游频道 2019-03-09
  • 北京正式推出租赁型职工集体宿舍 每间居住人数不超8人 2019-03-09
  • 美元短线拉升 随后回吐涨幅 2019-03-07
  • 彩票中奖喜报怎么写 双色球号码 360双色球彩经网 北京快乐8走势图 德州扑克2 意大利pk10的玩法 快乐时时彩走势图开奖号码 网上彩票 新疆时时彩开奖官网 云南时时彩中和值走势 山东群英会图表走势图 七乐彩七乐彩开奖视频 排列3平均值走势图 体彩p3天齐网 北京彩票官网 重庆幸运农场