ios – FFmpeg support CocoaPods?

Our project linked the FFmpeg. I want to make a pod repo with FFMPEG. I can input with pod ‘FFmpeg’. it will be easy for member to integrate.

<1> I used the command:pod lib create FFmpeg

<2>then drag the source code here

<3> write the podspec as below


Pod::Spec.new do |s|
  s.name             = 'FFmpeg'
  s.version          = '0.1.0'
  s.summary          = 'A short description of FFmpeg.'
 
  s.homepage         = 'https://github.com/cherishandjay/FFmpeg'
   s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'cherishandjay' => 'jingya.lu-a1079@aqara.com' }
  s.source           = { :git => 'https://github.com/cherishandjay/FFmpeg.git', :tag => s.version.to_s }
 
  s.ios.deployment_target = '9.0'

  s.source_files = 'FFmpeg/Classes/**/*.h'
  s.vendored_libraries = 'FFmpeg/Classes/**/*.a'

  s.public_header_files = 'Pod/Classes/**/*.h'
  s.frameworks = "AVFoundation", "CoreGraphics","VideoToolbox","AudioToolbox","CoreMedia"
  s.libraries = 'z','bz2','iconv'

end

<5> cd example and pod install. the source code is imported successsfully.show here

<6> I run the demo project. but it failure.show here

Showing All Errors Only
/Users/lumi/Desktop/companyCode/ffmpeg/FFmpeg/Example/Pods/Headers/Public/FFmpeg/avcodec.h:31:10: 'libavutil/samplefmt.h' file not found

<7> I check the search Path as this

I cd the diectory and find it right. what is wrong?

FFmpeg overlay video – Super User

I have a bg video (bg) and a main video (main).
If bg is shorter, i can loop overlay (bg)(main) to keep the length of main ok but bg will be loop = duplicated.

ffmpeg -y -i “{input}.” -filter_complex
“(0:v)scale=770:550(main);movie=bg.mp4:loop=999,setpts=N/(FRAME_RATE
TB),scale=1280:720(bg);(bg)(main)overlay=shortest=1:x=245:y=196″ -vcodec libx264 -ac 2 -bf 2 -pix_fmt yuv420p -shortest -acodec aac -b:a 128k -ar 44100 -preset superfast “{output}.mp4”

To avoid duplicated, I creat many bg which always longer than main. But if bg is longer, How I can use ffmpeg to overlay main over bg and keep length of output video same as main video.
For example, bg is 2 minutes, main is 1 minutes. Just overlay 1 minutes.

Sorry for my poor english then maybe describe problem not really clear.
Thank you.

ffmpeg – stagefright Player Android not play m3u8 ts file

I have a problem with android player (STAGEFRIGHT)
I play .TS file in android player perfectly. after I use this file in .m3u8, android player play only audio.(my TS file codec is H264);

after transcode TS file to H264 again with FFMPEG(libx264), m3u8 file play OK.

please help me!!

ffmpeg – resize video to fit into 16:9 with blurred background

I have random videos with bad aspect ratios e.g. recorded in portrait mode on a phone and I want a 16:9 video.

I found a similar a question Resizing videos with ffmpeg/avconv to fit into static sized player but I need the “Crop to fit” with applied blurr and then the “Pillarbox” on top of that.

I can do blurrs with ffmpeg with this:

ffmpeg -i video.mp4 -vf “boxblur=10:1” out.mp4

but I don’t know how to combine them to achieve my desired effect.

The end result should look like this: https://www.youtube.com/watch?v=pADoLZS3Z9Q&t=30s

Can anyone help please? :]

ubuntu – ffmpeg: correct syntax for multiple audio filters

I want to apply three audio filters: pan –> dynaudnorm –> volume.

The problem is that the middle filter (dynaudnorm) is ignored.

For testing, I’ve tried rearranging the filters, and no matter which filter is in the middle, it is ignored. I’ve also tried the ‘label’ syntax — ie, (in)filter=args(out) –and the same problem occurs: the middle filter is skipped.

What am I missing?

ffmpeg -i "infile.mkv" -c:a mp3 -filter_complex "pan=stereo|FL=0.5*FC+0.707*FL+0.707*BL+0.5*LFE|FR=0.5*FC+0.707*FR+0.707*BR+0.5*LFE(b), dynaudnorm=f=75:g=7; volume=0.5(2smash)" -map 0 -map (2smash) -metadata:s:a:(2smash) title="Low Dyn Range" -c:v copy "filtertest.mkv"

video – In what order should I use stabilization and compression with ffmpeg?

I shoot videos of soccer games on a Canon Vixia which records at 60fps HD with h264 compression. From the camera it results in 20GB files which I have been recompressing (to save on storage and increase upload speed) using h265 with a bitrate capped at 7000k and 60fps, which is high quality enough for my needs. I use the hevc_amf encoder with an AMD graphics card and that will recompress a 1h20m HD video in about 40m (2x), which I’m pretty happy with.

Recently, I’ve learned how to use vidstab which really cleans up my jiggly video pretty nicely. So now I would like to both stabilize with vidstab and recompress to h265 before archiving. I am looking for some recommendations on how to sequence the workflow in the most efficient manner while still getting good results. Should I 1) first do vidstab on my original 20G file (both the detect and transform passes)? Or, should I 2) recompress using the hardware accelerated hevc_amf encoder, before doing the stabilization?

  1. If the first option, a follow up question. I run the vidstabtransform as follows:
ffmpeg.exe -i input.mp4 -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 outputstabilized.mp4

This is according to the ffmpeg.org docs. It seems to change the bitrate from the original 30Mbps to about 10Mbps. Why is that? Can I control that and keep it at the original bitrate? Should I? (Also, do I need the unsharp mask? Is that because there’s some inherent zooming with the stabilization?).

Downside of this approach seems to be that you’d get better compression with h265 after stabilization given less movement in the pixels, but maybe it’s not a big difference.

  1. If the second option, can I still control the bitrate on the stabilization output?

If anyone has any other workflows they would recommend, I’d be all ears too. (I have thought about trying to use complex filtermaps but they seem… complex 🙂 and I haven’t invested the time to wrap my head around them).

Thanks in advance!

FFMPEG how to split iamge to separate parts?

FFMPEG how to split iamge to separate parts? – Super User

ffmpeg mediocre conversion quality from DVD

I am trying to convert a DVD that I own into mp4/lib265 format. To test the quality out I am only converting the first two minutes of the input video (which is a concatenated vob file). The source video is not particularly high resolution being a DVD it is 720x480

  • I tried 8/10/12 bit hevc
  • For a 720p video I usually go crf-22 and for 1080p crf-20 and usually happy with these values. This dvd is lower resolution than that, I tried going as low as crf-18
  • I use min-keyint and keyint parameters always, as I keep them very low to increase seeking performance. These being low enough should not decrease quality but I tried with even lower min-keyint just in case.

Problem: In the video whenever camera moves, I can see huge pixels across all details on screen. The camera movement is not even particularly fast. For example it moves from the belt level of the main character to face in approximately 2 seconds.

Question:
Can someone possibly point out what I am doing wrong or what else to do, to fix this. or may be some fine tuning parameters?

Command ran for testing:

ffmpeg ^
-i "ConCat2.vob" ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=20:min-keyint=5:keyint=50"  -preset slow -map 0:1 -map 0:2 "08 bit.crf20.ki05.mp4"  ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=20:min-keyint=5:keyint=50"  -preset slow -pix_fmt yuv420p10le -map 0:1 -map 0:2 "10 bit.crf20.ki05.mp4" ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=20:min-keyint=5:keyint=50"  -preset slow -pix_fmt yuv420p12le -map 0:1 -map 0:2 "12 bit.crf20.ki05.mp4" ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=20:min-keyint=25:keyint=50" -preset slow -map 0:1 -map 0:2 "08 bit.crf20.ki25.mp4" ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=20:min-keyint=25:keyint=50" -preset slow -pix_fmt yuv420p10le -map 0:1 -map 0:2 "10 bit.crf20.ki25.mp4" ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=20:min-keyint=25:keyint=50" -preset slow -pix_fmt yuv420p12le -map 0:1 -map 0:2 "12 bit.crf20.ki25.mp4" ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=18:min-keyint=25:keyint=50" -preset slow -map 0:1 -map 0:2 "08 bit.crf18.ki25.mp4" ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=18:min-keyint=25:keyint=50" -preset slow -pix_fmt yuv420p10le -map 0:1 -map 0:2 "10 bit.crf18.ki25.mp4" ^
-ss 00:00:00 -to 00:02:00 -c:v libx265 -c:a aac -x265-params  "crf=18:min-keyint=25:keyint=50" -preset slow -pix_fmt yuv420p12le -map 0:1 -map 0:2 "12 bit.crf18.ki25.mp4"

ffprobe for input:

ffprobe version 4.3.1-2020-10-01-full_build-www.gyan.dev Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 10.2.0 (Rev3, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, mpeg, from 'ConCat2.vob':
  Duration: 01:26:30.42, start: 0.300300, bitrate: 5891 kb/s
    Stream #0:0(0x1bf): Data: dvd_nav_packet
    Stream #0:1(0x1e0): Video: mpeg2video (Main), yuv420p(tv, smpte170m, bottom first), 720x480 (SAR 8:9 DAR 4:3), 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Side data:
      cpb: bitrate max/min/avg: 7500000/0/0 buffer size: 1835008 vbv_delay: N/A
    Stream #0:2(0x80): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s

ffmpeg encoding result summary screen:

x265 (info): frame I:     74, Avg QP:19.75  kb/s: 15050.33
x265 (info): frame P:    902, Avg QP:21.58  kb/s: 12471.95
x265 (info): frame B:   2621, Avg QP:26.88  kb/s: 3518.91
x265 (info): Weighted P-Frames: Y:6.5% UV:5.9%
x265 (info): consecutive B-frames: 3.7% 2.2% 39.7% 30.9% 23.6%

encoded 3597 frames in 3196.04s (1.13 fps), 6001.25 kb/s, Avg QP:25.41
(aac @ 000001a27fe3ccc0) Qavg: 314.316

x265 (info): frame I:     74, Avg QP:19.78  kb/s: 15170.72
x265 (info): frame P:    890, Avg QP:21.60  kb/s: 12635.53
x265 (info): frame B:   2633, Avg QP:26.82  kb/s: 3698.17
x265 (info): Weighted P-Frames: Y:8.4% UV:7.6%
x265 (info): consecutive B-frames: 3.7% 2.4% 35.9% 33.0% 25.0%

encoded 3597 frames in 3196.02s (1.13 fps), 6145.55 kb/s, Avg QP:25.38
(aac @ 000001a200728f80) Qavg: 314.316

x265 (info): frame I:     74, Avg QP:20.40  kb/s: 14358.58
x265 (info): frame P:    813, Avg QP:22.09  kb/s: 12347.13
x265 (info): frame B:   2710, Avg QP:26.81  kb/s: 3986.21
x265 (info): Weighted P-Frames: Y:14.5% UV:13.0%
x265 (info): consecutive B-frames: 1.1% 1.9% 20.0% 44.3% 32.7%

encoded 3597 frames in 3196.01s (1.13 fps), 6089.35 kb/s, Avg QP:25.61
(aac @ 000001a20072b880) Qavg: 314.316

x265 (info): frame I:     74, Avg QP:19.78  kb/s: 15063.06
x265 (info): frame P:    903, Avg QP:21.57  kb/s: 12490.80
x265 (info): frame B:   2620, Avg QP:26.88  kb/s: 3506.11
x265 (info): Weighted P-Frames: Y:6.4% UV:5.6%
x265 (info): consecutive B-frames: 2.9% 2.6% 40.9% 30.8% 22.8%

encoded 3597 frames in 3196.01s (1.13 fps), 5999.41 kb/s, Avg QP:25.40
(aac @ 000001a2005343c0) Qavg: 314.316

x265 (info): frame I:     74, Avg QP:19.81  kb/s: 15185.65
x265 (info): frame P:    888, Avg QP:21.59  kb/s: 12655.86
x265 (info): frame B:   2635, Avg QP:26.82  kb/s: 3687.45
x265 (info): Weighted P-Frames: Y:8.8% UV:7.8%
x265 (info): consecutive B-frames: 2.7% 2.4% 37.5% 33.1% 24.3%

encoded 3597 frames in 3196.01s (1.13 fps), 6138.05 kb/s, Avg QP:25.39
(aac @ 000001a200537a80) Qavg: 314.316

x265 (info): frame I:     74, Avg QP:20.41  kb/s: 14386.07
x265 (info): frame P:    815, Avg QP:22.09  kb/s: 12322.46
x265 (info): frame B:   2708, Avg QP:26.80  kb/s: 3988.57
x265 (info): Weighted P-Frames: Y:14.7% UV:13.1%
x265 (info): consecutive B-frames: 0.9% 1.2% 20.8% 46.5% 30.6%

encoded 3597 frames in 3196.02s (1.13 fps), 6090.74 kb/s, Avg QP:25.60
(aac @ 000001a200538cc0) Qavg: 314.316

x265 (info): frame I:     74, Avg QP:17.78  kb/s: 17517.32
x265 (info): frame P:    903, Avg QP:19.57  kb/s: 15024.90
x265 (info): frame B:   2620, Avg QP:24.80  kb/s: 4860.86
x265 (info): Weighted P-Frames: Y:6.4% UV:5.6%
x265 (info): consecutive B-frames: 2.9% 2.6% 40.9% 30.8% 22.8%

encoded 3597 frames in 3196.02s (1.13 fps), 7672.84 kb/s, Avg QP:23.34
(aac @ 000001a2005363c0) Qavg: 314.316

x265 (info): frame I:     74, Avg QP:17.81  kb/s: 17620.88
x265 (info): frame P:    888, Avg QP:19.59  kb/s: 15156.42
x265 (info): frame B:   2635, Avg QP:24.74  kb/s: 5070.71
x265 (info): Weighted P-Frames: Y:8.8% UV:7.8%
x265 (info): consecutive B-frames: 2.7% 2.4% 37.5% 33.1% 24.3%

encoded 3597 frames in 3196.02s (1.13 fps), 7818.79 kb/s, Avg QP:23.33
(aac @ 000001a20053b5c0) Qavg: 314.316

x265 (info): frame I:     74, Avg QP:18.41  kb/s: 16755.65
x265 (info): frame P:    815, Avg QP:20.09  kb/s: 14822.84
x265 (info): frame B:   2708, Avg QP:24.71  kb/s: 5464.50
x265 (info): Weighted P-Frames: Y:14.7% UV:13.1%
x265 (info): consecutive B-frames: 0.9% 1.2% 20.8% 46.5% 30.6%

encoded 3597 frames in 3196.02s (1.13 fps), 7817.18 kb/s, Avg QP:23.53
(aac @ 000001a2006cb940) Qavg: 314.316

terminal – Youtube-dl and ffmpeg – error (Javascript / shell script)

I’m using an automation platform called Soundflow, which uses custom javascript code to control various things with shortcut triggers – it’s highly recommended!

I have one script that makes use of youtube-dl as well as ffmpeg. (it downloads a youtube video, and then extracts the audio and converts it to wav).

When I run youtube-dl in Terminal, it runs fine, no problems.
Same with ffmpeg, I have installed it correctly and I’m able to use it in terminal.

However when I try to run a shell script from Soundflow, it is running the youtube-dl section initially, but then it gets stuck on the bit where it uses ffmpeg to do the video conversion (in this case it’s extracting the audio from a youtube video). I doubt it’s a Soundflow issue as I run other similar shell scripts fine (for example ffmpeg conversions).

I have installed both ffmpeg and youtube-dl via homebrew.

I’m wondering if the problem has something to do with my install location for either ffmpeg or youtube-dl; I don’t know how to edit this or change it, but I think the script may be missing where it expects ffmpeg to be.

Do you have any tips where it’s getting stuck?

This is the error I get in the log: ffprobe/avprobe and ffmpeg/avconv not found


const youtubeDL = '/opt/homebrew/bin/youtube-dl';
var url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';

log(`Download started`);

var execResult = sf.system.exec({
        commandLine: `"${youtubeDL}" "${url}" --extract-audio --audio-format wav`
    });

log (execResult)

if (execResult.exitCode !== 0) {
    throw `MP4 download failed with exit code: ${execResult.exitCode}`;
}

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123