Rechercher dans ce blog

mardi 15 décembre 2015

Verify & Repair Permissions in OS X El Capitan via command line

To verify


sudo /usr/libexec/repair_packages --verify --standard-pkgs /

To repair


sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /

Finalisation installation EL CAPITAN os x 10.11

- Remove Apple HD Recovery


En mergeant la partition via diskutil  mergePartitions

J'ai l'impression que la réactivité est meilleure depuis que j'ai réduis au minimum le nombre de partitions sur le disque et notamment en supprimant les partitions de recovery. A confirmer et éventuellement obtenir une explication logique à cela



Pour lister tous les services chargés :

launchctl list

launchctl print-disabled system 

Pour lister les services system disabled à true


enable | disable service-target
              Enables or disables the service in the requested domain. Once a service is disabled, it cannot be loaded in the specified domain until it is once
              again enabled. This state persists across boots of the device. This subcommand may only target services within the system domain or user and
              user-login domains.


list [-x] [label]
              With no arguments, list all of the jobs loaded into launchd in three columns. The first column displays the PID of the job if it is running.  The
              second column displays the last exit status of the job. If the number in this column is negative, it represents the negative of the signal which
              stopped the job. Thus, "-15" would indicate that the job was terminated with SIGTERM.  The third column is the job's label. If [label] is speci-
              fied, prints information about the requested job.

              -x       This flag is no longer supported.

print-disabled
              Prints the list of disabled services.

blame service-target
              If the service is running, prints a human-readable string describing why launchd launched the service. Note that services may run for many rea-
              sons; this subcommand will only show the most proximate reason. So if a service was run due to a timer firing, this subcommand will print that
              reason, irrespective of whether there were messages waiting on the service's various endpoints. This subcommand is only intended for debugging
              and profiling use and its output should not be relied upon in production scenarios.

     print domain-target | service-target
              Prints information about the specified service or domain. Domain output includes various properties about the domain as well as a list of ser-
              vices and endpoints in the domain with state pertaining to each. Service output includes various properties of the service, including information
              about its origin on-disk, its current state, execution context, and last exit status.

              IMPORTANT: This output is NOT API in any sense at all. Do NOT rely on the structure or information emitted for ANY reason. It may change from
              release to release without warning.

load | unload [-wF] [-S sessiontype] [-D domain] paths ...
              Load the specified configuration files or directories of configuration files.  Jobs that are not on-demand will be started as soon as possible.
              All specified jobs will be loaded before any of them are allowed to start. Note that per-user configuration files (LaunchAgents) must be owned by
              root (if they are located in /Library/LaunchAgents) or the user loading them (if they are located in $HOME/Library/LaunchAgents).  All system-
              wide daemons (LaunchDaemons) must be owned by root. Configuration files must disallow group and world writes. These restrictions are in place for
              security reasons, as allowing writability to a launchd configuration file allows one to specify which executable will be launched.

              Note that allowing non-root write access to the /System/Library/LaunchDaemons directory WILL render your system unbootable.

              -w       Overrides the Disabled key and sets it to false or true for the load and unload subcommands respectively. In previous versions, this
                       option would modify the configuration file. Now the state of the Disabled key is stored elsewhere on- disk in a location that may not be
                       directly manipulated by any process other than launchd.

              -F       Force the loading or unloading of the plist. Ignore the Disabled key.

              -S sessiontype
                       Some jobs only make sense in certain contexts. This flag instructs launchctl to look for jobs in a different location when using the -D
                       flag, and allows launchctl to restrict which jobs are loaded into which session types. Sessions are only relevant for per-user launchd
                       contexts. Relevant sessions are Aqua (the default), Background and LoginWindow.  Background agents may be loaded independently of a GUI
                       login. Aqua agents are loaded only when a user has logged in at the GUI. LoginWindow agents are loaded when the LoginWindow UI is dis-
                       playing and currently run as root.

              -D domain
                       Look for plist(5) files ending in *.plist in the domain given. This option may be thoughts of as expanding into many individual paths
                       depending on the domain name given. Valid domains include "system," "local," "network" and "all." When providing a session type, an
                       additional domain is available for use called "user." For example, without a session type given, "-D system" would load from or unload
                       property list files from /System/Library/LaunchDaemons.  With a session type passed, it would load from /System/Library/LaunchAgents.
                       Note that launchctl no longer respects the network domain.

              NOTE: Due to bugs in the previous implementation and long-standing client expectations around those bugs, the load and unload subcommands will
              only return a non-zero exit code due to improper usage.  Otherwise, zero is always returned.

- Turn off / Disable Apple Push Notifications

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.apsd.plist


Bloqué avec littlesnitch

- com.apple.Safari.SafeBrowsing.Service

Bloqué avec littlesnitch

From http://www.sitepronews.com/2014/10/01/googles-safe-browsing-service-killing-privacy/

Google Safe Browsing is a service through which Google provides lists of URLs (addresses) of websites that contain malware or phishing content. These lists of suspicious sites are continuously updated using Google’s web crawlers, programs that scour the web to index sites for Google’s search engine. Lists from the Google Safe Browsing service are used by browsers such as Google Chrome, Mozilla Firefox and apple Safari for checking web-pages users are trying to access against potential threats. The service issues alerts when they are about to open websites or content Google has classified as malicious. The warnings are display as ‘visual messages’ along with specific details relating to the malicious content concerned. The service is also designed to block the downloading of files infected with malware and, once a user’s computer has been infected, it can issue instructions on how to detect and remove the malware.

...


The Firefox and Safari browsers however use a second version of the API, Safe Browsing API v2, to exchange data with the server. This uses hashed URLs so the Google server never knows the actual URLs queried by the user. However the Safe Browsing API also stores a cookie on the user’s computer which the NSA (US National Security Agency) uses to identify individual computers. This is a mandatory requirement that many users feel is acceptable as it helps them feel safe. In addition, Google stores another cookie on the user’s computer that can be used to identify the IP addresses the user visits, ie can be used to track him or her. Google’s excuse is that the tracking cookie logs this data in order to prevent DDoS (distributed denial-of-service) attacks. That may be so. The API in the user’s browser (eg, Chrome) will ‘phone home’ every few hours to check for updates to its list of malicious sites. At the same time it sends a payload that includes the machine’s ID and the user’s ID.

Peut être activé ou désactivé dans les préférences de safari onglet Sécurité. Si la liste n'est pas mise à jour, le service se désactive de lui-même.


IMAgent is an OSX daemon which runs as part of FaceTime.

launchctl unload -w /System/Library/LaunchAgents/com.apple.imagent.plist


launchctl unload -w /System/Library/LaunchAgents/com.apple.icloud.findmydeviced.findmydev
ice-user-agent.plist

launchctl unload -w /System/Library/LaunchAgents/com.apple.icloud.fmfd.plist

launchctl unload -w /System/Library/LaunchAgents/com.apple.findmymacmessenger.plist

launchctl enable system/com.apple.imagent

launchctl disable system/com.apple.imagent

Little Snitch rules

...

Préférences / Extensions... 

ajuster selon les besoins.






dimanche 13 décembre 2015

Empêcher OS X de monter un volume au démarrage / Prevent OS X to mount a disk at startup

Prevent a partition from mounting in OS X


diskutil info /Volumes/disk-to-not-be-auto-mounted

Get 

Volume UUID:              EADFE3D8-33C0-3D52-8D66-E5EA0748F81D

vi  /etc/fstab


UUID=EADFE3D8-33C0-3D52-8D66-E5EA0748F81D none hfs rw,no auto




vendredi 11 décembre 2015

ffmpeg encode settings mémo


ffmpeg encoding settings memo


To test settings : 

ffplay -i 'in-1920p'-vf "crop=1888:1056:0:0,scale=1280:720"

mac os x aac encoding  ffmpeg gpl

-strict -2 -codec:a aac -b:a 56k

From 720p

To Divx VGA


ffmpeg -i 'in-720p.mov' -c:v libxvid -filter:v crop=in_w-320:in_h,scale=640:480 -qscale:v 4 -ac 1 -codec:a libmp3lame -b:a 64k out-VGA.avi

to Divx 480p


ffmpeg -i 'in-720p.mov' -c:v libxvid -filter:v crop=in_w-200:in_h,scale=720:480 -qscale:v 4 -ac 1 -codec:a libmp3lame -b:a 64k out-480P.avi

to MP4 480p


ffmpeg -i 'in-720p.mov' -codec:v libx264 -preset slow -crf 18 -filter:v crop=in_w-200:in_h,scale=720:480 -ac 1 -codec:a libfdk_aac -b:a 56k out-480p.mp4

(Quality crf 18=high - 23=normal)

to MP4 480p main profile


fmpeg -i 'in-720p.mov' -codec:v libx264 -preset slow -filter:v crop=in_w-200:in_h,scale=720:480 -crf 18 -pix_fmt yuv420p -profile:v main -ac 1 -codec:a libfdk_aac -b:a 56k out-480p.mSap4

From HD 1920p

De 1080p à 720p même format d'image 16/9 : crop inutile.

De 1080p à 480p : crop=1616:1080:0:0

Normalement 1620 car 720/480= 1,5 et 1,5x1080=1620 mais pas divisible par 16. Donc j'arrondis à 1616.

De 1080p à VGA (640x480) : crop=1440:1080:0:0


Attention si crop nécessaire 

Maintient de dar et sar à 1
-aspect 16:9

SAINT JACUT MATIN SOIR

To 720p mp4


bin/ffmpeg28 -i /Users/moi/Desktop/sources\ vues\ backup/2012-09-28\ 07_12_19\ \(id\).mov -codec:v libx264 -preset slow -crf 18 -pix_fmt yuv420p -profile:v main -vf rotate=-1.5*PI/180:bilinear=1,format=yuv420p,crop=1856:1008:48:48,scale=1280:720 -aspect 16:9 -an saint-jacut_1_nosound-nots-720P-H264-aac-crf18-main-yuv420p.mp4

bin/ffmpeg28 -i "/Users/moi/Desktop/sources vues backup/2012-09-28 14_15_01 (id).mov" -codec:v libx264 -preset slow -crf 18 -pix_fmt yuv420p -profile:v main -vf rotate=-1.5*PI/180:bilinear=1,format=yuv420p,crop=1856:1008:48:48,scale=1280:720 -aspect 16:9 -t 05:18:12  -an saint-jacut_2_nosound-nots-720P-H264-aac-crf18-main-yuv420p.mp4

Saint Jacut marée montante

Le crop est calculé pour couper l'image en bas 1056 (pour retirer la barrière), puis à droite pour conserver le rapport h/l selon le format de sortie. Le crop est calculé également pour être divisible par 16

To mp4 720p


ffmpeg -i 'in-1920p.mov' -codec:v libx264 -preset slow -filter:v crop=1888:1056:0:0,scale=1280:720 -crf 18 -pix_fmt yuv420p -profile:v main -ac 1 -codec:a libfdk_aac -b:a 56k out-720p.mp4

To mp4 480p


ffmpeg -i 'in-1920p.mov' -codec:v libx264 -preset slow -filter:v crop=1584:1056:0:0,scale=720:480 -crf 18 -profile:v main -ac 1 -codec:a libfdk_aac -b:a 56k out-480p.mp4

To mp4 480p no audio


ffmpeg -i 'in-1920p.mov' -codec:v libx264 -preset slow -filter:v crop=1584:1056:0:0,scale=720:480 -crf 18 -profile:v main -an out-480p.mp4

To mp4 VGA


ffmpeg -i 'in-1980p.mov' -codec:v libx264 -preset slow -filter:v crop=1408:1056:0:0,scale=640:480 -crf 18  -profile:v main -ac 1 -codec:a libfdk_aac -b:a 56k out-VGA.mp4

To mp4 VGA no audio


ffmpeg -i 'in-1980p.mov' -codec:v libx264 -preset slow -filter:v crop=1408:1056:0:0,scale=640:480 -crf 18  -profile:v main -an out-VGA.mp4

no sound => -an

From HD SONY 1440 to VGA with rotation (machines à laver)


ffmpeg -i '/in-1440.mov' -c:v libxvid -filter:v hflip,vflip,format=yuv420p,scale=640:480 -qscale 4 -ac 1 -codec:a libmp3lame -b:a 64k out-VGA.avi


Méthodes de rotation - ffmpeg options


* rotate=PI:bilinear=0,format=yuv420p

* hflip,vflip,format=yuv420p

* transpose=2,transpose=2,format=yuv420p" -metadata:s:v rotate=0

* cropdetect=24:16:0

Start and End time position to encoding


ffmpeg -i ORIGINALFILE.mp4 -acodec copy -vcodec copy -ss START -t LENGTH OUTFILE.mp4
where START is starting positing in seconds or in format hh:mm:ss LENGTH is the chunk length in seconds or in format hh:mm:ss

So you will need to run this command few times depending on how long your video. If let's say your video is 31 minutes long and you want so split into 15 min chunks here is how you run it:

ffmpeg -i ORIGINALFILE.mp4 -acodec copy -vcodec copy -ss 0 -t 00:15:00 OUTFILE-1.mp4

ffmpeg -i ORIGINALFILE.mp4 -acodec copy -vcodec copy -ss 00:15:00 -t 00:15:00 OUTFILE-2.mp4

Concat demuxer

The concat demuxer was added to FFmpeg 1.1. You can read about it in the documentation.

Instructions

Create a file mylist.txt with all the files you want to have concatenated in the following form (lines starting with a # are ignored):
# this is a comment
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
Note that these can be either relative or absolute paths. Then you can stream copy or re-encode your files:
ffmpeg -f concat -i mylist.txt -c copy output

----

Constant Rate Factor (CRF) - ffmpeg options profiles...


This method allows the encoder to attempt to achieve a certain output quality for the whole file when output file size is of less importance. This provides maximum compression efficiency with a single pass. Each frame gets the bitrate it needs to keep the requested quality level. The downside is that you can't tell it to get a specific filesize or not go over a specific size or bitrate.

1. Choose a CRF value

The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible. A lower value is a higher quality and a subjectively sane range is 18-28. Consider 18 to be visually lossless or nearly so: it should look the same or nearly the same as the input but it isn't technically lossless.

The range is exponential, so increasing the CRF value +6 is roughly half the bitrate while -6 is roughly twice the bitrate. General usage is to choose the highest CRF value that still provides an acceptable quality. If the output looks good, then try a higher value and if it looks bad then choose a lower value.

Note: The CRF quantizer scale mentioned on this page only applies to 8-bit x264 (10-bit x264 quantizer scale is 0-63). You can see what you are using by referring to the ffmpeg console output during encoding (yuv420p or similar for 8-bit, and yuv420p10le or similar for 10-bit). 8-bit is more common among distributors.

2. Choose a preset

A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset. Similarly, for constant quality encoding, you will simply save bitrate by choosing a slower preset.

The general guideline is to use the slowest preset that you have patience for. Current presets in descending order of speed are: ultrafast,superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo. The default preset is medium. Ignore placebo as it is not useful (see FAQ). You can see a list of current presets with -preset help (see example below), and what settings they apply with x264 --fullhelp.

You can optionally use -tune to change settings based upon the specifics of your input. Current tunings include: film, animation, grain, stillimage, psnr, ssim, fastdecode, zerolatency. For example, if your input is animation then use the animation tuning, or if you want to preserve grain then use the grain tuning. If you are unsure of what to use or your input does not match any of tunings then omit the -tune option. You can see a list of current tunings with -tune help, and what settings they apply with x264 --fullhelp.

Profiles

Another optional setting is -profile:v which will limit the output to a specific H.264 profile. This can generally be omitted unless the target device only supports a certain profile (see Compatibility). Current profiles include: baseline, main, high, high10, high422, high444. Note that usage of -profile:v is incompatible with lossless encoding.

To list all possible internal preset and tunes:

ffmpeg -f lavfi -i nullsrc -c:v libx264 -preset help -f mp4 -


------------

ffmpeg map option


from : https://trac.ffmpeg.org/wiki/Map

In all following examples, we will use an example input file like this one:
# fmpeg -i input.mkv

ffmpeg version ... Copyright (c) 2000-2012 the FFmpeg developers
...
Input #0, matroska,webm, from 'input.mkv':
  Duration: 01:39:44.02, start: 0.000000, bitrate: 5793 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x800, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(ger): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s (default)
    Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s
    Stream #0:3(ger): Subtitle: text (default)
At least one output file must be specified

#

Example 1

Now, let's say we want to:
  • copy video stream
  • encode german audio stream to mp3 (128kbps) and aac (96kbps) (creating 2 audio streams in the output)
  • drop english audio stream
  • copy subtitle stream
This can be done using the following FFmpeg command line:
ffmpeg -i input.mkv \
    -map 0:0 -map 0:1 -map 0:1 -map 0:3 \
    -c:v copy \
    -c:a:0 libmp3lame -b:a:0 128k \
    -c:a:1 libfaac -b:a:1 96k \
    -c:s copy \
    output.mkv
Note there is no "-map 0:2" and that "-map 0:1" has been specified twice.
Using "-map 0:0 -map 0:1 -map 0:1 -map 0:3" we told FFmpeg to select/map specified input streams to output in that order.
So, our output will now have the following streams:
Output #0, matroska, to 'output.mkv':
    Stream #0:0(eng): Video ...
    Stream #0:1(ger): Audio ...
    Stream #0:2(ger): Audio ...
    Stream #0:3(ger): Subtitle ...
After we selected which streams we would like in our output, using "-map" option, we specified codecs for each stream in our output.
Video and subtitle stream have just been copied and german audio stream has been encoded to 2 new audio streams, mp3 and aac.
We used "-c:a:0" to specify codec for the output's first AUDIO stream and "-c:a:1" to specify codec for the output's second AUDIO stream.
Note that "a:0" refers to the output's first AUDIO stream (#0:1 in our case), "a:1" refers to the output's 2nd AUDIO stream (#0:2 in our case), etc.
The result will be:
Output #0, matroska, to 'output.mkv':
    Stream #0:0(eng): Video ...
    Stream #0:1(ger): Audio ...
    Stream #0:2(ger): Audio ...
    Stream #0:3(ger): Subtitle ...
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (dca -> libmp3lame)
  Stream #0:2 -> #0:2 (dca -> libfaac)
  Stream #0:3 -> #0:3 (copy)

Example 2

Let's say that we want to reorder input streams backwards, so that we have output like this:
    Stream #0:0(ger): Subtitle: text (default)
    Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s
    Stream #0:2(ger): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s (default)
    Stream #0:3(eng): Video: h264 (High), yuv420p, 1920x800, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
This can simply be done using the following command line:
ffmpeg -i input.mkv -map 0:3 -map 0:2 -map 0:1 -map 0:0 -c copy output.mkv
Note that we specified all the input streams, but in the reverse order, which causes that order to be respected in the output.
The option "-c copy" tells FFmpeg to use "copy" on all streams.

Example 3

If we want to extract only audio streams, from input file, then we can do it like this:
ffmpeg -i input.mkv -map 0:1 -map 0:2 -c copy output.mkv

Example 4

If we want to re-encode just the video streams, but copy all the other streams (like audio, subtitles, attachments, etc), we might use something like this:
ffmpeg -i input.mkv -map 0 -c copy -c:v mpeg2video output.mkv
It will tell ffmpeg to:
  • read the input file 'input.mkv'
  • select all the input streams (first input = 0) to be processed (using "-map 0")
  • mark all the streams to be just copied to the output (using "-c copy")
  • mark just the video streams to be re-encoded (using "-c:v mpeg2video")
  • write the output file 'output.mkv'

jeudi 10 décembre 2015

FIX avidemux2 2.5.4 mac os x lion 10.7

To fix crash avidemux 2.5.4 at startup on lion 10.7


Simply delete


in ressource/lib

libxml2.2.dylib
libiconv.2.dylib

mercredi 9 décembre 2015

Commandes Vidéo diverses ffmpeg mencoder avisplit avimerge transcode

How can I fix AVI files with a broken index or bad interleaving?


To avoid having to use -idx to be able to seek in AVI files with a broken index or -ni to play AVI files with bad interleaving, use the command

mencoder -forceidx -nobps  -ovc copy -oac copy -o outidx.avi input.avi

to copy the video and audio streams into a new AVI file while regenerating the index and correctly interleaving the data.

Of course this cannot fix possible bugs in the video and/or audio streams

transcode -i input.avi -P 1 --avi_limit 128 -b 128  -o out.avi

Réaligner chunks vidéo et audio pour qu'il n'y ait pas de désynchronisation après le split


transcode -i input.avi -P1 -N 0x55 -y raw -o out.avi

Split

avisplit -i out.avi -o base -s 512

TOUT EN UNE SEULE OPERATION avec transcode

transcode -i input.avi -P1 -N 0x55 -y raw -o out --avi_limit 512

ffmpeg -threads N


ffmpeg -i input.mp4 -y -threads 2 -map 0.0:0.0 -f avi -vcodec copy -b 940 -aspect 4:3 -s 640x480 -r pal -g 240 -me epzs -qmin 2 -qmax 15 -acodec mp3 -ab 128 -ar 48000 -ac 2 -map 0.1:0.1 -benchmark out.avi

MUXING


mencoder -oac copy -ovc copy  -o output_movie.avi \
    -audiofile input_audio.mp2 input_video.avi

mencoder -of lavf -ovc copy -oac mp3lame -forceidx -lameopts cbr:br=128 -o outmencoder.avi -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames input.mp4

Pour joindre 2 fichiers avi


L'option -c set pour dropper des frames s'il manque de l'audio

avimerge -o bigvideo.avi -c -i avi1 avi2 avi3

launchtl can be used to disable and re-enable crash reporting or mDNSResponder or services mac os x

launchtl can be used to disable and re-enable crash reporting.  


To disable crash  reporting:


           launchctl unload -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
           sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist

     To re-enable crash reporting:

           launchctl load -w /System/Library/LaunchAgents/com.apple.ReportCrash.plist
           sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.ReportCrash.Root.plist


Disable mDNSResponder


sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

Disable  Apple Push Notification Service (apsd) on OS X 10.8

launchctl unload -w /System/Library/LaunchDaemons/com.apple.apsd.plist