avatar
Articles
286
Tags
104
Categories
25

Theqiqi_blog
Search

Theqiqi_blog

爬虫7.C语言中使用FFmpeg读取视频文件后将视频流写入其他文件
Created2025-02-02|爬虫|C•http
C语言中使用FFmpeg读取视频文件后将视频流写入其他文件1.使用ffmpeg复制完整流(根据输入名识别格式) 代码 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180#include ...
爬虫6.C语言中使用FFmpeg捕获视频文件流的基本流程
Created2025-02-02|爬虫|C•http
1.C语言中使用FFmpeg捕获视频文件流的基本流程1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586#include <libavformat/avformat.h> #include <libavcodec/avcodec.h> int main() { AVFormatContext* fmt_ctx = NULL; AVCodecParameters* codec_params = NULL; const AVCodec* codec = NULL; AVCodecContext* codec_ctx = NULL; int video_stream_index = -1; // 注册所有组件(新版本可能不需要) ...
爬虫5.使用ffplay播放与下载视频
Created2025-02-02|爬虫|C•http
使用ffplay与ffmpeg处理本地视频一、使用ffplay播放本地视频1ffplay -i "D:\Users\3\Videos\落叶的位置.mp4" 二、使用ffmpeg复制视频1ffmpeg -i "D:\Users\3\Videos\落叶的位置.mp4" -c copy "D:\Users\3\Videos\output.mp4" 使用ffplay与ffmpeg处理网络视频一、使用ffmpegy与TCP协议推流,使用ffplay播放1. 推流解码后的视频文件并播放 服务端监听 1ffmpeg -re -i input.mp4 -f mpegts tcp://0.0.0.0:1234?listen 客户端播放 1ffplay tcp://10.0.3.1:1234 2. 推流视频文件并播放 服务端监听 1ffmpeg -re -i input.mp4 -c copy -f mpegts tcp://0.0.0.0:1234?listen 客户端播放 1ffplay tcp://10.0.3.1: ...
爬虫4.C语言写一个支持http与https下载的客户端
Created2025-02-02|爬虫|C•http
C语言写一个支持http与https下载的客户端准备几个http网址http://example.com http://books.toscrape.com/ 技术成就梦想51CTO-中国知名的数字化人才学习平台和技术社区 一、用C语言写一个windows客户端访问使用http协议的网站下载单个文件1. 大概思路 思路为发送Get请求, 接收响应, 打印响应头 , 将网页源码写入一个html文件中, 2.代码实现 编写代码访问http://example.com并下载html文件。 main.c 123456789101112131415161718192021222324252627282930313233343536373839#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <winsock2.h>#include "http_client_utils.h"#pragma comment(lib, "ws2_32.lib")int main() & ...
爬虫3.C语言使用http协议传输文件
Created2025-02-02|爬虫|C•http
C语言使用http协议传输文件1. 用C语言在Linux服务端中写一个http文件服务器 新建一些文件夹与文件并填充内容 123456mkdir -p /home/kali/cc++/crawler/testcd /home/kali/cc++/crawler/testmkdir subdirecho "Hello, world!" > hello.txtecho "<html><body>Test Page</body></html>" > index.htmlecho "This is a subdirectory file" > subdir/subfile.txt 编写代码 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 ...
爬虫2.C语言使用TCP协议传输文件
Created2025-02-02|爬虫|C•http
C语言使用TCP协议传输文件一、 C语言使用TCP协议通过windows客户端给Linux服务端发送文本文件1. 大概步骤 windows客户端中创建一个文本文件·file.txt`。 windows客户端读取本地文件所有内容发送给服务端。 服务端接收消息并在服务器上创建文件写入所有内容。 2. 编写客户端代码12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h>#include <string.h>#include <winsock2.h>#include <ws2tcpip.h>#pragma comment(lib, "ws2_32.lib" ...
爬虫1.C语言怎么读写文件
Created2025-02-02|爬虫|C•http
C语言怎么读写文件一、C语言创建文件1. 使用C语言创建一个文本文件log.txt并写入hello,world1234567891011121314151617181920212223#include <stdio.h>int main() { FILE *file; // 以写入模式打开文件,如果文件不存在则创建 file = fopen("log.txt", "w"); if (file == NULL) { printf("无法创建文件。\n"); return 1; } // 向文件中写入内容 fprintf(file, "hello,world\n"); // 关闭文件 fclose(file); printf("文件创建并写入成功!\n"); return 0;} 2. 使用C语言打开log.txt并在下一行添加字符串”你好, ...
C语言使用标准输入输出流或者windows或者Linux输入输出流
Created2025-02-01|C语言的万种用法|C•Windows•Linux
C语言用户层的输出流✅ 1. 使用 C 标准库的 printf(stdout)123456#include <stdio.h>int main() { printf("Hello from C stdout (printf)!\n"); return 0;} ✅ 2.示例代码:C 标准输入输出流使用1. 标准 C 库标准输出流函数(跨平台通用) 这些函数是 C 标准库的一部分,在 Linux 和 Windows 上均可使用: printf / fprintf 123printf("Hello, World!\n"); // 输出到 stdoutfprintf(stdout, "Hello, stdout!\n"); // 等价于 printffprintf(stderr, "Error: something wrong\n"); // 输出到 stderr puts / fputs 1 ...
C语言程序中调用windows命令
Created2025-02-01|C语言的万种用法|C•Windows•Linux
C语言程序中调用windows命令在 C 语言程序中调用 Windows 命令,可以通过以下几种方式实现: 1. 使用 system() 函数(最简单)system() 是标准 C 库函数,直接执行命令行字符串: 1234567#include <stdlib.h>int main() { system("dir"); // 执行 `dir` 命令(列出当前目录) system("ping 127.0.0.1"); // 执行 ping 命令 return 0;} 优点:简单易用,跨平台(在 Linux 下也可用,但命令不同)。 缺点: 会启动 cmd.exe 子进程,性能较低。 无法直接获取命令的输出(仅显示在控制台)。 2. 使用 popen() 函数(捕获命令输出)popen() 可以执行命令并读取其输出(通过管道): 123456789101112131415161718#include <stdio.h>#include <stdlib. ...
GNUmakefile
Created2024-09-02|FirstPragram|Linux•first pragram•Makefile
Makefile (notes and examples)This document explains how to compile C programs with gcc and how to use Makefiles to automate builds. It includes step-by-step commands, split compilation, simple Makefiles, and improved templates with variables and pattern rules. 1. How to compile a simple program Create main.c: 11. Create `main.c`: Write this example code into main.c: 123gcc -o hello main.o defs.ogcc -c main.c -o main.o Makefile (notes and examples) This document explains how to compile C prog ...
1…111213…29
avatar
Theqiqi
Articles
286
Tags
104
Categories
25
Follow Me
Announcement
This is my Blog
Recent Post
101.使用Grop网站提供的api2026-01-03
9.压测2025-03-27
8.Linux Socket并发模型http服务器2025-03-27
7.web服务器中收发REST接口2025-03-27
6使用c语言与linux系统写一个web服务器,解析并响应get与post请求2025-03-27
Categories
  • C with Socks16
  • C_Sound10
  • C_Windows_Graphi9
  • Cpp5
  • Cpp_Socket4
  • C语言在Windows中实现抓包4
  • C语言的万种用法9
  • Debian1
Tags
cmake Cmake ipv4 x86汇编程序 Hacking LinuxDriver Python C++ android c_windows_driver Drvier epoll Piano OpenGl Disk linux MySql web Ethernet WindowsDrive jsp gtest html poll LinSock first pragram AI UART javascript System C http opencv Sound system PVE Hook Graphi Qt5.8 c语言的万种用法
Archives
  • January 20261
  • March 202595
  • February 202523
  • September 20242
  • August 202471
  • June 20242
  • March 202443
  • February 20248
Info
Article :
286
UV :
PV :
Last Update :
©2020 - 2026 By Theqiqi
Framework Hexo|Theme Butterfly
Search
Loading the Database