Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Convert from NV12 to RGB/YUV420P using libswscale
29 août 2017, par Ruben Sanchez CastellanoI'm developing an application which needs to transform NV12 frames from h264_cuvid decoder to RGB in order to modify those frames. I checked this question but I don't not the 'Stride' value.
My code is the following:
uint8_t *inData[2] = { videoFrame->data[0], videoFrame->data[0] + videoFrame->width * videoFrame->height }; int inLinesize[2] = { videoFrame->width, videoFrame->width }; sws_scale(convert_yuv_to_rgb, inData, inLinesize, 0, videoFrame->height, aux_frame->data, aux_frame->linesize);
But it does not work. Although the problem is on colours because I can see the luminance plane correctly.
-
How the ffmpeg astats crest factor value of an audio track is calculated
29 août 2017, par FranGarI'm scripting a ffmpeg chain process for my work. The aim is normalizing/compressing lot of audio files (mp3's). It's done in Python and the critical part is the line:
ffmpeg -y -i "Input.mp3" -codec:a libmp3lame -b:a 96k -af acompressor=threshold=-15dB:ratio=5:attack=0.01:release=1000:knee=2,dynaudnorm=g=3:m=2:p=0.95 "Output.mp3"
The python script it's complete and working BUT the nature of the audios (voice recordings) are very different so I can't use the same params for all of them.
I make some experimenting with the values of the ffmpeg filter astats and i discovered that the crest factor (Standard ratio of peak to RMS level ) gave a good reference to programatically get the better params.
In fact I saw that a recording with a nice dynamic range sound and smooth in shape, get crest values around 9-15 (the compress/normlz params will be somehow conservative). But audios with crest around 22-30 need more aggressive processing. (All empirically)
Somebody can clarify how the crest values are really calculated? Which are the peaks taken to account? (Why the flat factor is always 0?) Or if somebody knows how to get a value representing the sound 'smoothness' will be nice also.
Thanks for the ideas.
-
capture attribute to show the camera directly
29 août 2017, par PKnightI would expect specifying the capture attribute to show the camera directly, rather than having to navigate through the dialog boxes above. I want the camera to go directly and I can record a video.
I tried in several ways, but none worked. It's always shows the dialog box to choose a camera. Can anybody help me ? Thank you
-
I need to get PIDS from a sample MPEG-TS file
29 août 2017, par Sai Raghuram KaligotlaI need to get PIDS from a sample MPEG-TS file,I have tried by reading the file using
fopen()
and got the data in hex format. Now I am stuck in finding the PID bytes in the whole data. Can anyone help me out?I have used the below code:
#include #include void main() { FILE *myfile; FILE *output; int i=0,j; unsigned int buffer; int o; myfile=fopen("screen.ts","rb"); output = fopen("output2.txt","w"); do{ o=fread(&buffer, 2, 1, myfile); if(o!=1) break; printf("%d: ",i); printf("%x\n",buffer); fprintf(output,"%x ",buffer); i++; }while(1); }
I got the data from the file, now I need to locate the "PID" bytes in the data.
-
Unrecognized option 'hls_segment_size'
29 août 2017, par Saeed RahimimaneshI am using CentOS and I want to convert mp4 to HLS(m3u8 files). I got this error : Unrecognized option 'hls_segment_size' , when I want to execute this command :
ffmpeg -i testffm.mp4 -b:v 1M -g 60 -hls_time 2 -hls_list_size 0 -hls_segment_size 500000 exist.m3u8
what can I do? I need to define hls_segment_size...