logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: FFMPEG Windows Apache 64bit Limiting CPU Consumption Page Previous  1, 2, 3
Author
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Tue 13 Jan '15 15:52    Post subject: Reply with quote

Try convert it in ffmpeg it will most likely crash depending on what command line you use compared to me. I used it as a good way to fix my application to start marking information outputs as a single attempt since with ffmpeg the information output will never crash. And with a max attempt number of 5 when it hits 5 attempts if on the final attempt it does not work it marks it as failed.
Back to top
jimski



Joined: 18 Jan 2014
Posts: 196
Location: USSA

PostPosted: Tue 13 Jan '15 15:58    Post subject: Reply with quote

C0nw0nk wrote:
..i have never encounterd this though i have encounterd corrupt uploads that have caused some strange behavior but never ffmpeg crashes.

Jan-E wrote:

You are right that FFmpeg never crashes...


Guys, although the current version of ffmpeg doesn't crash there are many previous reports about bugs and crashes. And as with all open source projects one may be assured that if something works now it will most likely crash in the future .

https://trac.ffmpeg.org/ticket/488
http://unix.stackexchange.com/questions/177733/ffmpeg-way-to-check-the-pid-if-it-is-hanged-or-not
http://superuser.com/questions/250155/ffmpeg-hangs-when-creating-a-video

But apart from ffmpeg, if I'm implementing a job queue I may as well do in such a way that I can also process other task which may hang at any given time and thus tracking task PIDs and their behavior is critical.
Back to top
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Tue 13 Jan '15 16:04    Post subject: Reply with quote

Jimski use my soloution if a video is crashing your ffmpeg process like the one i shared it is most likely corrupt or not worth the hassle of trying to get to work.

https://www.apachelounge.com/viewtopic.php?p=29578#29578

To fix it since when ffmpeg crashes not much we can do to fix that but using "-i" we mark the information output of ffmpeg as a single attempt and we have a maximum number of attempts for me it is 5 and when you hit that 5 attempts mark it as failed. It is my soloution to a unique problem and from the file i shared it prooves it is for good reason that you should do things this way since information outputs will never crash. (Thats a fact)
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 13 Jan '15 16:42    Post subject: Reply with quote

C0nw0nk wrote:
Try convert it in ffmpeg it will most likely crash depending on what command line you use compared to me. I used it as a good way to fix my application to start marking information outputs as a single attempt since with ffmpeg the information output will never crash. And with a max attempt number of 5 when it hits 5 attempts if on the final attempt it does not work it marks it as failed.

My FFmpeg did not crash but reported a lot of errors and ended with 'conversion failed'. I did not try it with Zeranoe's FFmpegs, but with my own custom built one. That one has a few patches: https://github.com/Jan-E/MyMpeg
Back to top
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Tue 13 Jan '15 17:02    Post subject: Reply with quote

Thanks if you ever compile and start providing Windows ffmpeg builds like zeranoe let me know id be happy to test. Right now i just download Zeranoe's 64bit static builds and use those.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 13 Jan '15 17:50    Post subject: Reply with quote

FFmpeg 2.5.3 with my patches:
https://phpdev.toolsforresearch.com/ffmpeg64.zip
Back to top
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Tue 13 Jan '15 20:40    Post subject: Reply with quote

Jan-E wrote:
FFmpeg 2.5.3 with my patches:
https://phpdev.toolsforresearch.com/ffmpeg64.zip


Thanks Jan.

https://trac.ffmpeg.org/wiki/Encode/HighQualityAudio#Containerformats

I like the fact your builds come with libfdk_aac and libfaac unlike zeranoe's since it encodes audio into AAC format in MP4 videos i think i will try and see if IOS users can still hear sound with these two encoders if they can i will be putting your builds into production.

Also why do you disable allot of features and use certain prefix's and paths that are jan/sandbox ?

I recon libfaac is the best to be using since youtube also uses it instead of ffmpegs experimental aac encoder what i currently use.

http://en.wikipedia.org/wiki/FAAC
And it should be compatible and allow IOS users to hear sound of MP4 videos.
https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html#//apple_ref/doc/uid/TP40008332-CH102-SW8
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 13 Jan '15 22:48    Post subject: Reply with quote

The only things I disable are w32threads and doc. Doc because it installs the documentation and this takes too much space. And w32threads because pthreads is faster than w32threads. The last time I looked, Zeranoe disabled w32threads as well.

Sandbox: I initially copied the script from Roger Pack. See the readme at https://github.com/Jan-E/MyMpeg
Roger uses sandbox as well: the script installs everything (compilers like gcc and g++, many libraries and the resulting ffmpeg/ffprobe/ffplay.exes) in ~/sandbox. If you want to clean things afterwards: rm -rf ~/sandbox

Faac: I am using this because in my tests it was the fastest audio encoder. However, it makes ffmpeg.exe 'non free and non distributable'. You will not see updates by me.

See for instance http://oss.netfarm.it/mplayer-win32.php
Quote:
libfdk-aac encoder
libfdk-aac encoder is not included in MEncoder and FFmpeg package due to licensing problems, you should download separately libfdk-aac-x86-v0.1.3-13-g9a32340.7z or libfdk-aac-x86_64-v0.1.3-13-g9a32340.7z (for the 64bit version) and unpack the dll (with e.g. 7zip) in the directory in which the executable lies.

faac encoder
faac encoder is not included in MEncoder and FFmpeg package due to licensing problems, you should download separately libfaac-1.28.7z or libfaac-1.28-x64.7z (for the 64bit version) and unpack the dll (with e.g. 7zip) in the directory in which the executable lies (as shown in the picture).

Edit: If you want updates, grab a Ubuntu system or virtualbox, git clone Roger Pack's or my repo and build it yourself. Update every once in a while by using a 'git pull'.
Back to top
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Tue 13 Jan '15 22:55    Post subject: Reply with quote

Yeah i was going to mention it violates the licenses and terms to distribute ffmpeg with those audio encoders in them. (What i find to be silly and hope they change their licenses)

But it is also good to know it never crossed my mind to download zeranoe's 64bit shared build and just manualy add in the .dll of the audio encoder to make it work like that.

Is there any performance between a static and a shared build ? Just seems once saves more disk space than the other to me.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 13 Jan '15 23:03    Post subject: Reply with quote

C0nw0nk wrote:
But it is also good to know it never crossed my mind to download zeranoe's 64bit shared build and just manualy add in the .dll of the audio encoder to make it work like that.


I do not know if adding libfaac.dll works with Zeranoe's builds. It used to work with Sherpya's builds, but I am not sure if that still is the case.

Anyway, it does not seem to violate the licenses if you build it without distribution.

C0nw0nk wrote:
Is there any performance between a static and a shared build ? Just seems once saves more disk space than the other to me.

Not as far as I know. Static is a lot easier as well.
Back to top
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Tue 13 Jan '15 23:08    Post subject: Reply with quote

Well when i come to testing it if it does not work with Zeranoes can i do it with your builds ?
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Tue 13 Jan '15 23:41    Post subject: Reply with quote

You can test with the ffmpeg64.exe you've just downloaded. There should be minimal differences between Zeranoe's builds and mine. I only changed some fatal errors into non-fatal with a possible recovery:

https://github.com/Jan-E/MyMpeg/blob/master/ffmpeg_patches/asfenc.patch
https://github.com/Jan-E/MyMpeg/blob/master/ffmpeg_patches/movenc.patch
https://github.com/Jan-E/MyMpeg/blob/master/ffmpeg_patches/mpegvideo_enc.patch
https://github.com/Jan-E/MyMpeg/blob/master/ffmpeg_patches/subtitles_non_fatal.patch
https://github.com/Jan-E/MyMpeg/blob/master/ffmpeg_patches/swscale.patch

I still have the video where the swscale patch worked, but the newest non-patched FFmpeg transcodes that video also without apparent errors.

Furthermore, I added a volnorm patch to make some audio normalization on the fly:

https://github.com/Jan-E/MyMpeg/blob/master/ffmpeg_patches/volnorm_new.patch

My users upload videos where speech is important and sometimes the volume is just too low. The patch enables them/me to automatically adjust the volume a bit. The FFmpeg developers did not agree with my way of patching, so this patch did not make it into FFmpeg core:

http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/166113/focus=166113
http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/166113/focus=178647
Back to top
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Wed 14 Jan '15 15:35    Post subject: Reply with quote

Thanks Jan i put your ffmpeg build into production Smile on mp4's i use libfaac as my audio encoder and webm it is libopus.

As of your patches above i dont notice any real difference in audio outputs unless i am missing something from my command line ? But all is working well i was actualy supprised at how fast libfaac encoded compared to ffmpeg's experimental audio encoder. (Performance gain.)

And the non fatal recorvery patches is that to prevent ffmpeg from crashing and try to skip the error preventing it from converting ? Wouldnt that cause unexpected behaviour in video playback maybe even a corrupt output file ?
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Wed 14 Jan '15 18:08    Post subject: Reply with quote

Easy solution if you run into trouble with my patches: do not build FFmpeg with them, but use Roger Pack's repo.

https://github.com/rdp/ffmpeg-windows-build-helpers

He also has a non_free option which includes libfaac if you change --disable-libfaac into --enable-libfaac in line 1167:

https://github.com/rdp/ffmpeg-windows-build-helpers/blob/master/cross_compile_ffmpeg.sh#L1167

and uncomment line 1317.
Back to top
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Wed 14 Jan '15 23:11    Post subject: Reply with quote

Since you use libopus i am assuming you generate WebM files but i could be wrong you could be using it in OGG containers but i was just curious what video bitrates you use.

On MP4's i use a minimum of 1000k and currently on webm's it is 700k what is why my webm videos look a little choppy but i have been thinking about increasing it but on the downside WebM's are slow to compile so increasing the video bitrates will make it slower.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1266
Location: Amsterdam, NL, EU

PostPosted: Thu 15 Jan '15 2:02    Post subject: Reply with quote

You will be really surprised: -b:v 336k -ab 96k

The relevant part of our FFmpeg command line:

-movflags +faststart -s 448x256 -aspect 16:9 -sws_flags bicubic -vcodec libx264 -b:v 336k -r 25 -strict -2 -acodec libfaac -ab 96k -ar 48000 -ac 2 -x264opts
global_header=1:partitions=p8x8+b8x8+i8x8:level_idc=30:cabac=0:subq=3:qp_min=0:qp_max=51:qp_step=4:me=dia:\
subme=0:mixed_refs=0:me_range=16:chroma_me=1:trellis=0:8x8dct=0:cqm=flat:chroma_qp_offset=0:nr=0:\
keyint=25:min_keyint=12:scenecut=0:ratetol=1.0:qcomp=0.60:ip_factor=1.4:weightp=0:fast_pskip=1:frameref=1:\
bframes=0:mbtree=1:rc_lookahead=15:sliced_threads=0:threads=8

Our only requirements are that the faces and gestures are recognizable. Speech is far more important. And speed in compression and uploading. As I said: the compression is being done before uploading. Our users upload less than 200MB per hour video.

Nowadays I only compile to mp4. That my FFmpeg builds contain all those codecs is just a strange desire to have a 'complete' build.
Back to top
C0nw0nk



Joined: 07 Oct 2013
Posts: 241
Location: United Kingdom, London

PostPosted: Thu 15 Jan '15 17:12    Post subject: Reply with quote

Yeah i used to convert to only MP4 since it was used by everyone until linux and Windows XP users started complaining saying they could not watch so i had to start generating WebM's since i refuse to use the putrid filth known as Shock wave flash or FLV/OGG.

http://en.wikipedia.org/wiki/HTML5_video#Browser_support

MP4 is supported by pretty much all browsers and Operating systems but linux and Windows XP users dont get the luxury so i had to have WebM videos. But WebM is fairly new so hopefully google keep making it better. Since compared to MP4 WebM's do have allot smaller file size.

This is also the media player i use.
http://mediaelementjs.com/

And with a comments feature i have i do a nifty little trick using javascript allowing users to click timestamps and jumping to that time frame in the video like on YouTube.
Back to top


Reply to topic   Topic: FFMPEG Windows Apache 64bit Limiting CPU Consumption View previous topic :: View next topic
Post new topic   Forum Index -> Other Software Page Previous  1, 2, 3