VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Does anyone know how to remux and keep enhanced AC-3 with joint object control (JOC) with FFmpeg.

    I'm remuxing a number of video files from MKV to MP4\M4V so they play on the Apple platform (including the TV App). It's important not to convert, but to remux.

    I have achieved the ability to remux 4K HDR with Dolby Digital Plus in a .MKV to 4K HDR with Dolby Digtial 5.1. MP4. The issue is retaining the Dolby Digital Plus including JOC. This contains the Atmos information for object based sound. From what I understand MP4\M4V supports Atmos

    The mediainfo tool reports Dolby Digital Plus with JOC for the MKV and Dolby Digital Plus without JOC for MP4.

    I'm using the following FFmpeg command:

    ffmpeg -i original.mkv -c:v copy -c:a eac3 -tag:v hvc1 output.mp4

    Resulting output from MediaInfo (note .MKV contains only 1 video and 1 audio track)

    Audio (Original.mkv):

    ID: 2
    Format : E-AC-3 JOC
    Format/Info: Enhanced AC-3 with Joint Object Coding
    Commercial name: Dolby Digital Plus with Dolby Atmos
    Codec ID: A_EAC3
    Duration: 51 min 51 s

    Audio (Remuxed.mp4):

    ID: 2
    Format: E-AC-3
    Format/Info: Enhanced AC-3
    Commercial name: Dolby Digital Plus
    Codec ID: ec-3
    Duration: 51 min 51 s


    The remux operation finished in about 1 minute for a 8Gb 4k video file, so I know there is no reencoding going on.


    I've also remuxed an MKV to MKV and able to see the same result. The JOC markings have been removed with FFmpeg. I do wonder if we have remuxed the the Audio stream containing all the JOC data, but the container isn't marked as Dolby digital plus with Atom (with JOC)

    Any help here would be welcome.

    thanks in advance
    Quote Quote  
  2. Try
    ffmpeg -i original.mkv -c copy output.mp4
    Quote Quote  
  3. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    There IS re-encoding going on with the audio.
    Either change your -c:a to copy or just do it all as copy, like ProWo suggested.

    Scott
    Quote Quote  
  4. ffmpeg -i original.mkv -c:v copy -c:a copy output.mp4

    Ok, so certainly an improvement, I now see JOC and Atmos mentioned in the Format and Commercial name. 3 out of 4 attributes the same. The only one not set is Codec ID.

    Original is A_EAC3
    Remux is EC-3


    Audio (Original.mkv):

    ID: 2
    Format : E-AC-3 JOC
    Format/Info: Enhanced AC-3 with Joint Object Coding
    Commercial name: Dolby Digital Plus with Dolby Atmos
    Codec ID: A_EAC3
    Duration: 51 min 51 s


    Audio (Remuxed.mp4):

    ID: 2
    Format : E-AC-3 JOC
    Format/Info: Enhanced AC-3 with Joint Object Coding
    Commercial name: Dolby Digital Plus with Dolby Atmos
    Codec ID: ec-3
    Duration: 51 min 51 s

    I also get this error “[mp4 @ 0000016e97453a00] track 1: codec frame size is not set”

    I’m guessing Track 1 is the Audio and I suspect its not able to re encode correctly.

    I thought MKV & MP4 were just containers, like a .zip or a .rar file. I just wanted to copy the Video/Audio from .zip to a .rar. I was surprised to learn it re-encodes Audio.

    Does anyone have any insights to resolve

    Thanks David
    Quote Quote  
  5. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Codec "copy" does just that, copy. It does NOT re-encode. That's why I suggested it to you, as your original script WAS re-encoding.

    The issue with codec ID is, I suspect, a failing of ffmpeg to fully support Atmos, and perhaps also eac3. Not surprising since those are all reverse engineered. Because it doesn't fully recognize all the syntax, it could very well miss (and miss copying) elements that are necessary for proper playback.

    Also, mp4 etc ARE just (multimedia) containers, but they are both more and less than zip & rar. They include not just assets, but rich metadata, AND are often instrumental in maintaining sync between the assets. And they often support a wide variety of compression schemes, as those schemes are encapulated in the raw assets, not intrinsic to the container.
    Archive formats, OTOH, are much more closely tied to specific (lossless) compression schemes, AND they support recursive files & folders, password protection & encryption (mm containers do not seem to, though some codecs do). Plus, they are (usually) agnostic about their supported asset filetypes.

    One upshot of all this is that I do not believe there is currently a resolution to your problem. MUCH more work needs to be done before non-licensed, opensource, reverse-engineered tools properly support Atmos.


    Scott
    Last edited by Cornucopia; 5th Jan 2021 at 00:59.
    Quote Quote  
  6. Originally Posted by DavidFVancouver View Post
    ffmpeg -i original.mkv -c:v copy -c:a copy output.mp4

    Ok, so certainly an improvement, I now see JOC and Atmos mentioned in the Format and Commercial name. 3 out of 4 attributes the same. The only one not set is Codec ID.

    Original is A_EAC3
    Remux is EC-3


    Audio (Original.mkv):

    ID: 2
    Format : E-AC-3 JOC
    Format/Info: Enhanced AC-3 with Joint Object Coding
    Commercial name: Dolby Digital Plus with Dolby Atmos
    Codec ID: A_EAC3
    Duration: 51 min 51 s


    Audio (Remuxed.mp4):

    ID: 2
    Format : E-AC-3 JOC
    Format/Info: Enhanced AC-3 with Joint Object Coding
    Commercial name: Dolby Digital Plus with Dolby Atmos
    Codec ID: ec-3
    Duration: 51 min 51 s

    I also get this error “[mp4 @ 0000016e97453a00] track 1: codec frame size is not set”

    I’m guessing Track 1 is the Audio and I suspect its not able to re encode correctly.

    I thought MKV & MP4 were just containers, like a .zip or a .rar file. I just wanted to copy the Video/Audio from .zip to a .rar. I was surprised to learn it re-encodes Audio.

    Does anyone have any insights to resolve

    Thanks David
    Maybe I'm wrong but those are not the same containers, MKV uses its own codec ID's and MP4 spec is different. However I know ec-3 is also correct term for Dolby Digital Plus.
    Quote Quote  
  7. Originally Posted by Cornucopia View Post
    Codec "copy" does just that, copy. It does NOT re-encode. That's why I suggested it to you, as your original script WAS re-encoding.

    The issue with codec ID is, I suspect, a failing of ffmpeg to fully support Atmos, and perhaps also eac3. Not surprising since those are all reverse engineered. Because it doesn't fully recognize all the syntax, it could very well miss (and miss copying) elements that are necessary for proper playback.

    Also, mp4 etc ARE just (multimedia) containers, but they are both more and less than zip & rar. They include not just assets, but rich metadata, AND are often instrumental in maintaining sync between the assets. And they often support a wide variety of compression schemes, as those schemes are encapulated in the raw assets, not intrinsic to the container.
    Archive formats, OTOH, are much more closely tied to specific (lossless) compression schemes, AND they support recursive files & folders, password protection & encryption (mm containers do not seem to, though some codecs do). Plus, they are (usually) agnostic about their supported asset filetypes.

    One upshot of all this is that I do not believe there is currently a resolution to your problem. MUCH more work needs to be done before non-licensed, opensource, reverse-engineered tools properly support Atmos.


    Scott
    Thanks Scott for your reply, i've been doing some digging and it seems FFMPEG does have full Atmos support. I also tried your plain copy option. I guess i have no options if i want to keep the object positioning meta data in place.

    I was fully aware zip & rar are file based containers and also used for word & excel. But MKV & MP4\M4V are different and have other metadata and image embedded

    I'm only guessing here, but I wonder if A_EAC3 means A(Atmos)_EAC3 in the Codec ID

    I guess for right now there is no option to remux to a 4K HDR with DD+ with joint object control

    Thanks Everyone who commented
    Quote Quote  
  8. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Originally Posted by DavidFVancouver View Post
    Thanks Scott for your reply, i've been doing some digging and it seems FFMPEG does have full Atmos support. I also tried your plain copy option. I guess i have no options if i want to keep the object positioning meta data in place.

    I was fully aware zip & rar are file based containers and also used for word & excel. But MKV & MP4\M4V are different and have other metadata and image embedded

    I'm only guessing here, but I wonder if A_EAC3 means A(Atmos)_EAC3 in the Codec ID

    I guess for right now there is no option to remux to a 4K HDR with DD+ with joint object control

    Thanks Everyone who commented
    Just did some digging myself, and I have to strongly disagree with you - ffmpeg does NOT have full atmos support.

    It cannot encode, nor decode/render (talking about the Atmos enhanced object stream/layer here, NOT the eac3 or true hd base stream).
    Considering the issues I read of your and other recent threads, it is questionable if it properly extracts & inserts the enhancement layer, let alone parse & manipulate it. Mapping? - again, only of the base layer.

    This is like saying ffmpeg fully supports mvc and other enhanced, native forms of stereoscopic video.

    The idea of the base layer plus enhancement layer is a longstanding, time-tested approach to provide backward compatibility:

    FM stereo - mono (sum) + enhancement (difference) = stereo
    LP stereo - mono (lateral movement) + enh. (vertical movement) = stereo (dual diagonal)
    TV color - grayscale (luma) + enh. (chroma) = color
    Surround LPs - stereo (std. range) + enh. (supersonic) = quad surround
    3D mvc, 3DBD - monoscopic (avc) + enh. (mvc L-R difference) = stereoscopic

    But as you can see, legacy and non-enhanced players do not support the enhanced features.


    Scott
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!