Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
ffmpeg : recommended bitrate vs resolution [duplicate]
15 octobre 2016, par Santhosh YedidiThis question already has an answer here:
- FFMPEG sensible defaults 2 answers
I have high resolution video
Duration: 00:06:28.80, start: 0.000000, bitrate: 15968 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 15809 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default) Metadata: creation_time : 2016-10-11 05:35:02 handler_name : Alias Data Handler encoder : AVC Coding Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 157 kb/s (default) Metadata: creation_time : 2016-10-11 05:35:02 handler_name : Alias Data Handler
Its 6+min video.
I am ok with resolution of 240p (because i want to send it on whatsapp)
In order my video to look good quality what is the recommended bitrate for 240p. Also is what is the minimum bitrate below which the chances of pixelating will be there in the video.
I dont want to go for high bitrate also. Because ultimately i want the size to be not more than 240p.
I use mpv to see the video. I scale the original video to 240p, the quality after conversion should match the quality visible in mpv. That will give me first hand idea of how good is the conversion.
I expect a good amount of reduction in size(MB : where original is 740mb) of the file when reduced from 1920x1080 to 240p
I have found some information regarding this.
How much is this true
-
how to add reference movie into ffmpeg psnr filter in codes (computing psnr)
15 octobre 2016, par user1317278I just want to find out how to use the psnr filter in ffmpeg in codes.
I have followed the codes stated in https://ffmpeg.org/ffmpeg-filters.html#psnr:
sprintf(args, "movie=ref_movie.avi [main];[main][ref] psnr=\"stats_file=stats.log\" [out]"); err = avfilter_graph_create_filter(&psnrCtx, psnrFilter, "psnr", args, NULL, m_filterGraph); if ( err < 0 ) { avfilter_graph_free(&m_filterGraph); m_filterGraph = NULL; return false; }
But the error message return to me:
Option 'movie' not found
I also try this:
sprintf(args, "stats_file=stats.log"); err = avfilter_graph_create_filter(&psnrCtx, psnrFilter, "psnr", args, NULL, m_filterGraph); if ( err < 0 ) { avfilter_graph_free(&m_filterGraph); m_filterGraph = NULL; return false; } err = avfilter_link(last_ctx, 0, psnrCtx, 0); if ( err < 0 ) { avfilter_graph_free(&m_filterGraph); m_filterGraph = NULL; return false;} ... err = avfilter_graph_config(m_filterGraph, NULL); if ( err < 0 ) { avfilter_graph_free(&m_filterGraph); m_filterGraph = NULL; return false; }
but the error message return to me:
Input pad "reference" with type video of the filter instance "psnr" of psnr not connected to any source
I search psnr filter in codes but there is not much information about it. Can anyone help on this?
-
Inconsistant rendering in mlt XML and C interface and 'hold' producer and avformat consumer
14 octobre 2016, par Leif AndersenI am trying to create a short video that is just a single image. (I know its a bit silly, but its a test for something bigger).
The code I have for rendering it is:
#include
mlt.h> #include #include int main() { if(mlt_factory_init(NULL)) { mlt_profile p = mlt_profile_init(NULL); mlt_consumer target = mlt_factory_consumer(p, "avformat", mlt_producer source = mlt_factory_producer(p, "hold", "/Users/leif/logo.png"); mlt_producer_set_in_and_out(source, 0, 10); mlt_consumer_connect(target, mlt_producer_service(source)); mlt_consumer_start(target); sleep(5); mlt_consumer_stop(target); mlt_consumer_close(target); mlt_producer_close(source); mlt_factory_close(); } else { printf("No\n"); } return 0; } Where
logo.png
is this file.When I run this code and play
output.mp4
, the picture comes out all garbelled. There is a green line in the middle and the logo is superimposed on itself a lot.On the other hand, if I change the consumer to be SDL, the image plays just fine.
And finally, if I change the consumer to be XML, and then use the melt command line application to render it:
melt -consumer avformat:xmlout.mp4 output.xml
and play the video, it also plays fine.
Is there something I am missing in the avformat consumer that I should be setting? Or something else that I am missing here?
Edit: For reference, the outputted xml file:
output.xml
is:<?xml version="1.0" encoding="utf-8"?>
15000 pause /Users/leif/logo.png 1.06667 0 onefield hold 1 -
Setting EBP data via FFMPEG
14 octobre 2016, par user2475310With FFMPEG can we insert EBP data on certain frames? If so what is the command?
We have IDR frames that must have EPB data.
-
Merging RGB Channels in FFMPEG [migrated]
14 octobre 2016, par DraconisI have three grayscale videos, representing the red, green, and blue channels from a video. I extracted them using the
extractplanes
filter, and sent them through different pipelines.Now I would like to combine them again. But while
extractplanes
is working perfectly,mergeplanes
is not. My initial attempt was this:[r][g][b] mergeplanes=0x001020 [output]
This interprets my RGB channels as YUV, which is not what I want. My next attempt was this:
[r][g][b] mergeplanes=0x001020:rgb24 [output]
But according to the error message,
Only planar formats with more than one component are supported.
(Same for all other RGB and RGBA pixel formats I tried.)Is there another way to put these channels back together? Or some way to convince
mergeplanes
to output RGB?