Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Programmatically blend two frames using libavfilter
19 septembre 2013, par Alexander EromaI need to programmatically draw an image over the video frame when encoding video via libavcodec. (which is part of ffmpeg). As I understand I need to use libavfilter tools to do this.
I can access
AVFilter
viaavfilter_get_by_name("blend")
. Also I can access filter graph viaavfilter_graph_create_filter(&filterCtx, filter, "blender", NULL, NULL, fgr)
. But I can not understand what should I do next.I have two AV frames, for example:
AVFrame* bottomFrame; AVFrame* topFrame;
How can I put
topFrame
over thebottomFrame
using libav API?Thank you
-
ffmpeg+php Add Music to video
19 septembre 2013, par user2792392Dear Sir i create this code for simple video convert from one to another. i want to add more feature like
ffmpeg+php Add Music to videohow to do it?? convert request to begin encoding the video, and
status
request that retrieves * the current encoding status so the progress bar can be updated. * * The $outfile variable should be changed to an input value, but is set this way * for now for testing purposes. * * @ver 0.1 */ require 'config.php'; require 'functions.php';//<<-- CHECK FOR ERRORS -->>// $type = _chkVal('type', ''); $fkey = _chkVal('fkey', ''); $infile = _chkVal('filename', ''); $outfile = 'testing.mp4'; $params = _chkVal('params', ''); // Check Request Type $validTypes = array('convert', 'status'); if( !in_array($type, $validTypes) ) json_response(array('fkey' => $fkey, 'msg' => 'Invalid process type!'), true); // $fkey will always be 8 characters. // It's created with PHP's hash() function using 'crc32' algorithm in index.php if( strlen($fkey) != 8 ) json_response(array_merge(array('fkey' => '', 'msg' => 'Invalid fkey given!')), true); // Filename should be at least 5 (1 character + 4 character extension. EX : i.mp4) if( $type == 'convert' && ( strlen($infile) < 5) ) json_response(array('fkey' => $fkey, 'msg' => 'Invalid input filename given!'), true); // Filename should be at least 5 (1 character + 4 character extension. EX : i.mp4) if( $type == 'convert' && ( strlen($outfile) < 5) ) json_response(array('fkey' => $fkey, 'msg' => 'Invalid output filename given!'), true); if( $type == 'convert' && (strlen($params) < 1) ) json_response(array('fkey' => $fkey, 'msg' => 'Invalid parameters given!'), true); //<<-- END OF ERROR CHECK -->>// $ffmpegConvert = new ffmpegConvert($fkey); //<<-- PROCESS REQUEST -->>// // Start the video conversion if( $type == 'convert' ) { $ffmpegConvert->exec( $infile, $outfile, $params, $fkey ); // Add 2 second delay to give the server time to start writing the status log, // otherwise $ffmpegConvert->jsonStatus() will trigger an error... sleep(2); $ffmpegConvert->jsonStatus(); } // Check on video conversion progress if( $_POST['type'] == 'status' ) { $ffmpegConvert->jsonStatus(); } //<<-- END OF PROCESS REQUEST -->>// // Shouldn't get to this, but if so, let's send a message for debugging reasons.... json_response(array('msg' => 'Unhandled request type!'), true);
-
How to count video length and size in PHP ?
19 septembre 2013, par Learn PHPI want to get video details like length, size, frame, height and width from one video url.
I got the video details after download video using ffmpeg but unable to find the details of video from URL.
Here is my download video youtube link.
http://r4---sn-np4tjvg2-cvhe.c.youtube.com/videoplayback?fexp=927610%2C935016%2C941300%2C916626%2C936204%2C924606%2C929117%2C929121%2C929906%2C929907%2C929922%2C929923%2C929127%2C929129%2C929131%2C929930%2C936403%2C925724%2C925726%2C936310%2C925720%2C925722%2C925718%2C925714%2C929917%2C906945%2C929933%2C929935%2C920302%2C906842%2C913428%2C920605%2C919811%2C935020%2C935021%2C932309%2C913563%2C919373%2C930803%2C908536%2C932211%2C938701%2C931924%2C934005%2C940501%2C936308%2C909549%2C901608%2C900816%2C912711%2C934507%2C907231%2C936312%2C906001&itag=17&sver=3&expire=1379625974&sparams=algorithm%2Cburst%2Ccp%2Cfactor%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&mt=1379599833&mv=u&id=a1902c59b3e797d1&upn=rjoiIino7rU&factor=1.25&source=youtube&ms=au&algorithm=throttle-factor&burst=40&gcr=in&key=yt1&ip=202.191.214.174&cp=U0hWTlZNU19MTkNONl9OR1dKOlZGT2E1U2xXM0hN&ipbits=8&signature=CEE61FCB88931236269EE8661F62C1D834DCD32E.95869B5D4D79ED6D4D890749A49C228631CD3340
-
flv thumbnail using ffmpeg asp.net
19 septembre 2013, par MichaelI am trying to find a working sample on how to generate a thumbnail from a flv file using ffmpeg and asp.net & VB.net. I am uploading a pre-encoded flv so I do not have to generate the video file, just the thumbnail.
Anyone have any suggestions?
-
ffmpeg options for playing in iPad WebView with tag
19 septembre 2013, par Waynn LueI'm trying to convert a video to be played in a tag in a WebView in iOS. I've tried the options at this link but it still doesn't seem to play. I've found videos that do successfully play, though, so I'm sure it's possible, I just can't seem to get any working. Here's the ffmpeg -i output for something that works.
Here's what I tried from the wiki:
ffmpeg -i {filename} -acodec aac -ac 2 -strict experimental -ab 160k -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 {filename}.ipad.mp4
But the file doesn't play in the WebView.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.m4v': Metadata: major_brand : M4V minor_version : 1 compatible_brands: M4V M4A mp42isom creation_time : 2005-12-20 20:20:15 Duration: 00:01:25.50, start: 0.000000, bitrate: 209 kb/s Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 115 kb/s Metadata: creation_time : 2005-12-20 20:20:15 handler_name : Apple Sound Media Handler Stream #0:1(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 320x240, 90 kb/s, 10 fps, 10 tbr, 1k tbn, 2k tbc Metadata: creation_time : 2005-12-20 20:20:15 handler_name : Apple Video Media Handler
And here's the output for my input file:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cheerfulness.mov': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt creation_time : 2013-07-31 00:47:22 Duration: 00:00:06.00, start: 0.000000, bitrate: 120849 kb/s Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1200x1920, 120823 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc Metadata: creation_time : 2013-07-31 00:48:33 handler_name : Apple Alias Data Handler
edit: Here's the full output of the command:
wlue:$ ffmpeg -i cheerfulness.mov -acodec aac -ac 2 -strict experimental -ab 160k -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 output.ipad.mp4 ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers built on Sep 18 2013 18:44:15 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/1.2.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid libavutil 52. 18.100 / 52. 18.100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'cheerfulness.mov': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt creation_time : 2013-07-31 00:47:22 Duration: 00:00:06.01, start: 0.000000, bitrate: 120849 kb/s Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1200x1920, 120823 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 60k tbc Metadata: creation_time : 2013-07-31 00:48:33 handler_name : Apple Alias Data Handler Please use -b:a or -b:v, -b is ambiguous [libx264 @ 0x7fa67401fa00] frame MB size (75x120) > level limit (1620) [libx264 @ 0x7fa67401fa00] DPB size (5 frames, 17280000 bytes) > level limit (0 frames, 3110400 bytes) [libx264 @ 0x7fa67401fa00] MB rate (269730) > level limit (40500) [libx264 @ 0x7fa67401fa00] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX [libx264 @ 0x7fa67401fa00] profile Constrained Baseline, level 3.0 [libx264 @ 0x7fa67401fa00] 264 - core 125 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=1200 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=10000 vbv_bufsize=10000 nal_hrd=none ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'output.ipad.mp4': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt encoder : Lavf54.63.104 Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1200x1920, q=-1--1, 1200 kb/s, 30k tbn, 29.97 tbc Metadata: creation_time : 2013-07-31 00:48:33 handler_name : Apple Alias Data Handler Stream mapping: Stream #0:0 -> #0:0 (h264 -> libx264) Press [q] to stop, [?] for help frame= 180 fps= 16 q=-1.0 Lsize= 828kB time=00:00:06.00 bitrate=1129.2kbits/s video:826kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.177851% [libx264 @ 0x7fa67401fa00] frame I:2 Avg QP:32.23 size: 20942 [libx264 @ 0x7fa67401fa00] frame P:178 Avg QP:41.03 size: 4515 [libx264 @ 0x7fa67401fa00] mb I I16..4: 90.1% 0.0% 9.9% [libx264 @ 0x7fa67401fa00] mb P I16..4: 6.8% 0.0% 0.0% P16..4: 16.8% 0.6% 0.2% 0.0% 0.0% skip:75.5% [libx264 @ 0x7fa67401fa00] final ratefactor: 37.56 [libx264 @ 0x7fa67401fa00] coded y,uvDC,uvAC intra: 1.2% 16.4% 2.1% inter: 0.1% 3.4% 0.1% [libx264 @ 0x7fa67401fa00] i16 v,h,dc,p: 49% 23% 4% 24% [libx264 @ 0x7fa67401fa00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 8% 36% 8% 12% 9% 8% 4% 2% [libx264 @ 0x7fa67401fa00] i8c dc,h,v,p: 88% 6% 5% 1% [libx264 @ 0x7fa67401fa00] ref P L0: 47.7% 22.0% 16.7% 5.7% 7.9% [libx264 @ 0x7fa67401fa00] kb/s:1126.21