libavcodec

What does “copy” do in a ffmpeg command line?

一笑奈何 提交于 2021-02-17 20:33:07
问题 I know that it copies something but other than that what does it do (to what extend it affects the output file)? Is it a switch or option? Why does it not have a hyphen before the word itself? I see from other questions that it can copy streams without transcode but what are other possibility that I can manipulate it? I have done ffmpeg --help but I don't see any documentation about it. Is there a website I can read more about it? 回答1: copy is neither a switch nor an option. It's the value

Why does avcodec_fill_audio_frame return -22 when only sample count is different?

主宰稳场 提交于 2021-02-10 14:19:44
问题 My problem is very fast to explain: I have to encode audio samples using FFmpeg (raw PCM to G.711 mu-law). This is the guilty part of my code (I put raw parameters in this example to be explicit): AVFrame* frame = av_frame_alloc(); frame->nb_samples = 8000; frame->format = AV_SAMPLE_FMT_S16; frame->channels = 1; frame->channel_layout = AV_CH_LAYOUT_MONO; frame->sample_rate = 8000; frame->quality = 1; int res = avcodec_fill_audio_frame(frame, 1, AV_SAMPLE_FMT_S16, /*my samples data*/, 16000, 0

Cannot Play Video Output of Libavcodec (ffmpeg) Encoding Example

独自空忆成欢 提交于 2021-01-29 08:40:34
问题 From FFMPEG's GitHub, I use the encode_video.c to generate a 1 second video. Here is the example in question: https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/encode_video.c I compile with: gcc -Wall -o ffencode encode_video.c -lavcodec -lavutil -lz -lm Clean compile, zero warnings. I test the program by running: ./ffencode video.mp4 libx264 Lots of stats printed out (expected based on source code) as well as ffmpeg logs, but ultimately no errors or warnings. However, then the

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:

How can I determine if a codec / container combination is compatible with FFmpeg?

我的梦境 提交于 2020-12-26 04:04:48
问题 I'm looking at re-muxing some containers holding audio and video such that I extract the best, first audio stream, and store it in a new container where e.g. only the audio stream is present. The output context for FFmpeg is created like so: AVFormatContext* output_context = NULL; avformat_alloc_output_context2( &output_context, NULL, "mp4", NULL ); I have a shortlist of acceptable outputs, e.g. MP4, M4A, etc … essentially those that are readable by Apple's Audio File Services: