Recherche avancée

Médias (91)

Autres articles (69)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

Sur d’autres sites (5049)

  • Things I Have Learned About Emscripten

    1er septembre 2015, par Multimedia Mike — Cirrus Retro

    3 years ago, I released my Game Music Appreciation project, a website with a ludicrously uninspired title which allowed users a relatively frictionless method to experience a range of specialized music files related to old video games. However, the site required use of a special Chrome plugin. Ever since that initial release, my #1 most requested feature has been for a pure JavaScript version of the music player.

    “Impossible !” I exclaimed. “There’s no way JS could ever run fast enough to run these CPU emulators and audio synthesizers in real time, and allow for the visualization that I demand !” Well, I’m pleased to report that I have proved me wrong. I recently quietly launched a new site with what I hope is a catchier title, meant to evoke a cloud-based retro-music-as-a-service product : Cirrus Retro. Right now, it’s basically the same as the old site, but without the wonky Chrome-specific technology.

    Along the way, I’ve learned a few things about using Emscripten that I thought might be useful to share with other people who wish to embark on a similar journey. This is geared more towards someone who has a stronger low-level background (such as C/C++) vs. high-level (like JavaScript).

    General Goals
    Do you want to cross-compile an entire desktop application, one that relies on an extensive GUI toolkit ? That might be difficult (though I believe there is a path for porting qt code directly with Emscripten). Your better wager might be to abstract out the core logic and processes of the program and then create a new web UI to access them.

    Do you want to compile a game that basically just paints stuff to a 2D canvas ? You’re in luck ! Emscripten has a porting path for SDL. Make a version of your C/C++ software that targets SDL (generally not a tall order) and then compile that with Emscripten.

    Do you just want to cross-compile some functionality that lives in a library ? That’s what I’ve done with the Cirrus Retro project. For this, plan to compile the library into a JS file that exports some public functions that other, higher-level, native JS (i.e., JS written by a human and not a computer) will invoke.

    Memory Levels
    When porting C/C++ software to JavaScript using Emscripten, you have to think on 2 different levels. Or perhaps you need to force JavaScript into a low level C lens, especially if you want to write native JS code that will interact with Emscripten-compiled code. This often means somehow allocating chunks of memory via JS and passing them to the Emscripten-compiled functions. And you wouldn’t believe the type of gymnastics you need to execute to get native JS and Emscripten-compiled JS to cooperate.

    “Emscripten : Pointers and Pointers” is the best (and, really, ONLY) explanation I could find for understanding the basic mechanics of this process, at least when I started this journey. However, there’s a mistake in the explanation that left me confused for a little while, and I’m at a loss to contact the author (doesn’t anyone post a simple email address anymore ?).

    Per the best of my understanding, Emscripten allocates a large JS array and calls that the memory space that the compiled C/C++ code is allowed to operate in. A pointer in C/C++ code will just be an index into that mighty array. Really, that’s not too far off from how a low-level program process is supposed to view memory– as a flat array.

    Eventually, I just learned to cargo-cult my way through the memory allocation process. Here’s the JS code for allocating an Emscripten-compatible byte buffer, taken from my test harness (more on that later) :

    var musicBuffer = fs.readFileSync(testSpec[’filename’]) ;
    var musicBufferBytes = new Uint8Array(musicBuffer) ;
    var bytesMalloc = player._malloc(musicBufferBytes.length) ;
    var bytes = new Uint8Array(player.HEAPU8.buffer, bytesMalloc, musicBufferBytes.length) ;
    bytes.set(new Uint8Array(musicBufferBytes.buffer)) ;
    

    So, read the array of bytes from some input source, create a Uint8Array from the bytes, use the Emscripten _malloc() function to allocate enough bytes from the Emscripten memory array for the input bytes, then create a new array… then copy the bytes…

    You know what ? It’s late and I can’t remember how it works exactly, but it does. It has been a few months since I touched that code (been fighting with front-end website tech since then). You write that memory allocation code enough times and it begins to make sense, and then you hope you don’t have to write it too many more times.

    Multithreading
    You can’t port multithreaded code to JS via Emscripten. JavaScript has no notion of threads ! If you don’t understand the computer science behind this limitation, a more thorough explanation is beyond the scope of this post. But trust me, I’ve thought about it a lot. In fact, the official Emscripten literature states that you should be able to port most any C/C++ code as long as 1) none of the code is proprietary (i.e., all the raw source is available) ; and 2) there are no threads.

    Yes, I read about the experimental pthreads support added to Emscripten recently. Don’t get too excited ; that won’t be ready and widespread for a long time to come as it relies on a new browser API. In the meantime, figure out how to make your multithreaded C/C++ code run in a single thread if you want it to run in a browser.

    Printing Facility
    Eventually, getting software to work boils down to debugging, and the most primitive tool in many a programmer’s toolbox is the humble print statement. A print statement allows you to inspect a piece of a program’s state at key junctures. Eventually, when you try to cross-compile C/C++ code to JS using Emscripten, something is not going to work correctly in the generated JS “object code” and you need to understand what. You’ll be pleading for a method of just inspecting one variable deep in the original C/C++ code.

    I came up with this simple printf-workalike called emprintf() :

    #ifndef EMPRINTF_H
    #define EMPRINTF_H
    

    #include <stdio .h>
    #include <stdarg .h>
    #include <emscripten .h>

    #define MAX_MSG_LEN 1000

    /* NOTE : Don’t pass format strings that contain single quote (’) or newline
    * characters. */
    static void emprintf(const char *format, ...)

    char msg[MAX_MSG_LEN] ;
    char consoleMsg[MAX_MSG_LEN + 16] ;
    va_list args ;

    /* create the string */
    va_start(args, format) ;
    vsnprintf(msg, MAX_MSG_LEN, format, args) ;
    va_end(args) ;

    /* wrap the string in a console.log(’’) statement */
    snprintf(consoleMsg, MAX_MSG_LEN + 16, "console.log(’%s’)", msg) ;

    /* send the final string to the JavaScript console */
    emscripten_run_script(consoleMsg) ;

    #endif /* EMPRINTF_H */

    Put it in a file called “emprint.h”. Include it into any C/C++ file where you need debugging visibility, use emprintf() as a replacement for printf() and the output will magically show up on the browser’s JavaScript debug console. Heed the comments and don’t put any single quotes or newlines in strings, and keep it under 1000 characters. I didn’t say it was perfect, but it has helped me a lot in my Emscripten adventures.

    Optimization Levels
    Remember to turn on optimization when compiling. I have empirically found that optimizing for size (-Os) leads to the best performance all around, in addition to having the smallest size. Just be sure to specify some optimization level. If you don’t, the default is -O0 which offers horrible performance when running in JS.

    Static Compression For HTTP Delivery
    JavaScript code compresses pretty efficiently, even after it has been optimized for size using -Os. I routinely see compression ratios between 3.5:1 and 5:1 using gzip.

    Web servers in this day and age are supposed to be smart enough to detect when a requesting web browser can accept gzip-compressed data and do the compression on the fly. They’re even supposed to be smart enough to cache compressed output so the same content is not recompressed for each request. I would have to set up a series of tests to establish whether either of the foregoing assertions are correct and I can’t be bothered. Instead, I took it into my own hands. The trick is to pre-compress the JS files and then instruct the webserver to serve these files with a ‘Content-Type’ of ‘application/javascript’ and a ‘Content-Encoding’ of ‘gzip’.

    1. Compress your large Emscripten-build JS files with ‘gzip’ : ‘gzip compiled-code.js’
    2. Rename them from extension .js.gz to .jsgz
    3. Tell the webserver to deliver .jsgz files with the correct Content-Type and Content-Encoding headers

    To do that last step with Apache, specify these lines :

    AddType application/javascript jsgz
    AddEncoding gzip jsgz
    

    They belong in either a directory’s .htaccess file or in the sitewide configuration (/etc/apache2/mods-available/mime.conf works on my setup).

    Build System and Build Time Optimization
    Oh goodie, build systems ! I had a very specific manner in which I wanted to build my JS modules using Emscripten. Can I possibly coerce any of the many popular build systems to do this ? It has been a few months since I worked on this problem specifically but I seem to recall that the build systems I tried to used would freak out at the prospect of compiling stuff to a final binary target of .js.

    I had high hopes for Bazel, which Google released while I was developing Cirrus Retro. Surely, this is software that has been battle-tested in the harshest conditions of one of the most prominent software-developing companies in the world, needing to take into account the most bizarre corner cases and still build efficiently and correctly every time. And I have little doubt that it fulfills the order. Similarly, I’m confident that Google also has a team of no fewer than 100 or so people dedicated to developing and supporting the project within the organization. When you only have, at best, 1-2 hours per night to work on projects like this, you prefer not to fight with such cutting edge technology and after losing 2 or 3 nights trying to make a go of Bazel, I eventually put it aside.

    I also tried to use Autotools. It failed horribly for me, mostly for my own carelessness and lack of early-project source control.

    After that, it was strictly vanilla makefiles with no real dependency management. But you know what helps in these cases ? ccache ! Or at least, it would if it didn’t fail with Emscripten.

    Quick tip : ccache has trouble with LLVM unless you set the CCACHE_CPP2 environment variable (e.g. : “export CCACHE_CPP2=1”). I don’t remember the specifics, but it magically fixes things. Then, the lazy build process becomes “make clean && make”.

    Testing
    If you have never used Node.js, testing Emscripten-compiled JS code might be a good opportunity to start. I was able to use Node.js to great effect for testing the individually-compiled music player modules, wiring up a series of invocations using Python for a broader test suite (wouldn’t want to go too deep down the JS rabbit hole, after all).

    Be advised that Node.js doesn’t enjoy the same kind of JIT optimizations that the browser engines leverage. Thus, in the case of time critical code like, say, an audio synthesis library, the code might not run in real time. But as long as it produces the correct bitwise waveform, that’s good enough for continuous integration.

    Also, if you have largely been a low-level programmer for your whole career and are generally unfamiliar with the world of single-threaded, event-driven, callback-oriented programming, you might be in for a bit of a shock. When I wanted to learn how to read the contents of a file in Node.js, this is the first tutorial I found on the matter. I thought the code presented was a parody of bad coding style :

    var fs = require("fs") ;
    var fileName = "foo.txt" ;
    

    fs.exists(fileName, function(exists)
    if (exists)
    fs.stat(fileName, function(error, stats)
    fs.open(fileName, "r", function(error, fd)
    var buffer = new Buffer(stats.size) ;

    fs.read(fd, buffer, 0, buffer.length, null, function(error, bytesRead, buffer)
    var data = buffer.toString("utf8", 0, buffer.length) ;

    console.log(data) ;
    fs.close(fd) ;
    ) ;
    ) ;
    ) ;
    ) ;

    Apparently, this kind of thing doesn’t raise an eyebrow in the JS world.

    Now, I understand and respect the JS programming model. But this was seriously frustrating when I first encountered it because a simple script like the one I was trying to write just has an ordered list of tasks to complete. When it asks for bytes from a file, it really has nothing better to do than to wait for the answer.

    Thankfully, it turns out that Node’s fs module includes synchronous versions of the various file access functions. So it’s all good.

    Conclusion
    I’m sure I missed or underexplained some things. But if other brave souls are interested in dipping their toes in the waters of Emscripten, I hope these tips will come in handy.

    The post Things I Have Learned About Emscripten first appeared on Breaking Eggs And Making Omelettes.

  • FFmpeg hardware acceleration on Raspberry PI

    17 février 2017, par Cristian Gabor

    I am building a program that use ffmpeg to stream webcam content over internet. I would like to know if it is possible to use the GPU for the streaming part on the raspberry pi model 3. If yes, how could I implement this on ffmpeg ?

  • Why does the frame count change when scaling with FFmpeg ?

    22 octobre 2016, par ajmicek

    I use this to scale 1920x1080 H.264 videos :

    ffmpeg -i IMG_1438.MOV -threads 2 -vf scale=-2:600 IMG_1438_scaledTo600.MOV

    And it works great ! But here is my question : most of the time, the frame rate stays exactly the same between the original file and the scaled file. For example :

    $ mediainfo -F IMG_1426.MOV | grep Frame\ rate
    Frame rate                               : 29.970
    Frame rate                               : 29.970 FPS
    Frame rate mode                          : VFR
    Frame rate mode                          : Variable
    Frame rate                               : 29.970
    Frame rate                               : 29.970 (29970/1000) FPS

    $ mediainfo -F IMG_1426_scaledTo600.MOV | grep Frame\ rate
    Frame rate                               : 29.970
    Frame rate                               : 29.970 FPS
    Frame rate mode                          : CFR
    Frame rate mode                          : Constant
    Frame rate                               : 29.970
    Frame rate                               : 29.970 (30000/1001) FPS

    But sometimes, the frame rate increases dramatically :

    $ mediainfo -F IMG_1438.MOV | grep Frame\ rate
    Frame rate                               : 25.044
    Frame rate                               : 25.044 FPS
    Frame rate mode                          : VFR
    Frame rate mode                          : Variable
    Frame rate                               : 25.044
    Frame rate                               : 25.044 FPS

    $ mediainfo -F IMG_1438_scaledTo600.MOV | grep Frame\ rate
    Frame rate                               : 120.000
    Frame rate                               : 120.000 FPS
    Frame rate mode                          : CFR
    Frame rate mode                          : Constant
    Frame rate                               : 120.000
    Frame rate                               : 120.000 FPS

    What should I know about FFmpeg or libx264 or libswscale that will help me understand why this happens ? (Hoping to hear from LordNeckbeard, in particular).

    mediainfo IMG_1438.MOV --Full outputs :

    General
    Count                                    : 327
    Count of stream of this kind             : 1
    Kind of stream                           : General
    Kind of stream                           : General
    Stream identifier                        : 0
    Count of video streams                   : 1
    Count of audio streams                   : 1
    OtherCount                               : 2
    Video_Format_List                        : AVC
    Video_Format_WithHint_List               : AVC
    Codecs Video                             : AVC
    Audio_Format_List                        : AAC
    Audio_Format_WithHint_List               : AAC
    Audio codecs                             : AAC LC
    Complete name                            : IMG_1438.MOV
    File name                                : IMG_1438
    File extension                           : MOV
    Format                                   : MPEG-4
    Format                                   : MPEG-4
    Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
    Commercial name                          : MPEG-4
    Format profile                           : QuickTime
    Internet media type                      : video/mp4
    Codec ID                                 : qt  
    Codec ID                                 : qt   0000.00 (qt  )
    Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
    CodecID_Version                          : 0000.00
    CodecID_Compatible                       : qt  
    Codec                                    : MPEG-4
    Codec                                    : MPEG-4
    Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
    File size                                : 113990140
    File size                                : 109 MiB
    File size                                : 109 MiB
    File size                                : 109 MiB
    File size                                : 109 MiB
    File size                                : 108.7 MiB
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52:09
    Duration                                 : 00:00:52.268 (00:00:52:09)
    Overall bit rate                         : 17447026
    Overall bit rate                         : 17.4 Mb/s
    Frame rate                               : 25.044
    Frame rate                               : 25.044 FPS
    Frame count                              : 1309
    Stream size                              : 56670
    Stream size                              : 55.3 KiB (0%)
    Stream size                              : 55 KiB
    Stream size                              : 55 KiB
    Stream size                              : 55.3 KiB
    Stream size                              : 55.34 KiB
    Stream size                              : 55.3 KiB (0%)
    Proportion of this stream                : 0.00050
    HeaderSize                               : 28
    DataSize                                 : 113966271
    FooterSize                               : 23841
    IsStreamable                             : No
    Encoded date                             : UTC 2016-10-08 22:51:19
    Tagged date                              : UTC 2016-10-08 22:52:12
    File last modification date              : UTC 2016-10-08 22:51:19
    File last modification date (local)      : 2016-10-08 17:51:19
    Writing library                          : Apple QuickTime
    Writing library                          : Apple QuickTime
    Encoded_Library_Name                     : Apple QuickTime
    com.apple.quicktime.make                 : Apple
    com.apple.quicktime.model                : iPhone 5
    com.apple.quicktime.software             : 10.0.2
    com.apple.quicktime.creationdate         : 2016-10-08T17:51:19-0500

    Video
    Count                                    : 334
    Count of stream of this kind             : 1
    Kind of stream                           : Video
    Kind of stream                           : Video
    Stream identifier                        : 0
    StreamOrder                              : 0
    ID                                       : 1
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format/Url                               : http://developers.videolan.org/x264.html
    Commercial name                          : AVC
    Format profile                           : High@L4.1
    Format settings                          : CABAC / 1 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 1
    Format settings, ReFrames                : 1 frame
    Internet media type                      : video/H264
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
    Codec                                    : AVC
    Codec                                    : AVC
    Codec/Family                             : AVC
    Codec/Info                               : Advanced Video Codec
    Codec/Url                                : http://developers.videolan.org/x264.html
    Codec/CC                                 : avc1
    Codec profile                            : High@L4.1
    Codec settings                           : CABAC / 1 Ref Frames
    Codec settings, CABAC                    : Yes
    Codec_Settings_RefFrames                 : 1
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52:09
    Duration                                 : 00:00:52.268 (00:00:52:09)
    Bit rate                                 : 17375530
    Bit rate                                 : 17.4 Mb/s
    Width                                    : 1920
    Width                                    : 1 920 pixels
    Height                                   : 1080
    Height                                   : 1 080 pixels
    Stored_Height                            : 1088
    Sampled_Width                            : 1920
    Sampled_Height                           : 1080
    Pixel aspect ratio                       : 1.000
    Display aspect ratio                     : 1.778
    Display aspect ratio                     : 16:9
    Rotation                                 : 90.000
    Rotation                                 : 90°
    Frame rate mode                          : VFR
    Frame rate mode                          : Variable
    Frame rate                               : 25.044
    Frame rate                               : 25.044 FPS
    Minimum frame rate                       : 23.077
    Minimum frame rate                       : 23.077 FPS
    Maximum frame rate                       : 30.000
    Maximum frame rate                       : 30.000 FPS
    Frame count                              : 1309
    Resolution                               : 8
    Resolution                               : 8 bits
    Colorimetry                              : 4:2:0
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Scan type                                : Progressive
    Interlacement                            : PPF
    Interlacement                            : Progressive
    Bits/(Pixel*Frame)                       : 0.335
    Stream size                              : 113523046
    Stream size                              : 108 MiB (100%)
    Stream size                              : 108 MiB
    Stream size                              : 108 MiB
    Stream size                              : 108 MiB
    Stream size                              : 108.3 MiB
    Stream size                              : 108 MiB (100%)
    Proportion of this stream                : 0.99590
    Title                                    : Core Media Video
    Encoded date                             : UTC 2016-10-08 22:51:19
    Tagged date                              : UTC 2016-10-08 22:52:12
    Color range                              : Limited
    colour_description_present               : Yes
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709

    Audio
    Count                                    : 272
    Count of stream of this kind             : 1
    Kind of stream                           : Audio
    Kind of stream                           : Audio
    Stream identifier                        : 0
    StreamOrder                              : 1
    ID                                       : 2
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Commercial name                          : AAC
    Format profile                           : LC
    Codec ID                                 : 40
    Codec                                    : AAC LC
    Codec                                    : AAC LC
    Codec/Family                             : AAC
    Codec/CC                                 : 40
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52:15
    Duration                                 : 00:00:52.268 (00:00:52:15)
    Source duration                          : 52338
    Source duration                          : 52 s 338 ms
    Source duration                          : 52 s 338 ms
    Source duration                          : 52 s 338 ms
    Source duration                          : 00:00:52.338
    Bit rate mode                            : CBR
    Bit rate mode                            : Constant
    Bit rate                                 : 64000
    Bit rate                                 : 64.0 kb/s
    Channel(s)                               : 1
    Channel(s)                               : 1 channel
    Channel positions                        : Front: C
    Channel positions                        : 1/0/0
    ChannelLayout                            : C
    Samples per frame                        : 1024
    Sampling rate                            : 44100
    Sampling rate                            : 44.1 kHz
    Samples count                            : 2305019
    Frame rate                               : 43.066
    Frame rate                               : 43.066 FPS (1024 spf)
    Frame count                              : 2251
    Source frame count                       : 2254
    Compression mode                         : Lossy
    Compression mode                         : Lossy
    Stream size                              : 410424
    Stream size                              : 401 KiB (0%)
    Stream size                              : 401 KiB
    Stream size                              : 401 KiB
    Stream size                              : 401 KiB
    Stream size                              : 400.8 KiB
    Stream size                              : 401 KiB (0%)
    Proportion of this stream                : 0.00360
    Source stream size                       : 410894
    Source stream size                       : 401 KiB (0%)
    Source stream size                       : 401 KiB
    Source stream size                       : 401 KiB
    Source stream size                       : 401 KiB
    Source stream size                       : 401.3 KiB
    Source stream size                       : 401 KiB (0%)
    Source_StreamSize_Proportion             : 0.00360
    Title                                    : Core Media Audio
    Encoded date                             : UTC 2016-10-08 22:51:19
    Tagged date                              : UTC 2016-10-08 22:52:12

    Other #1
    Count                                    : 112
    Count of stream of this kind             : 2
    Kind of stream                           : Other
    Kind of stream                           : Other
    Stream identifier                        : 0
    Stream identifier                        : 1
    Type                                     : meta
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52.268
    Frame count                              : 6
    Bit rate mode                            : VBR

    Other #2
    Count                                    : 112
    Count of stream of this kind             : 2
    Kind of stream                           : Other
    Kind of stream                           : Other
    Stream identifier                        : 1
    Stream identifier                        : 2
    Type                                     : meta
    Duration                                 : 52268
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 52 s 268 ms
    Duration                                 : 00:00:52.268
    Duration                                 : 00:00:52.268
    Frame count                              : 1
    Bit rate mode                            : CBR

    and ffprobe IMG_1438.MOV outputs :

    ffprobe version 3.1.3 Copyright (c) 2007-2016 the FFmpeg developers
     built with Apple LLVM version 7.3.0 (clang-703.0.31)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 48.101 / 57. 48.101
     libavformat    57. 41.100 / 57. 41.100
     libavdevice    57.  0.101 / 57.  0.101
     libavfilter     6. 47.100 /  6. 47.100
     libavresample   3.  0.  0 /  3.  0.  0
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
     libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_1438.MOV':
     Metadata:
       major_brand     : qt  
       minor_version   : 0
       compatible_brands: qt  
       creation_time   : 2016-10-08 22:51:19
       com.apple.quicktime.make: Apple
       com.apple.quicktime.model: iPhone 5
       com.apple.quicktime.software: 10.0.2
       com.apple.quicktime.creationdate: 2016-10-08T17:51:19-0500
     Duration: 00:00:52.27, start: 0.000000, bitrate: 17446 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17375 kb/s, 25.04 fps, 120 tbr, 600 tbn, 1200 tbc (default)
       Metadata:
         rotate          : 90
         creation_time   : 2016-10-08 22:51:19
         handler_name    : Core Media Data Handler
         encoder         : H.264
       Side data:
         displaymatrix: rotation of -90.00 degrees
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 kb/s (default)
       Metadata:
         creation_time   : 2016-10-08 22:51:19
         handler_name    : Core Media Data Handler
       Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
       Metadata:
         creation_time   : 2016-10-08 22:51:19
         handler_name    : Core Media Data Handler
       Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
       Metadata:
         creation_time   : 2016-10-08 22:51:19
         handler_name    : Core Media Data Handler
    Unsupported codec with id 0 for input stream 2
    Unsupported codec with id 0 for input stream 3

    UPDATE
    To clarify : my video above, the one with the high framerate (120 FPS) output after scaling, plays perfectly before and after scaling with FFmpeg (no sync issues, and 120 FPS is only about 14% larger in file size), I am simply trying to understand why this increase in framerate happens (just a little beyond Mulvya’s note that the framerate stored in the container is wrong).

    From a programming perspective, the initial issue I ran into was that I was using frame= from FFmpeg’s sterr console output to determine progress, which reports erroneous results when the frame count increases dramatically on output ("I’m 372% done encoding ?!") ; I have since read another stackoverflow answer and changed my code to use time=, which appears to be a more robust way for me to display FFmpeg progress. (Also, there is FFmpeg’s -progress option, of course).

    Improving on the original command

    My new command to scale, preserve a useful framerate, and optimize threads :

    ffmpeg -i IMG_1438.MOV -vf scale=-2:600 -r 30 -vsync 0 IMG_1438_scaledTo600.MOV

    Where 30 is the "Maximum frame rate" from mediainfo.

    Thanks to help in the comments, I now know I do not fully understand FFmpeg’s use of three different time bases for timestamps : tbn, tbc, and tbr.
    They were explained by Robert Swain in 2009 and his explanation was also used to answer a Stackoverflow question about tbn, tbc, tbr.

    It sounds to me, as I’m pulling together comments from Mulvya below and Michael Rampe at another forum, that tbr is guessed ; it is frequently but not always the best value to use when changing from a variable to a constant frame rate video.

    Which leaves these 2 questions...

    (1) tbr is incorrect when "field rate and frame rate" differ ? Does this happen a lot ?
    (2) Is -r 30 where 30 is the maximum frame rate reported by mediainfo the best way to do it for most codec/container combinations ? (Or should I only use this method when I am scaling a H.264/MPEG-4 AVC video ?)