Comments (9)
把测试的flv文件发一下?
from media-server.
4.zip
4.flv 转出 fMP4 用vlc播放有声音,发送到手机上播放没有声音 ,(qq消息播放)
from media-server.
你好,请问int fmp4_writer_add_video(struct fmp4_writer_t* writer, uint8_t object, int width, int height, const void* extra_data, size_t extra_data_size)这个方法extra_data的数据要求,传入1.sps,2.sps+pps,3,sps+pps+frame,哪种才是对的
int fmp4_writer_write(struct fmp4_writer_t* writer, int idx, const void* data, size_t bytes, int64_t pts, int64_t dts, int flags)这个方法data数据要求不清楚,sps ,pps是否也要调用这个方法,每次都调用,还是只有头部写入之后就不用写了呢。
from media-server.
fmp4-writer.h头文件中描述了参数格式。
fmp4_writer_add_audio/video的extra_data参数要传入AudioSpecificConfig/AVCDecoderConfigurationRecord/HEVCDecoderConfigurationRecord结构的数据
fmp4_writer_write的data要求使用mp4 bitstream
from media-server.
查了下ffmpeg读fmp4的代码,主要问题在于读trun box时timestamp值不对。
TRAF中如果有多个trun box,ffmpeg计算sample dts的方式发生了变化:
- 早期的版本(sha1: 4a9d32baca3af0d1831f9556a922c7ab5b426b10 2017/10/13 Johe Stebbins)之前dts会在前一个trun基础上累加。
- 之后的版本如果有tfdt,trun计算不会在前一个trun基础上累加,导致timestamp错误。这种计算方式可能是一个ffmpeg的bug。
解决方案:
- 每个traf只生成一个trun;
- traf中不生成tfdt;
from media-server.
AVCDecoderConfigurationRecord 用下边的数据合成的视频有问题,能帮忙看下吗 感谢
01 4D 40 15 FF E1 00 13 00 00 00 01 67 42 00 29 8D 8D 40 F0 28 D0 0F 08 84 53 80 01 00 08 00 00 00 01 68 CA 43 C8
m2.zip
from media-server.
AVCDecoderConfigurationRecord里的sps、pps不需要00 00 00 01起始码
from media-server.
我想以流形式输出fmp4, 不叠加缓存 ,下边的代码有问题,帮忙看看
#include "mov-buffer.h"
#include <stdio.h>
#if defined(_WIN32) || defined(_WIN64)
#define fseek64 _fseeki64
#define ftell64 _ftelli64
#else
#define fseek64 fseek
#define ftell64 ftell
#endif
#define N_SEGMENT (1 * 1024 * 1024)
#define FRAME_BUFFER_LEN 32
char file[100];
struct buffer {
uint8_t* ptr;
size_t bytes;
size_t capacity;
size_t offset;
size_t position;
int index;
};
const struct buffer* data_buffer(void)
{
static struct buffer buffer = {
NULL,
0,
0,
0,
0,
0,
};
return &buffer;
}
static int mov_data_read(void* fp, void* data, uint64_t bytes)
{
return -1;
}
static int mov_data_write(void* param, const void* data, uint64_t bytes)
{
void* ptr;
size_t capacity;
struct buffer* buf;
buf = (struct buffer*)param;
if (buf->offset + (size_t)bytes > buf->capacity)
{
capacity = buf->offset + (size_t)bytes + N_SEGMENT;
ptr = realloc(buf->ptr, capacity);
buf->ptr = (uint8_t*)ptr;
buf->capacity = capacity;
}
memcpy(buf->ptr + buf->offset, data, bytes);
buf->offset += (size_t)bytes;
if (buf->offset > buf->bytes) {
buf->bytes = buf->offset;
}
return 0;
//return bytes == fwrite(data, 1, bytes, (FILE*)fp) ? 0 : ferror((FILE*)fp);
}
static int mov_data_seek(void* param, uint64_t offset)
{
//return fseek64((FILE*)fp, offset, SEEK_SET);
struct buffer* buf;
buf = (struct buffer*)param;
buf->offset = (size_t)offset;
return 0;
//return -1;
}
static uint64_t mov_data_tell(void* param)
{
//return ftell64((FILE*)fp);
struct buffer* buf;
buf = (struct buffer*)param;
if (buf->index < 10) {
buf->index++;
sprintf(file, "D://developer//temp//temp//temp%d", buf->index);
FILE* fpFile = fopen(file, "wb+");
fwrite(buf->ptr, 1, buf->offset, fpFile);
fclose(fpFile);
}
buf->offset = 0;
buf->bytes -= buf->offset;
return buf->offset;
//return 0;
}
const struct mov_buffer_t* mov_data_buffer(void)
{
static struct mov_buffer_t s_io = {
mov_data_read,
mov_data_write,
mov_data_seek,
mov_data_tell,
};
return &s_io;
}
from media-server.
写内存可以参考libdash\src\dash-mpd.c
from media-server.
Related Issues (20)
- RTSP Example播放Camera失败 HOT 1
- rtp库支持dtmf吗 HOT 1
- h264+g711a封装为mpeg-ps HOT 1
- CMAF support HOT 2
- 使用本库文件接收摄像头H265视频流报错问题的咨询。 HOT 2
- 有mjpeg->ts的例子吗
- 264转mp4 ,使用mov_writer-h264.cpp中的代码,mp4文件vlc不能播放,能帮忙看下吗?附件有生成的mp4文件,这种现象有的可以,有的不行。 HOT 6
- librtsp/source/sdp.c 获取 IP 地址错误 HOT 1
- s_max_packet_size为什么不取大于1500的长度 HOT 4
- H264+G711a封装TS,播放没有音频 HOT 2
- 视频TS复合成功,咨询音视频的TS复合和同步问题,感谢 HOT 2
- This vulnerability is a UAF (Use-After-Free) vulnerability discovered in the file /media-server/libsip/src/uac/sip-uac-subscribe.c HOT 2
- 265 打包成ts 流长时间后ts流不能被识别 HOT 4
- h265码流封装ps格式花屏 HOT 2
- flv支持seek操作 HOT 2
- 大文件probe时间较长,如何优化 HOT 5
- 编译media-server的test时提示undefined reference to `network_getip' HOT 1
- sdp解析异常r行报文存在死循环 HOT 3
- 遇到一个特殊码流,音频codecid会变,当前通知只根据数量通知,码流格式变化的时候能否通知出来
- 遇到一个特殊码流,音频codecid会变,当前通知只根据数量通知,码流格式变化的时候能否通知出来, 可复现的ps流如下 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media-server.