当前位置: 首页 > news >正文

网站建设文编app运营需要做哪些

网站建设文编,app运营需要做哪些,建立手机网站,怎样做网站的源代码ffmpeg读取Wav音频并保存PCM&#xff08;源代码保存成 c 文件&#xff09;&#xff1a; // test_ffmpeg.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 ////#include <iostream>#include <libavcodec/avcodec.h> #include <libavform…

ffmpeg读取Wav音频并保存PCM(源代码保存成 c 文件):

// test_ffmpeg.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
////#include <iostream>#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
//#pragma comment(lib, "libavdevice.a")
//#pragma comment(lib, "libavformat.a")
//#pragma comment(lib, "libavutil.a")
//#pragma comment(lib, "libavcodec.a")
//#pragma comment(lib, "libavfilter.a")
//#pragma comment(lib, "libswresample.a")
//#pragma comment(lib, "libswscale.a")int main(int arvc, char*argv[]) {//av_register_all();printf("start...\n");AVFormatContext* formatCtx = NULL;const AVInputFormat* inputFmt = av_find_input_format(arvc > 1 ? argv[1] : "FLAC");int ret = 0;printf("format name: %s, long name; %s\n", inputFmt->name, inputFmt->long_name);// 打开输入流if ((ret = avformat_open_input(&formatCtx, "D:\\project\\ffmpeg-6.1.1\\test_in.wav", inputFmt, NULL)) != 0) {printf("Unable to open input stream: %s\n", av_err2str(ret));return -1;}// 查找音频流信息if (avformat_find_stream_info(formatCtx, NULL) < 0) {printf("Unable to find audio stream information: %s\n", av_err2str(ret));return -1;}// 寻找第一个音频流索引int audioStreamIndex = av_find_best_stream(formatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);if (audioStreamIndex < 0) {printf("Unable to find audio stream: %s\n", av_err2str(ret));return -1;}//const AVCodecContext* codecCtx = formatCtx->streams[audioStreamIndex]->codec;AVCodecContext* pCodecCtx = avcodec_alloc_context3(NULL);if (pCodecCtx == NULL){printf("Could not allocate AVCodecContext: %s\n", av_err2str(ret));return -1;}avcodec_parameters_to_context(pCodecCtx, formatCtx->streams[audioStreamIndex]->codecpar);// 打开解码器const AVCodec* codec = avcodec_find_decoder(pCodecCtx->codec_id);if (avcodec_open2(pCodecCtx, codec, NULL) < 0) {printf("Unable to open decoder: %s\n", av_err2str(ret));return -1;}// 创建输出文件FILE* outputFile = fopen("output.pcm", "wb");AVPacket packet;printf("start read frame...\n");while ((ret = av_read_frame(formatCtx, &packet)) == 0) {// 如果数据包是音频数据if (packet.stream_index == audioStreamIndex) {AVFrame* frame = av_frame_alloc();int gotFrame = 0;printf("read frame...index %d\n", audioStreamIndex);// 解码音频帧//avcodec_decode_audio4(pCodecCtx, frame, &gotFrame, &packet);if (avcodec_send_packet(pCodecCtx, &packet) < 0|| (gotFrame = avcodec_receive_frame(pCodecCtx, frame)) < 0) {return -1;}printf("read frame...gotFrame = %d, frame size %d, frame pointer 0x%x\n", (ret), frame->linesize[0], frame->data[0]);if (gotFrame == 0) {// 处理解码后的音频数据,例如写入文件等fwrite(frame->data[0], 1, frame->linesize[0], outputFile);}av_frame_free(&frame);}//av_free_packet(&packet);av_packet_unref(&packet);}printf("read frame end. ret = %s\n", av_err2str(ret));fclose(outputFile);avformat_close_input(&formatCtx);return 0;
}// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
// 调试程序: F5 或调试 >“开始调试”菜单// 入门使用技巧: 
//   1. 使用解决方案资源管理器窗口添加/管理文件
//   2. 使用团队资源管理器窗口连接到源代码管理
//   3. 使用输出窗口查看生成输出和其他消息
//   4. 使用错误列表窗口查看错误
//   5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目
//   6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件

编译命令(使用windows 下的 MSYS2 UCRT64 工具):

gcc -c test.c -o test.o -I./ffmpeg-bin/include gcc -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--nxcompat,--dynamicbase -Wl,--high-entropy-va -Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil  -Wl,--image-base,0x140000000 -o test_g test.o -lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil  -lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi -lgdi32 -lm -latomic -lvfw32 -lm -latomic -lm -latomic -lz -lsecur32 -lws2_32 -liconv -lm -latomic -lmfuuid -lole32 -lstrmiids -lole32 -luser32 -lz -lm -latomic -lm -latomic -lm -luser32 -lbcrypt -latomic  -lole32 -lpsapi -lshell32strip -o test_1.exe test_g.exe# 使用upx压缩应用(需要windows终端执行)
upx.exe -9 -o test.exe test_1.exerm -rf test_g.exe test_1.exe./test.exe

http://www.hkea.cn/news/75702/

相关文章:

  • 手机3d动画制作软件重庆网络seo公司
  • 青海和城乡建设厅网站石家庄自动seo
  • 建站网址是多少深圳市seo上词多少钱
  • 应用网站开发创建网站花钱吗
  • 2023太原疫情优化设计答案大全
  • 创新的专业网站建设适合小学生的新闻事件
  • 政府机关备案网站百度竞价什么意思
  • 广元专业高端网站建设seo视频
  • 烟台网站建设诚信臻动传媒百度网络营销中心
  • 贵阳网站建设搜王道下拉重庆seo网络推广关键词
  • 大型 网站的建设 阶段百度官方网站下载
  • 江苏专业做网站的公司百度地图导航网页版
  • 怎么去投诉做网站的公司宁波seo外包推广软件
  • 网络营销跟做网站有什么区别线上推广如何引流
  • 如何进行网店推广seo排名优化怎样
  • 什么建站程序好收录上海网络公司seo
  • 电子商务网站建设投资预算小程序平台
  • 广州外贸营销型网站成都移动seo
  • 如何韩国视频网站模板下载 迅雷下载sem竞价托管费用
  • 做网站去哪个平台seo培训学院
  • 网站移动端优化的重点有哪些营销策略ppt
  • 养车网站开发搜狗seo快速排名公司
  • 企业电子商务网站建设武汉百度快速排名提升
  • 建一个网站的流程今天刚刚发生的新闻
  • 建立网站请示优化服务是什么意思
  • 有一个做场景动画的网站山东seo费用多少
  • 阿里云服务器的网站备案流程图营销推广有哪些形式
  • 做宣传用什么网站好手游推广平台有哪些
  • 免费全国网站在线客服软件新手电商运营从哪开始学
  • 0317网站建设怎么建个网站