ffmpeg

Setting a timeout for av_read_frame

末鹿安然 提交于 2021-01-29 03:09:14
问题 I am new to FFMPEG and was trying to do HLS streaming using FFMPEG. When i tried using the function "av_read_frame" it returns a negative value whenever data is not available. Is there some method to make this function wait till some data is received or to make this function wait till a timeout is reached? 回答1: No, there really isn't. If you look at the simple player ffplay.c which comes with FFmpeg, the read_thread function basically loops on av_read_frame until it returns a non-negative

Creating a sequence of images from lyrics to use in ffmpeg

ぃ、小莉子 提交于 2021-01-29 02:21:27
问题 I'm trying to make an MP3 + Lyric -> MP4 program in python. I have a lyrics file like this: [00:00.60]Revelation, chapter 4 [00:02.34]After these things I looked, [00:04.10]and behold a door was opened in heaven, [00:06.41]and the first voice which I heard, as it were, [00:08.78]of a trumpet speaking with me, said: [00:11.09]Come up hither, [00:12.16]and I will shew thee the things which must be done hereafter. [00:15.78]And immediately I was in the spirit: [00:18.03]and behold there was a

how to run “3gp, FLV, avi” video format in AVPLAYER or MPMoviePlayerViewController in iOS?

僤鯓⒐⒋嵵緔 提交于 2021-01-28 23:51:01
问题 I need to play 3gp, FLV, avi Video file format in my application. I had searched lot about it. Got some library like "FFmpeg" Library. But could not find any sample code for it. Any other ways for it are also appreciated. Does any body have done it before? I am even not sure that if it is possible or not in iOS. Please give me solution for it. UPDATE : I tried one 3gp Video in my AVquePlaye but it is not play in my code, While i use same Video in WhatsApp in my iPhone , Surprisingly video is

Visualizing ffmpeg benchmarks

孤人 提交于 2021-01-28 23:38:54
问题 I have generated benchmarks for comparing two approaches taken for scaling down video files (mp4) using ffmpeg tool. The benchmarks are logged in this format : x.mp4 Output_Resolution : 360p Method : A real 0m26.817s user 1m38.058s sys 0m0.504s Method : B, some-parameter-for-B : b1 real 0m26.465s user 1m42.824s sys 0m1.111s Method : B, some-parameter-for-B : b2 real 0m26.236s user 1m42.194s sys 0m0.862s Method : B, some-parameter-for-B : b3 real 0m25.050s user 1m36.492s sys 0m0.680s y.mp4

libswresample: swr_convert() not producing enough samples

瘦欲@ 提交于 2021-01-28 22:28:35
问题 I'm trying to use ffmpeg/libswresample to resample streaming audio in my c++ application. Changing the sample width works well and the result sounds as one would expect; however, when changing the sample rate the result is somewhat crackly. I am unsure if it is due to incorrect usage of the libswresample library, or if I'm misunderstanding the resampling theory. Here is my resampling process, simplified for demonstration's sake: //Externally supplied data const uint8_t* in_samples //contains

FFMPEG Streaming to twitch low bitrate

怎甘沉沦 提交于 2021-01-28 19:21:47
问题 I have a python script that will produce frames for a video stream. To stream it to twitch I decided to use ffmpeg (as it is the only option I found). However, the bitrate of my stream is very low (70 KB), although in ffmpeg options it's set to 3000K. # This script copies the video frame by frame import cv2 import subprocess as sp twitch_stream_key = 'MY_TWITCH_STREAM_KEY' input_file = 'video.mp4' cap = cv2.VideoCapture(input_file) ret, frame = cap.read() height, width, ch = frame.shape

FFMPEG Streaming to twitch low bitrate

十年热恋 提交于 2021-01-28 18:49:22
问题 I have a python script that will produce frames for a video stream. To stream it to twitch I decided to use ffmpeg (as it is the only option I found). However, the bitrate of my stream is very low (70 KB), although in ffmpeg options it's set to 3000K. # This script copies the video frame by frame import cv2 import subprocess as sp twitch_stream_key = 'MY_TWITCH_STREAM_KEY' input_file = 'video.mp4' cap = cv2.VideoCapture(input_file) ret, frame = cap.read() height, width, ch = frame.shape

How can I know a certain file is a video file?

可紊 提交于 2021-01-28 12:09:26
问题 I am trying to figure out if a certain user-uploaded file is a video file. I first tried ffprobe, # a png file Input #0, png_pipe, from '<file>': Duration: N/A, bitrate: N/A Stream #0:0: Video: png, rgba(pc), 920x2094 [SAR 4724:4724 DAR 460:1047], 25 tbr, 25 tbn, 25 tbc # a text file Input #0, tty, from '<file>': Duration: 00:00:00.24, bitrate: 40 kb/s Stream #0:0: Video: ansi, pal8, 640x400, 25 fps, 25 tbr, 25 tbn, 25 tbc # a video file Input #0, matroska,webm, from '<file>': Metadata:

FFMPEG - Get creation and/or modification date

巧了我就是萌 提交于 2021-01-28 12:04:50
问题 I'm trying hard to get the modification date from a MP4 file hosted on my server. I tried the following library: ffmpeg -i video.mp4 Without any luck. All I get is duration and a few other fields but I'm not able to get modification date. I tried ffprobe as well and it is not there either. Any suggestions?? Thanks a lot 回答1: I checked for you, and indeed, mp4 has a modification time entry in the MDHD, but it's not exported (see code). You can file an enhancement request to get this metadata

Rails ActionController::Live - Sends everything at once instead of async

假装没事ソ 提交于 2021-01-28 11:56:37
问题 I have an issue with rails ActionController::Live In the end I want to show the progress of FFMPEG to the user, but for now I want to get this minimal example running: Rails media_controller.rb: class MediaController < ApplicationController include ActionController::Live def stream puts "stream function loaded" response.headers['Content-Type'] = 'text/event-stream' i = 0 begin response.stream.write "data: 1\n\n" sleep 0.5 i += 1 puts "response... data: " + i.to_s end while i < 10 response