ffmpeg

How can I determine if a codec / container combination is compatible with FFmpeg?

我的梦境 提交于 2020-12-26 04:04:48
问题 I'm looking at re-muxing some containers holding audio and video such that I extract the best, first audio stream, and store it in a new container where e.g. only the audio stream is present. The output context for FFmpeg is created like so: AVFormatContext* output_context = NULL; avformat_alloc_output_context2( &output_context, NULL, "mp4", NULL ); I have a shortlist of acceptable outputs, e.g. MP4, M4A, etc … essentially those that are readable by Apple's Audio File Services:

How to cut from multiple input videos and concat to single video using ffmpeg?

眉间皱痕 提交于 2020-12-26 03:14:32
问题 I did something like this ffmpeg -i video1.mp4 -ss 00:01:00 -to 00:03:00 -i video2.mp4 -ss 00:05:00 -to 00:02:00 -c copy cut.mp4 Apparently muxing didnt happen. How can I make it work? 回答1: You have to tell ffmpeg that you want to concatenate each video and audio stream: ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex "[0:v]trim=start=60:end=180,setpts=PTS-STARTPTS[v0]; [0:a]atrim=start=60:end=180,asetpts=PTS-STARTPTS[a0]; [0:v]trim=start=300:end=420,setpts=PTS-STARTPTS[v1]; [0:a]atrim

How to cut from multiple input videos and concat to single video using ffmpeg?

谁都会走 提交于 2020-12-26 03:14:27
问题 I did something like this ffmpeg -i video1.mp4 -ss 00:01:00 -to 00:03:00 -i video2.mp4 -ss 00:05:00 -to 00:02:00 -c copy cut.mp4 Apparently muxing didnt happen. How can I make it work? 回答1: You have to tell ffmpeg that you want to concatenate each video and audio stream: ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex "[0:v]trim=start=60:end=180,setpts=PTS-STARTPTS[v0]; [0:a]atrim=start=60:end=180,asetpts=PTS-STARTPTS[a0]; [0:v]trim=start=300:end=420,setpts=PTS-STARTPTS[v1]; [0:a]atrim

How to cut from multiple input videos and concat to single video using ffmpeg?

蹲街弑〆低调 提交于 2020-12-26 03:13:45
问题 I did something like this ffmpeg -i video1.mp4 -ss 00:01:00 -to 00:03:00 -i video2.mp4 -ss 00:05:00 -to 00:02:00 -c copy cut.mp4 Apparently muxing didnt happen. How can I make it work? 回答1: You have to tell ffmpeg that you want to concatenate each video and audio stream: ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex "[0:v]trim=start=60:end=180,setpts=PTS-STARTPTS[v0]; [0:a]atrim=start=60:end=180,asetpts=PTS-STARTPTS[a0]; [0:v]trim=start=300:end=420,setpts=PTS-STARTPTS[v1]; [0:a]atrim

基于live555的rtsp播放器:开篇

笑着哭i 提交于 2020-12-23 14:26:48
很久没写博客了,今天准备开始接着写。 一直以来对音视频这块都比较感兴趣,从我博客中可以看出,很久之前就开始学习WebRTC,并且转发了一些流媒体的文章,但因为工作中主要是做Qt客户端开发的,音视频学习只能断断续续进行。今年由于年初疫情,隔离在家,时间比较充裕,于是又捡起了心中所好。 说起rtsp,自然会想到开源的跨平台流媒体框架live555。live555兼容的摄像机种类多,文档丰富,而且大名鼎鼎的VLC播放器中关于rtsp的推拉流使用的就是live555,因此决定撸起袖子从VLC源码看起....... 转眼间,一年就快过去了,基于live555的rtsp播放器也略有小成,支持Windows、Linux和Mac三个平台,先上几张图: 开发环境: Qt5.12.2+live555+ffmpeg4.3.1+SDL2.0.12+faac1.30+soundtouch2.2 主要功能: 1.支持多路视频显示 Windows和Linux支持Qt widget、SDL和Qt OpenGL三种方式渲染,Mac上支持Qt widget和Qt OpenGL两种方式渲染。SDL在Mac中嵌入Qt会有问题。 2.支持多种音视频编码格式 视频支持H264和H265,音频支持AAC、G711a、G711u和G726 3.支持抓图 使用ffmpeg编码视频数据为jpg格式并保存 4.支持录制

实战排查|为什么遮挡推流摄像头,会导致播放绿屏?

落爺英雄遲暮 提交于 2020-12-17 14:28:24
前言:做音视频的小伙伴们多少都遇到过奇怪的BUG(如:卡顿、花屏、绿屏、变声等),表象上矛盾点颇多,推理得出的结论都是:“不应该啊!”,最终你抽丝剥茧,发现真相只有一个:“事出反常必有妖”! 作者:安果,阿里云高级技术专家,从事阿里云 RTC 服务器研发 奇怪现象 背景:RTC 互动中增加对 RTMP 的支持,实现 RTC 与 RTMP 相互订阅。 遇到一个奇怪的 BUG,遮挡住 RTC 端的摄像头,有的 RTMP 播放端(iPad air 2,iPad mini 2/4)会偶发绿屏。 要不先发版? 初步分析问题后,我们认为这是:一个偶发的终端兼容性问题,有很大概率需要修改 RTC 端的编码来适配,耗时不好评估。 “距离发版本的时间不到 2 周,要不就先发版本吧?” 这个请求被产品无情的拒绝了(这次真的感谢你们的坚持),测试也反馈了新的情况:iPhone 6 也出现了绿屏,关闭 RTC 端的摄像头也可能绿屏,Mac 摄像头对着白色墙面也可能绿屏(测试的同学们也太能折腾了),同时确认了 RTMP 编码 RTMP 播放时相同场景不绿屏。 编码还是封装的坑? 疑难杂症先会诊,同编解码的同学一起讨论完后确认两个可能的点: 1.编码的 264 码流不兼容。 2.封装发送的 RTMP 数据不兼容。 我们制定了后续的排查方案: 1.录制 RTMP 编码和 RTC 编码的码流做对比。 2.使用

PyArcade (Pyglet) python3 Help needed

本小妞迷上赌 提交于 2020-12-15 07:13:26
问题 Python 3.8.1 using python-arcade and linux manjaro os This project is a multiplayer game built with python arcade I get these errors while running : class Client(arcade.Window): def __init__( self, width: int, height: int, title: str = 'Immortals' ) -> None: super().__init__(width, height, title=title) Traceback (most recent call last): File "/home/iddos/Documents/Github/Python/immortals/immortals/main.py", line 42, in <module> main(**config['resolution']) File "/home/iddos/Documents/Github

Overlay in ffmpeg with subtitle

青春壹個敷衍的年華 提交于 2020-12-15 06:38:07
问题 I am struck with overlaying image and subtitles in FFmpeg, above is the command ffmpeg -i bg.png -vcodec libvpx-vp9 -i test.webm -i test.png -y -filter_complex "[1:v]scale=1210:682[scale1];[scale1]rotate=0:c=black@0:ow=rotw(0):oh=roth(0)[rotate0];[0:v][rotate0]overlay=x=291.12:y=206.9[overlay0];[overlay0]subtitles=test.ass,overlay=x=291.12:y=206.9[textoverlay10];[2:v]scale=630:354[scale2];[scale2]rotate=0:c=black@0:ow=rotw(0):oh=roth(0)[rotate2];[textoverlay10][rotate2]overlay=x=737.13:y=50

Concatenating mka files but keeping timestamp

北慕城南 提交于 2020-12-15 05:24:08
问题 I am trying to mix a few files with FFMPEG that are mka and are from a Twilio Video Conference recording. I am trying to get tracks for each participant but I am trying to keep the overall timestamp from the file. Concrete example: i have these three files: 0PA1896e43f4ca0edf17d8dbfc0bab95a52.mka 1PA2a640f11bc13af2c29397800f058cb05.mka 2PA9fa5b32edc016f6f5b9669bb9b308d97.mka These files are all tracks of a participant in the call but joined at different times(left the meeting and re-entered,

Cannot convert .ogg file to .mp3 or other file formats

岁酱吖の 提交于 2020-12-15 04:40:05
问题 I am trying to convert ogg audio file to mp3 or other audio file formats that can be played in ios devices But ogg files are not being converted into other formats like mp3 and caf. I am testing the conversion in android device. This is my ffmpeg command arguments: Command: "ffmpeg -y -i $inputFilePath -c:a copy $outputFilePath" Both input and output filenames were surrounded with quotations [-y, -i, /data/user/0/com.musicapp/files/composer_audios/testtt ogg file.ogg, -c:a, copy, /storage