Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Sur d’autres sites (1907)

  • Adding chapters to MP4 files, and being identified on iOS 12 podcast app

    5 avril 2019, par Craig Francis

    I have an MP4 file, where I’ve added chapters via ffmpeg.

    But in the iOS 12 Podcasts app, from Apple, the chapters don’t appear. This should happen, as noted by idownloadblog.com

    Preview of how Chapters should look in iOS

    In comparison, when using QuickLook on MacOS, the list of chapters can be seen by clicking the chapters button (in the bottom right hand side of the window).

    Preview of QuickLook in MacOS

    And opening in QuickTime Player, while there isn’t a list of chapters to view, you can use the "View > Next Chapter" menu item.

    So I’m assuming this is a bug in iOS... but I’m wondering if there is another way to add chapters ? or if I’ve made a mistake ?


    My current process is to create a "ffmetadata" file, as noted in the ffmpeg documentation :

    ;FFMETADATA1
    title=Example

    [CHAPTER]
    TIMEBASE=1/1000
    START=0
    END=221913
    title=Chapter 1

    [CHAPTER]
    TIMEBASE=1/1000
    START=221913
    END=1169241
    title=Chapter 2

    https://ffmpeg.org/ffmpeg-formats.html#Metadata-1

    Then I’ve tried each of the following commands :

    ffmpeg -i 2019-01-02.mp4 -i 2019-01-02.meta -map_metadata 1 -codec copy 2019-01-02-chapters.mp4
    ffmpeg -i 2019-01-02.mp4 -i 2019-01-02.meta -map_metadata 1 2019-01-02-chapters.mp4
    ffmpeg -i 2019-01-02.mp4 -i 2019-01-02.meta -map_metadata 1 2019-01-02-chapters.mp3
    • The first one is from the ffmpeg documentation, where -codec copy means the audio file is not re-encoded.
    • The second one takes longer, while it re-encodes the audio data.
    • The third one requires re-encoding to convert it into an MP3 file (which uses ID3 tags for the chapter data).

    On a slightly unrelated note, the third party app "RSSRadio" does list the chapters, but the feature added in version 4 that allows you to "skip directly to the start of the next chapter", if the next chapter starts within the next 3 minutes, does not seem to work.

  • "Invalid or unexpected token" error when trying to execute ffmpeg build on lambda

    4 janvier 2019, par almarc

    I have a node.js script that uses ffmpeg to convert mp4 downloaded from YT to mp3 and save to Amazon S3. Uploading using the serverless framework. The "ffmpeg" file is included in the main directory (with .yml), downloaded from here :
    https://johnvansickle.com/ffmpeg/

    The code :

    'use strict'
    process.env.PATH = process.env.PATH + ':/tmp/'
    process.env['FFMPEG_PATH'] = '/tmp/ffmpeg';
    const BIN_PATH = process.env['LAMBDA_TASK_ROOT']
    process.env['PATH'] = process.env['PATH'] + ':' + BIN_PATH;

    module.exports.download_mp3 = function (event, context, callback)
    {
     require('child_process').exec('cp /var/task/ffmpeg /tmp/.; chmod 755
     /tmp/ffmpeg;', function (error, stdout, stderr) {
     if (error)
     {
       console.log('An error occured', error);
       callback(null, null)
     }
     else
     {
       var ffmpeg = require('ffmpeg');
       const aws = require('aws-sdk')
       const s3 = new aws.S3()
       const ytdl = require('ytdl-core');

       function uploadFromStream(s3) {
         const stream = require('stream')
         var pass = new stream.PassThrough();

         var params = {Bucket: "some-bucket", Key: "some-key", Body: pass};
         s3.upload(params, function(err, data) {
           console.log(err, data);
         });
         console.log("Should be finished")
         callback(null)
       }

       let stream = ytdl("some-video-id", {
         quality: 'highestaudio',
         filter: 'audioonly'
       });

       ffmpeg(stream)
         .audioBitrate(128)
         .format('mp3')
         .on('error', (err) => console.error(err))
         .pipe(uploadFromStream(s3), {
           end: true
       });
     }})
    }

    When triggered, the function writes an error in logs :

    2019-01-04T14:50:54.525Z    21da4d49-1030-11e9-b901-0dc32b691a16    
    /var/task/ffmpeg:1
    (function (exports, require, module, __filename, __dirname) { ELF
    ^

    SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at /var/task/download.js:17:18

    It’s, most definetely, an error in the "ffmpeg" file I’ve mentioned above (link provided). But I don’t know what’s the exact issue, I followed the first answer here : https://stackoverflow.com/questions/47882810/lambda-not-connecting-to-ffmpeg to include the ffmpeg build.

  • ffmpeg - MXF with 4-channel audio : how to create proxies (high quality / small file size) and preserve the audio mapping

    8 juillet 2018, par WhatsYourFunction

    We’ve got MXF sources (h.264 video at UHD (3840x2160) with 4-channels of (4 - PCM S24 mono sources)
    We want Proxies — smallest file size at highest picture quality
    The compression applied to the video and audio essences can be anything,
    And the wrapper can be either MXF or QuickTime
    but we need to preserve the audio mapping (i.e. the Proxy must be 4-channel audio)

    How to do that with ffmpeg ?

    • EDIT Adding ffprobe :

    Metadata :

    uid : ***

    generation_uid : ***

    company_name : CANON

    product_name : EOS C300 Mark II

    product_version : 1.00

    product_uid : ***

    modification_date : 2018-06-28T08:29:24.000000Z

    material_package_umid : ***

    timecode : 02:50:31:17

    Duration : 00:06:35.40, start : 0.000000, bitrate : 395842 kb/s

    Stream #0:0 : Video : h264 (High 4:2:2 Intra), yuv422p10le(tv, progressive), 3840x2160, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 23.98 tbn, 47.95 tbc

    Metadata :

    file_package_umid: ***

    Stream #0:1 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s

    Metadata :

    file_package_umid: ***

    Stream #0:2 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s

    Metadata :

    file_package_umid: ***

    Stream #0:3 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s

    Metadata :

    file_package_umid: ***

    Stream #0:4 : Audio : pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s

    Metadata :

    file_package_umid: ***