Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Extracting frames with ffmpeg - why are they three dimensions ?
21 novembre 2012, par user1843277I have been using ffmpeg as an extremely useful tool in video processing for my research. One problem I have run into: when extracting frames from a video to a Tiff format, it saves each Tiff with three dimensions instead of the expected two (width x height of video frames).
When reading this into my IDL code, of course it balks at a Tiff image being a three dimensional array. The third dimension has a size of three, I think because I did my extraction at a framerate of 3 Hz (?). Does anybody know why ffmpeg doesn't create a simple Tiff image of two dimensions? Is there a way to force that?
-
ffmpeg memory increase
21 novembre 2012, par SpamdarkWell, I'm working with ffmpeg, When I execute it, it runs a video example, well, the memory start to increase, a simple small video takes 800MB in RAM, meanwhile Windows Media Player just takes 50MB for run that file, I don't know what's happening, here is the loop, the problems comes from here (I think...)
while(av_read_frame(formatContext,&framepacket)>= 0){ pausecontrol.lock(); if(framepacket.stream_index==gotVideoCodec){ int framereaded; avcodec_decode_video2(videoCodecContext,videoFrame,&framereaded,&framepacket); if(framereaded){ struct SwsContext *ctx = sws_getContext(videoCodecContext->width, videoCodecContext->height, videoCodecContext->pix_fmt, showinWidget->width(), showinWidget->height(), PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL); sws_scale(ctx,videoFrame->data,videoFrame->linesize,0,videoCodecContext->height,videoFrame->data,videoFrame->linesize); memset(&framecapsule,0,sizeof(QImage)); framecapsule=QImage(showinWidget->width(),showinWidget->height(),QImage::Format_RGB888); for(int y=0;yheight();y++){ memcpy(framecapsule.scanLine(y),videoFrame->data[0]+y*videoFrame->linesize[0],showinWidget->width()*3); } emit newFrameReady(); } } if(framepacket.stream_index==gotAudioCodec){ // Audio? Ok } pausecontrol.unlock(); av_free_packet(&framepacket); }
Oh, I'm using QT too, but the converstion between AVFrame-QImage it's not the problem.
-
How to create thumbnails of the video with ffmpeg on Android ?
21 novembre 2012, par RankoRAre there any ready-to-use libraries for thumbnails creation for formats which are not supported out-of-box by Android?
-
FFMPEG : Stream a file with original playing rate
21 novembre 2012, par sajadI want to stream a file to the network using ffmpeg in it's original frame rate; so I can play the generated UDP stream using some receiver client such as VLC. I used this command:
ffmpeg -i "myfile.mpg" -sameq -re -f mpegts "udp://127.0.0.1:2000"
By using this command the ffmpeg starts streaming the file in a very high rate; such that streaming of a file that has about 30 minutes length, is finished after just about 40 secs. I want to see the file in original rate. Also I want to have control on rate of video to play it faster or slower. Is there any options to do this? thank you.
-
FFMPEG - convert files while being recorded
21 novembre 2012, par mmmkI'm currently trying to stream a live video. I'm equipped with CCTV camera and a generic microphone. I'm using newest FFMPEG 1.0 (compiled from sources). Unfortunately, my camera provides only video stream, so I have to join it with audio manually. Here's my code:
#!/bin/bash # record mic input to wav file arecord -f dat -D hw:0,0 mic.wav & # record camera stream to avi file cvlc rtsp://192.168.0.11:554/VideoInput/1/h264/1 --sout "#standard{access=file,mux=avi,dst=camera.avi}" & # wait few seconds for both sources to stabilize sleep 5 # join avi and wav to one flv file, then stram it to tcp socket (which is received by crtmpserver and transmitted forward to the website) ffmpeg -i camera.avi -vcodec flv -i mic.wav -acodec mp3 -s 1280x720 -ar 44100 -ab 192k -vb 3000k -f flv - | ffmpeg -re -i - -codec copy -metadata streamName=streamhd tcp://127.0.0.1:6666 &
This code works and stream is being received for less than 5 seconds. If I increase sleep time, playback lasts longer. FFMPEG seems to convert only as much data as it receives in the beginning.
How to force further conversion?
I've tried named pipes. FFMPEG can't recognize input format then.