VideoHelp Forum




+ Reply to Thread
Results 1 to 27 of 27
  1. Greetings, i've some dilemma here.
    I'm trying to get the audio from a movie part (e.g. the opening, dialogues, etc.)
    The problem is, mp3DirectCut, which the program i use to trim the unwanted parts, seems to display file length incorrectly.
    WMP with LAV codec, displays the length properly. (for example the movie is 24 minutes long, mp3DirectCut displays the length is 25 minutes)
    However, WinAmp also displays the file length incorrectly, 25 minutes.

    What have i done is demux mkv with MKVcleaver, and open the AAC on mp3DirectCut.
    FYI this is the properties

    Code:
    Audio
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format version                           : Version 4
    Format profile                           : LC
    Bit rate mode                            : Variable
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 28.1 MiB (100%)
    Quote Quote  
  2. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Length is displaying incorrectly because the file is VBR and the app(s) don't know how to correctly calculate length for files of that type. CBR is usually "filesize = bitrate * running time", with running time being listed as # of samples or # of "frames/packets". You can't do that with VBR.
    Not surprised. VBR audio is OFTEN a bitch to work with.

    Can mp3directcut make the edits the way you'd like? If so, don't sweat it.

    Scott
    Last edited by Cornucopia; 30th May 2013 at 01:05.
    Quote Quote  
  3. Any app you know to trim AAC without reencoding?
    Quote Quote  
  4. Originally Posted by Cornucopia View Post
    Length is displaying incorrectly because the file is VBR and the app(s) don't know how to correctly calculate length for files of that type. CBR is usually "filesize = bitrate * running time", with running time being listed as # of samples or # of "frames/packets". You can't do that with VBR.
    Not surprised. VBR audio is OFTEN a bitch to work with.

    Can mp3directcut make the edits the way you'd like? If so, don't sweat it.

    Scott
    Unfortunatle, for me, not. Because i want it to be precise
    Quote Quote  
  5. Does "Use TOC Correction for VBR" under the Settings menu make a difference if it's checked?
    Quote Quote  
  6. It seems that option do nothing to the file length.
    fileforum.betanews.com/review/1010041409/1/view < proof
    Quote Quote  
  7. You can cut (copy) it accurately with ffmpeg . Don't demux from the original mkv container . Some mkv's have variable frame rate, and that can cause some programs to give you the running time discrepancies . If you leave it in the mkv, this will keep the timecodes.

    use -ss for start time (in hh:mm: ss.ms notation) , and -t for duration

    e.g. copy audio from 10:00 minutes start time , for 1 minute , 5 seconds duration (until 11 minute , 5 second , playing time)

    Code:
    ffmpeg -i input.mkv -vn -acodec copy -ss 00:10:00 -t 00:01:05 output.mp4
    I left it as "mp4" container in this example but you can use raw aac e.g. output.aac
    Quote Quote  
  8. Originally Posted by poisondeathray View Post
    You can cut (copy) it accurately with ffmpeg . Don't demux from the original mkv container . Some mkv's have variable frame rate, and that can cause some programs to give you the running time discrepancies . If you leave it in the mkv, this will keep the timecodes.

    use -ss for start time (in hh:mm: ss.ms notation) , and -t for duration

    e.g. copy audio from 10:00 minutes start time , for 1 minute , 5 seconds duration (until 11 minute , 5 second , playing time)

    Code:
    ffmpeg -i input.mkv -vn -acodec copy -ss 00:10:00 -t 00:01:05 output.mp4
    I left it as "mp4" container in this example but you can use raw aac e.g. output.aac
    After that, then demux to get the raw aac?
    Does ffmpeg cut in 1 ms accuracy?
    Quote Quote  
  9. You don't have to demux it in a separate step; just change it to "output.aac" instead of "output.mp4"

    I'm not sure how accurate ; it's within a few ms for audio.

    But video , it isn't accurate for "cutting" - only to nearest keyframe
    Quote Quote  
  10. Is there any logical method out there?
    Like BeSplit? Does it have proper VBR support?
    Quote Quote  
  11. Seems the current best option are ffmpeg, but it is not accurate though. Few ~40ms.
    Audacity reports ffmpeg output are slightly longer, yet no waveform difference as far as my eyes can tell.
    Quote Quote  
  12. Did you specify the precise .ms in ffmpeg ? hh:mm: ss.ms , and it was still 40ms off ?

    You can also try cutting with mkvtoolnix with audio only ie. .mka using timecodes (with video, you can only cut to nearest keyframe, but with audio it should be much more precise. If the video was I-frame only, you can cut with frame accuracy) ,then demux it with mkvextract
    Quote Quote  
  13. Yes it is I-frame, all of them, in VirtualDub, all frames are marked [k].
    It was not 40ms off, ffmpeg appends some silence at the end..

    EDIT: Console output
    PS C:\Users\User\Documents\ffmpeg-20130606-git--win64-static\bin> .\ffmpeg -i '..\..\..\videos\Angel Beats!\[SS]_Angel
    _Beats!_-_03_(1280x720_H.264)_[7378C000].mkv' -ss 12:12.690 -to 12:18.946 -acodec copy ..\..\output1.aac
    ffmpeg version N-53868-gc51654f Copyright (c) 2000-2013 the FFmpeg developers
    built on Jun 6 2013 03:06:23 with gcc 4.7.3 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfi
    g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
    e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopenco
    re-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
    eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-lib
    vpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
    libavutil 52. 35.100 / 52. 35.100
    libavcodec 55. 15.100 / 55. 15.100
    libavformat 55. 8.102 / 55. 8.102
    libavdevice 55. 2.100 / 55. 2.100
    libavfilter 3. 75.101 / 3. 75.101
    libswscale 2. 3.100 / 2. 3.100
    libswresample 0. 17.102 / 0. 17.102
    libpostproc 52. 3.100 / 52. 3.100
    [matroska,webm @ 000000000249a440] Unknown entry 0x437E
    Last message repeated 4 times
    Input #0, matroska,webm, from '..\..\..\videos\Angel Beats!\[SS]_Angel_Beats!_-_03_(1280x720_H.264)_[7378C000].mkv':
    Metadata:
    title : Angel Beats! - Episode 03 - My Song
    creation_time : 2010-04-29 05:29:20
    Duration: 00:24:29.93, start: 0.000000, bitrate: 2144 kb/s
    Chapter #0.0: start 0.000000, end 89.965000
    Metadata:
    title : Opening
    Chapter #0.1: start 90.005000, end 735.944000
    Metadata:
    title : Part A
    Chapter #0.2: start 735.984000, end 1348.556000
    Metadata:
    title : Part B
    Chapter #0.3: start 1348.596000, end 1454.912000
    Metadata:
    title : Ending
    Chapter #0.4: start 1454.952000, end 1469.885000
    Metadata:
    title : Preview
    Stream #0:0(jpn): Video: h264 (High), yuv420p, 1280x720, SAR 185:187 DAR 2960:1683, 23.98 fps, 23.98 tbr, 1k tbn, 47
    .95 tbc
    Stream #0:1(jpn): Audio: aac, 48000 Hz, stereo, fltp (default)
    Stream #0:2: Subtitle: ssa (default)
    Metadata:
    title : Character Colour Style
    Stream #0:3(eng): Subtitle: ssa
    Metadata:
    title : Plain Style
    Codec 0x18000 is not in the full list.
    Stream #0:4: Attachment: unknown_codec
    Metadata:
    filename : Dutch 766 Bold BT.ttf
    mimetype : application/x-truetype-font
    Codec 0x18000 is not in the full list.
    Stream #0:5: Attachment: unknown_codec
    Metadata:
    filename : Hamilton-Medium.otf
    mimetype : application/x-truetype-font
    Codec 0x18000 is not in the full list.
    Stream #0:6: Attachment: unknown_codec
    Metadata:
    filename : ShinnBold.ttf
    mimetype : application/x-truetype-font
    Codec 0x18000 is not in the full list.
    Stream #0:7: Attachment: unknown_codec
    Metadata:
    filename : ShinnBoldItalic.ttf
    mimetype : application/x-truetype-font
    Codec 0x18000 is not in the full list.
    Stream #0:8: Attachment: unknown_codec
    Metadata:
    filename : ShinnDemiBold.ttf
    mimetype : application/x-truetype-font
    Codec 0x18000 is not in the full list.
    Stream #0:9: Attachment: unknown_codec
    Metadata:
    filename : ShinnMedium.ttf
    mimetype : application/x-truetype-font
    Codec 0x18000 is not in the full list.
    Stream #0:10: Attachment: unknown_codec
    Metadata:
    filename : ShinnMediumItalic.ttf
    mimetype : application/x-truetype-font
    Output #0, adts, to '..\..\output1.aac':
    Metadata:
    title : Angel Beats! - Episode 03 - My Song
    encoder : Lavf55.8.102
    Chapter #0.0: start 0.000000, end 3.254000
    Metadata:
    title : Part A
    Chapter #0.1: start 3.294000, end 6.256000
    Metadata:
    title : Part B
    Stream #0:0(jpn): Audio: aac, 48000 Hz, stereo (default)
    Stream mapping:
    Stream #0:1 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    size= 97kB time=00:00:06.27 bitrate= 126.7kbits/s
    video:0kB audio:95kB subtitle:0 global headers:0kB muxing overhead 2.114934%
    The intended length is 6256ms.
    Quote Quote  
  14. Originally Posted by passlogin View Post
    Yes it is I-frame, all of them, in VirtualDub, all frames are marked [k].
    It was not 40ms off, ffmpeg appends some silence at the end..

    [SS]_Angel_Beats!_-_03_(1280x720_H.264)_[7378C000].mkv
    Very unlikely this mkv is all I-frame (encoded with intra) , I'm 99.99% certain

    The reason is you're decompressing the video in vdub (uncompressed video), because of the input filter used by vdub

    Anyways, if you know the timecodes , you can remux a .mka (audio only mkv) , and try mkvtoolnix
    Quote Quote  
  15. I don't know if external url is allowed, but this: http://forums.animesuki.com/showthread.php?t=34738 , explained why this job comes to incredibly hard.
    Quote Quote  
  16. Originally Posted by poisondeathray View Post
    Originally Posted by passlogin View Post
    Yes it is I-frame, all of them, in VirtualDub, all frames are marked [k].
    It was not 40ms off, ffmpeg appends some silence at the end..

    [SS]_Angel_Beats!_-_03_(1280x720_H.264)_[7378C000].mkv
    Very unlikely this mkv is all I-frame (encoded with intra) , I'm 99.99% certain

    The reason is you're decompressing the video in vdub (uncompressed video), because of the input filter used by vdub

    Anyways, if you know the timecodes , you can remux a .mka (audio only mkv) , and try mkvtoolnix
    The video is CFR, yet the audio is VBR [edited to prevent misunderstanding]
    Last edited by passlogin; 8th Jun 2013 at 19:42.
    Quote Quote  
  17. Originally Posted by passlogin View Post
    I don't know if external url is allowed, but this: http://forums.animesuki.com/showthread.php?t=34738 , explained why this job comes to incredibly hard.

    Video is VFR, but audio is CFR (audio is always CFR) .


    Originally Posted by passlogin View Post
    The video is CBR, yet the audio is VBR
    VFR, CFR, VBR, CBR are all different things

    Frame rate and Bit Rate are 2 different things

    When you demux into a mka, it should all be CFR timecodes (no more VFR).
    Quote Quote  
  18. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by passlogin View Post
    I don't know if external url is allowed, but this: http://forums.animesuki.com/showthread.php?t=34738 , explained why this job comes to incredibly hard.

    Video is VFR, but audio is CFR (audio is always CFR).
    Not very-true. Compressed audio MAY use Variable Frame Duration, though MOST formats wisely don't do that.
    WMA may have Variable Frame Duration, and Vorbis always has Variable Frame Duration. BTW, several lossless audio formats use VFD as well.
    Quote Quote  
  19. Originally Posted by El Heggunte View Post
    Originally Posted by poisondeathray View Post
    Originally Posted by passlogin View Post
    I don't know if external url is allowed, but this: http://forums.animesuki.com/showthread.php?t=34738 , explained why this job comes to incredibly hard.

    Video is VFR, but audio is CFR (audio is always CFR).
    Not very-true. Compressed audio MAY use Variable Frame Duration, though MOST formats wisely don't do that.
    WMA may have Variable Frame Duration, and Vorbis always has Variable Frame Duration. BTW, several lossless audio formats use VFD as well.

    Technically , audio doesn't have "frame duration", but I guess you mean variable sample rate ? I remember some posts about WMA variable sample rates

    I guess a better way of saying it is "VFR" refers to video only, not audio. The timecodes govern frame display time for the video, not audio playback .
    Last edited by poisondeathray; 8th Jun 2013 at 15:36.
    Quote Quote  
  20. But, strangely, why audio and video have different timecodes? My guess are they run at different speed
    Sorry about that: the audio is VBR
    Wait, wait. Why audio's timecode had more frames defined that its video counterpart?

    Video:
    # timecodes format v1
    Assume 29.970
    1,35243,23.976
    Audio:
    # timecodes format v1
    Assume 29.970
    1,68903,46.953
    Quote Quote  
  21. Originally Posted by passlogin View Post
    But, strangely, why audio and video have different timecodes? My guess are they run at different speed
    Sorry about that: the audio is VBR
    Wait, wait. Why audio's timecode had more frames defined that its video counterpart?

    Video:
    # timecodes format v1
    Assume 29.970
    1,35243,23.976
    Audio:
    # timecodes format v1
    Assume 29.970
    1,68903,46.953

    VBR audio is difficult to edit precisely and can often be problematic, this was mentioned earlier by Scott

    These timecodes are for CFR video . Notice there are no changes , every frame is the same . VFR video would have entries representing where the frame rate changes - again, that's the VIDEO frame rate

    Audio doesn't use v1 timecodes like this (it's only for video), the reason it's different is just assuming a different timebase (notice it's double the fps, but double the number of frames)
    Quote Quote  
  22. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Technically , audio doesn't have "frame duration", but I guess you mean variable sample rate ? I remember some posts about WMA variable sample rates
    Well, just keep in mind that a video frame is a rectangle between two video timestamps , whereas an audio frame is a small set of audio samples.

    Variable playback-rate happens when an evil audio format is either wrapped in an inadequate container (AVI, which doesn't have such thing as audio timestamps), OR is parsed in a way that ignores the audio timestamps.

    http://forum.doom9.org/showthread.php?p=1513679#post1513679

    Originally Posted by passlogin View Post
    Any app you know to trim AAC without reencoding?
    eac3to. BUT 1) it's a command-line application and 2) you must know what you're trying to achieve.
    Last edited by El Heggunte; 9th Jun 2013 at 03:26.
    Quote Quote  
  23. Thanks for your advice.
    Then if audio don't use timecodes, what will it use?
    Oh yeah, audio frame? never heard that before.
    Quote Quote  
  24. Originally Posted by poisondeathray View Post
    Originally Posted by passlogin View Post
    Yes it is I-frame, all of them, in VirtualDub, all frames are marked [k].
    It was not 40ms off, ffmpeg appends some silence at the end..

    [SS]_Angel_Beats!_-_03_(1280x720_H.264)_[7378C000].mkv
    Very unlikely this mkv is all I-frame (encoded with intra) , I'm 99.99% certain

    The reason is you're decompressing the video in vdub (uncompressed video), because of the input filter used by vdub

    Anyways, if you know the timecodes , you can remux a .mka (audio only mkv) , and try mkvtoolnix
    If i know the timecodes, how do i?
    I prefer frame accuracy instead of timecodes.
    I've found it on global tab of mkvmerge, is it right?
    Quote Quote  
  25. Originally Posted by passlogin View Post
    Then if audio don't use timecodes, what will it use?
    Samples/Sec. This is how the pros "cheat" 23.976 to 24, by modifying the expected sample rate.
    Quote Quote  
  26. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    It's also known as pull-down (not to be confused with Telecine's Pull-down: 24->23.976 is a pull-down of 0.1% and 23.976/24->29.97/30 is a pull-down of 20%).

    Scott
    Quote Quote  
  27. Seems it better to remux with mkvmerge, since the difference between intended length with the output length is just 13ms
    Quote Quote  



Similar Threads

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