Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
ffmpeg record from live m3u8 link and update it with new recording
22 novembre 2016, par yopojai try to record 59 minutes of live m3u8.
ffmpeg -i 111.111.11.11/live.m3u8 -t 3540 -c copy -y -hls_playlist_type vod MyVideo.m3u8
so for some reasons sometimes network down and ffmpeg stops, so if i start it again ffmpeg will clear all recorded and will start recording again, is there a way to add new recording after the one i recorded before
-
Using libavformat to mux H.264 frames into RTP
22 novembre 2016, par DanielB6I have an encoder that produces a series of H.264 I-frames and P-frames. I'm trying to use libavformat to mux and transmit these frames over RTP, but I'm stuck.
My program sends RTP data, but the RTP timestamp increments by 1 each successive frame, instead of 90000/fps. It also doesn't look like it's doing the proper framing for H.264 NAL, since I can't decode the stream as H.264 in Wireshark.
I suspect that I'm not setting up the codec information properly, but it appears in many places in the output format context, so it's unclear what exactly needs to be setup. The examples seem to all copy codec context info from encoders, which isn't my use case.
This is what I'm trying:
int main() { AVFormatContext context = avformat_alloc_context(); if (!context) { printf("avformat_alloc_context failed\n"); return; } AVOutputFormat *format = av_guess_format("rtp", NULL, NULL); if (!format) { printf("av_guess_format failed\n"); return; } context->oformat = format; snprintf(context->filename, sizeof(context->filename), "rtp://%s:%d", "192.168.2.16", 10000); if (avio_open(&(context->pb), context->filename, AVIO_FLAG_READ_WRITE) < 0) { printf("avio_open failed\n"); return; } stream = avformat_new_stream(context, NULL); if (!stream) { printf("avformat_new_stream failed\n"); return; } stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; stream->codecpar->codec_id = AV_CODEC_ID_H264; stream->codecpar->width = 1920; stream->codecpar->height = 1080; avformat_write_header(context, NULL); ... write packets ... }
Example write packet:
int write_packet(uint8_t *data, int size) { AVPacket p; av_init_packet(&p); p.data = buffer; p.size = size; p.stream_index = stream->index; av_interleaved_write_frame(context, &p); }
I've even went so far to build in libx264, find the encoder, and copy the codec context info from there into the stream codecpar, with the same result. My goal is to build without libx264, and any other libs that aren't required, but it isn't clear whether libx264 is required for defaults such as time base.
How can the libavformat RTP muxer be initialized to properly send H.264 frames over RTCP+RTP?
-
Installing FFmpeg in ubuntu server which file to run for installing ffmpeg from downloaded package [duplicate]
22 novembre 2016, par A SahraThis question is an exact duplicate of:
- How to install ffmpeg for PHP 1 answer
I have downloaded ffmpeg from http://ffmpeg.org to manipulate multimedia data using php codeigniter and i have got a package with bunch of libraries inside. I want to run the ffmpeg in ubuntu server but i don't know which file (.exec file) to run from that package.please anyone who could help me figure out which file to Execute to use ffmpeg.
-
php ffmpeg convertion to webm not working
22 novembre 2016, par apprenticei'm trying to convert video files to html5 formats.
it works for mp4 and ogg but not for webm.
no error shows up and also no output file
this is the code
exec('ffmpeg -i "upload/video.mpeg" -b 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 "OUTPUTFILE.mp4"'); exec('ffmpeg -i "upload/video.mpeg" -b 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 "OUTPUTFILE.webm"'); exec('ffmpeg -i "upload/video.mpeg" -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis trailer.webm'); exec('ffmpeg -i "upload/video.mpeg" -b 1500k -vcodec libtheora -acodec libvorbis -ab 160000 -g 30 "OUTPUTFILE.ogv"');
-
Creating FairPlay Streaming (FPS) streams without using mediafilesegmenter
22 novembre 2016, par LarryIn the past, I have done encrypted HLS using a combination of ffmpeg and openssl, but not FPS (yet).
I'm sure this is possible, but I haven't found a way to do it yet and I'm wondering if anyone has done it and would be willing to share how.