ffmpeg

streaming FLV to RTMP with FFMpeg using H264 codec and C++ API to flv.js

江枫思渺然 提交于 2021-02-06 10:13:39
问题 I would like to stream live video from webcam using OpenCV using H264 codec and converting that to FLV then stream over RTMP server and catch the stream in browser with flv.js. Basically I have everything working except that I cannot read stream in flv.js. I can open stream with ffplay so I think at least most of the things are set correctly. My current implementation: #include <iostream> #include <vector> #include <opencv2/highgui.hpp> #include <opencv2/video.hpp> extern "C" { #include

streaming FLV to RTMP with FFMpeg using H264 codec and C++ API to flv.js

此生再无相见时 提交于 2021-02-06 10:09:14
问题 I would like to stream live video from webcam using OpenCV using H264 codec and converting that to FLV then stream over RTMP server and catch the stream in browser with flv.js. Basically I have everything working except that I cannot read stream in flv.js. I can open stream with ffplay so I think at least most of the things are set correctly. My current implementation: #include <iostream> #include <vector> #include <opencv2/highgui.hpp> #include <opencv2/video.hpp> extern "C" { #include

Encoding H.264 CBR videos with FFmpeg

主宰稳场 提交于 2021-02-06 02:36:46
问题 I'm trying to encode a video with ffmpeg into H.264 (via the libx264 library) with a constant bit rate. I know, I know, VBR is often preferred, but for this specific job I'm required to use CBR (just as long as it's so many kilobytes per second; it doesn't have to be an exact kilobytes per frame, afaik). My sample video I'm using to test is from here: http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iTunes.mov.zip (it comes from http:/

Encoding H.264 CBR videos with FFmpeg

∥☆過路亽.° 提交于 2021-02-06 02:33:47
问题 I'm trying to encode a video with ffmpeg into H.264 (via the libx264 library) with a constant bit rate. I know, I know, VBR is often preferred, but for this specific job I'm required to use CBR (just as long as it's so many kilobytes per second; it doesn't have to be an exact kilobytes per frame, afaik). My sample video I'm using to test is from here: http://a1408.g.akamai.net/5/1408/1388/2005110403/1a1a1ad948be278cff2d96046ad90768d848b41947aa1986/sample_iTunes.mov.zip (it comes from http:/

Get video frames information with ffmpeg

五迷三道 提交于 2021-02-05 20:34:15
问题 How can I retrieve information from video about byte number from which every frame starts, with using ffmpeg or something else? 回答1: You can try ffprobe : $ ffprobe -show_frames input.mkv ... [FRAME] media_type=video key_frame=0 pkt_pts=3240 pkt_pts_time=3.240000 pkt_dts=N/A pkt_dts_time=N/A best_effort_timestamp=3240 best_effort_timestamp_time=3.240000 pkt_duration=40 pkt_duration_time=0.040000 pkt_pos=18009 pkt_size=480 width=320 height=240 pix_fmt=yuv444p sample_aspect_ratio=1:1 pict_type

ffmpeg is generating an out-of-sync audio/video file

天涯浪子 提交于 2021-02-05 20:29:29
问题 I am trying to convert a flv video to mp4 using a264 , but the result video has a out of sync audio/video. The audio seems ok but the video seems slow and therefore out of sync with the audio. Here is the command I am running: /opt/local/bin/ffmpeg -i complaint.flv -f mp4 -vcodec libx264 -acodec aac -copyts -strict experimental -fpre /opt/local/share/ffmpeg/libx264-lossless_slow.ffpreset -ab 44k -threads 0 -crf 23 complaint.mp4 And the output: Desktop /opt/local/bin/ffmpeg -i complaint.flv -f

ffmpeg - How to pass http headers?

空扰寡人 提交于 2021-02-05 13:16:07
问题 I need to pass http headers (user agent and ip) to an ffmpeg command. I use the following command: ffmpeg -y -timeout 5000000 -map 0:0 -an -sn -f md5 - -headers "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" -headers "X-Forwarded-For: 13.14.15.66" -i "http://127.0.0.1" And I run a local node.js server to see the headers I get: 'use strict'; var express = require('express'); var server = express(); server.all('/*',

ffmpeg - How to pass http headers?

只谈情不闲聊 提交于 2021-02-05 13:09:52
问题 I need to pass http headers (user agent and ip) to an ffmpeg command. I use the following command: ffmpeg -y -timeout 5000000 -map 0:0 -an -sn -f md5 - -headers "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" -headers "X-Forwarded-For: 13.14.15.66" -i "http://127.0.0.1" And I run a local node.js server to see the headers I get: 'use strict'; var express = require('express'); var server = express(); server.all('/*',

ffmpeg - How to pass http headers?

与世无争的帅哥 提交于 2021-02-05 13:09:41
问题 I need to pass http headers (user agent and ip) to an ffmpeg command. I use the following command: ffmpeg -y -timeout 5000000 -map 0:0 -an -sn -f md5 - -headers "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36" -headers "X-Forwarded-For: 13.14.15.66" -i "http://127.0.0.1" And I run a local node.js server to see the headers I get: 'use strict'; var express = require('express'); var server = express(); server.all('/*',

shell_exec echo'ing too fast or too late

北城以北 提交于 2021-02-05 11:57:27
问题 So I read throug this article: https://trac.ffmpeg.org/wiki/PHP and found this: <?php echo "Starting ffmpeg...\n\n"; echo shell_exec("ffmpeg -i input.avi output.avi >/dev/null 2>/dev/null &"); echo "Done.\n"; the code works almost perfectly fine, but the only thing that bothers me is, that because the shell_exec is being executed in the background (so there is no loading sign on the tab the whole time) all the echo's are being executed immediatly. This means, that the "Done" echo is being