首页 \ 问答 \ 真正的fft错误 - ffmpeg(Real fft error - ffmpeg)

真正的fft错误 - ffmpeg(Real fft error - ffmpeg)

我正在尝试将ffmpegs fft实用程序用于称为real fft(rdft)的音频样本。

但我有SIGSEGV错误。 代码很简单。

 static void fft(float* data){
    RDFTContext * ctx = av_rdft_init(Globals::WindowSizePower, DFT_R2C)
    av_rdft_calc(ctx, data);
    av_rdft_end(ctx);
    av_free(ctx);
  }

定义的常量是

static const int WindowSize = 1024;
static const int WindowSizePower = 10;

有人能告诉我我做错了什么吗? 我试图在互联网上找到使用这个ffmpeg实用程序的例子,但我没找到任何。

编辑:

这是调用此功能的功能

void fftInit(float* correction){
        m_fft_data = new float[Globals::WindowSize]();
        memcpy(m_fft_data, correction, sizeof(float)*Globals::WindowSize);
        for(int i = 0; i < Globals::WindowSize; ++i){
            m_fft_data[i] *= m_data[i];
        }

        FFMPEGFFT::fft(m_fft_data);
    }

输入数据已正确分配。 在进入这一部分之前,我测试了提取的数据。


I am trying to use ffmpegs fft utility for audio samples called real fft(rdft).

But I have SIGSEGV error. Code is very simple.

 static void fft(float* data){
    RDFTContext * ctx = av_rdft_init(Globals::WindowSizePower, DFT_R2C)
    av_rdft_calc(ctx, data);
    av_rdft_end(ctx);
    av_free(ctx);
  }

Defined constants are

static const int WindowSize = 1024;
static const int WindowSizePower = 10;

Can someone tell me what I am doing wrong? I tried to find example on internet where this ffmpeg utility is used but I didnt find any.

EDIT:

This is function which call this function

void fftInit(float* correction){
        m_fft_data = new float[Globals::WindowSize]();
        memcpy(m_fft_data, correction, sizeof(float)*Globals::WindowSize);
        for(int i = 0; i < Globals::WindowSize; ++i){
            m_fft_data[i] *= m_data[i];
        }

        FFMPEGFFT::fft(m_fft_data);
    }

Input data is properly allocated. I tested extracted data before coming to this part.


原文:https://stackoverflow.com/questions/37950866
更新时间:2024-02-11 06:02

最满意答案

将它们添加到同一行下:

  <div class="container-fluid">
<div class="row">
<div class="col-lg-6">
  <div class="container shapef">
    <form class="well form-horizontal" action=" " method="post" id="contact_form">
      <fieldset>

        <br>

        <div class="form-group">
          <label class="col-md-2 control-label">Name</label>
          <div class="col-md-9 inputGroupContainer">
            <div class="input-group">
              <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
              <input name="name" placeholder="Name" class="form-control" type="text">
            </div>
          </div>
        </div>

        <div class="form-group">
          <label class="col-md-2 control-label">Email</label>
          <div class="col-md-9 inputGroupContainer">
            <div class="input-group">
              <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
              <input name="email" placeholder="Email Address" class="form-control" type="text">
            </div>
          </div>
        </div>


        <div class="form-group">
          <label class="col-md-2 control-label">Message</label>
          <div class="col-md-9 inputGroupContainer">
            <div class="input-group">
              <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
              <textarea class="form-control" name="comment" placeholder="Message"></textarea>
            </div>
          </div>
        </div>

        <div class="alert alert-success" role="alert" id="success_message">Success <i class="glyphicon glyphicon-thumbs-up"></i> Thanks for contacting me, I'll get back to you shortly.</div>

        <!-- Button -->
        <div class="form-group">
          <label class="col-md-2 control-label"></label>
          <div class="col-md-4">
            <button type="submit" class="btn btn-warning">Send <span class="glyphicon glyphicon-send"></span></button>
          </div>
        </div>

      </fieldset>
    </form>
  </div>
</div>
<div class="col-lg-6 kopcheta">
                <ul class="list-inline banner-social-buttons">

                        <li>
                            <a href="https://github.com/l-emi" target="_blank" class="btn btn-default btn-lg btn-warning"><i class="fa fa-github fa-fw"></i> <span class="network-name">Github</span></a>
                        </li>
                        <li>
                            <a href="https://uk.linkedin.com/in/lidiya-nikolova-b979348b" target="_blank" class="btn btn-default btn-lg btn-warning"><i class="fa fa-linkedin fa-fw"></i> <span class="network-name">Linkedin</span></a>
                        </li>
                        <li>
                            <a href="https://www.freecodecamp.com/l-emi" target="_blank" class="btn btn-default btn-lg btn-warning"><i class="fa fa-fire fa-fw"></i> <span class="network-name">FreeCodeCamp</span></a>
                        </li>

                </ul>
            </div>
<!-- /.container -->
</div>
</div>
</div>

add them under same row:

  <div class="container-fluid">
<div class="row">
<div class="col-lg-6">
  <div class="container shapef">
    <form class="well form-horizontal" action=" " method="post" id="contact_form">
      <fieldset>

        <br>

        <div class="form-group">
          <label class="col-md-2 control-label">Name</label>
          <div class="col-md-9 inputGroupContainer">
            <div class="input-group">
              <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
              <input name="name" placeholder="Name" class="form-control" type="text">
            </div>
          </div>
        </div>

        <div class="form-group">
          <label class="col-md-2 control-label">Email</label>
          <div class="col-md-9 inputGroupContainer">
            <div class="input-group">
              <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
              <input name="email" placeholder="Email Address" class="form-control" type="text">
            </div>
          </div>
        </div>


        <div class="form-group">
          <label class="col-md-2 control-label">Message</label>
          <div class="col-md-9 inputGroupContainer">
            <div class="input-group">
              <span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
              <textarea class="form-control" name="comment" placeholder="Message"></textarea>
            </div>
          </div>
        </div>

        <div class="alert alert-success" role="alert" id="success_message">Success <i class="glyphicon glyphicon-thumbs-up"></i> Thanks for contacting me, I'll get back to you shortly.</div>

        <!-- Button -->
        <div class="form-group">
          <label class="col-md-2 control-label"></label>
          <div class="col-md-4">
            <button type="submit" class="btn btn-warning">Send <span class="glyphicon glyphicon-send"></span></button>
          </div>
        </div>

      </fieldset>
    </form>
  </div>
</div>
<div class="col-lg-6 kopcheta">
                <ul class="list-inline banner-social-buttons">

                        <li>
                            <a href="https://github.com/l-emi" target="_blank" class="btn btn-default btn-lg btn-warning"><i class="fa fa-github fa-fw"></i> <span class="network-name">Github</span></a>
                        </li>
                        <li>
                            <a href="https://uk.linkedin.com/in/lidiya-nikolova-b979348b" target="_blank" class="btn btn-default btn-lg btn-warning"><i class="fa fa-linkedin fa-fw"></i> <span class="network-name">Linkedin</span></a>
                        </li>
                        <li>
                            <a href="https://www.freecodecamp.com/l-emi" target="_blank" class="btn btn-default btn-lg btn-warning"><i class="fa fa-fire fa-fw"></i> <span class="network-name">FreeCodeCamp</span></a>
                        </li>

                </ul>
            </div>
<!-- /.container -->
</div>
</div>
</div>

相关问答

更多
  • 使用 Notifications.contact(params[:email]).deliver 更多信息 Use Notifications.contact(params[:email]).deliver More info
  • 将它们添加到同一行下:

    您正在使用POST变量,但您的表单如下所示: 没有定义POST方法。 未定义方法时,表单默认为GET。 因此,您需要将表单更改为 从你留下的评论: “我仍然遇到了一个问题,那就是他们不会给我他们输入的电子邮件,而是给托管公司创建的电子邮件,这是不好的。” 答:这很可能是因为你的代码中使用了From:这是人的姓名。 邮件 ...
  • 这有帮助吗? http://forums.site5.com/showthread.php?t=18522 Does this help any? http://forums.site5.com/showthread.php?t=18522
  • 尝试在CSS中添加一个浮点数: .send { display: block; float: left; } .clear { display: block; } 更新了您的小提琴 然后,您可以为您的类(也许是父类)添加margin或padding ,并根据需要使事物处于中心位置。 Try adding a float to your CSS: .send { display: block; float: left; } .clear { display: block; } ...
  • 将复选框包装在单独的容器中,并将这些样式规则应用于这些容器。 .checkbox-container { width: 50%; margin: 0; padding: 0; float: left; } 为了改善美感,您可以添加填充和边距。 确保在宽度上进行必要的调整以适应这些变化。 Wrap the checkboxes in separate containers and apply these style rules to those containers. .ch ...
  • 您不能像任何按钮那样设置文件上传按钮的样式,而是可以使用伪元素覆盖按钮并对其应用样式。 你可以尝试这样的事情。 您可以根据需要更改“新”按钮的内容和样式: span.cv { position:relative; } span.cv:before { content:"Upload file"; position:absolute; left:0; padding:5px; background:red; color:#fff; width:130px; ...
  • 你应该考虑使用on_sent_ok钩子 : on_sent_ok: "window.open('https://www.google.com', '_self');" 只有在表单提交没有错误并且已发送电子邮件时才会触发此操作。 另外,请注意在任何地方使用双引号。 You should consider using the on_sent_ok hook instead: on_sent_ok: "window.open('https://www.google.com', '_self');" This ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)