VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 6 of 6
  1. I use the following command to trim the start and end off of .mp4 files and the files output are playable, mostly, but they don't have a height and width attribute when you inspect it in Windows explorer. Also, some browsers (IE and Firefox mostly) have trouble playing them over the web when they are embedded in a page that uses the jplayer video player. Some people with those browsers can play them, but many cannot play them.

    Is there a way to force mp4box to add these attributes back?

    Here's the command I use:

    MP4Box.exe -splitx 10:70 "myInputFile.mp4" -out "myOutputFile_tmp.mp4"

    This does a great job of giving me the 60 seconds starting at 10 seconds into the video, but the output file shows up in a Windows Explorer directory listing without a Height and Width attribute. And if I inspect file properties in Windows Explorer in the Details tab all of the attributes in the Video and Audio sections are blank.

    Name:  temp.png
Views: 4104
Size:  25.7 KB

    Here is the output file info from the Mediainfo utility:

    Complete name : myOutputFile.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom
    File size : 225 MiB
    Duration : 42mn 10s
    Overall bit rate mode : Variable
    Overall bit rate : 746 Kbps
    Encoded date : UTC 2013-01-28 06:10:17
    Tagged date : UTC 2013-01-28 06:10:17

    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L3.1
    Format settings, CABAC : Yes
    Format settings, ReFrames : 2 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 42mn 10s
    Bit rate mode : Variable
    Bit rate : 697 Kbps
    Maximum bit rate : 1 875 Kbps
    Width : 960 pixels
    Height : 540 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Frame rate : 29.970 fps
    Minimum frame rate : 29.940 fps
    Maximum frame rate : 29.970 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.045
    Stream size : 210 MiB (93%)
    Language : English
    Encoded date : UTC 2013-01-27 23:16:16
    Tagged date : UTC 2013-01-28 06:11:12

    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : 40
    Duration : 42mn 10s
    Bit rate mode : Variable
    Bit rate : 45.5 Kbps
    Maximum bit rate : 60.0 Kbps
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Compression mode : Lossy
    Stream size : 13.7 MiB (6%)
    Language : English
    Encoded date : UTC 2014-03-27 23:16:16
    Tagged date : UTC 2014-03-28 06:11:12

    Any help would be greatly appreciated. mp4box has saved me days and days of work and I can still use it to save all that time when I have to edit hundreds of files quickly, but right now I have to go through the extra step of re-rendering all my output files through Any Video Converter to restore those attributes so they can play in all browsers. It would be so much nicer to just do it all without re-rendering.
    Quote Quote  
  2. not sure if the windows explorer width/height has anything to do with browser streaming

    check with mpbox on the output file (e.g. mp4box output.mp4 -v -info ) to see if it's suitable for progressive HTTP streaming (moov should be before mdat). Some mp4box builds shift the moov atom automatically

    if not, add -hint to prepare for rtp streaming, and -inter to interleave and move the moov atom before mdat (e.g. -hint -inter 500 )
    Quote Quote  
  3. I had already used
    MP4Box.exe -hint -inter 500 "myInputfile.mp4" -out "myOutputFile.mp4"
    but it does not eliminate the problem above, that they just don't play at all through certain versions of IE and Firefox over the web.

    I've heard that Firefox and IE both use components of Windows Media Player to play back video, so it makes sense entirely that if Windows Explorer can't detect that these files are video files that other MS components may have problems as well.

    So if something I am doing or not doing with mp4box is stripping out height/width/length/data rate/bitrate etc. metadata as is shown in the screenprint above, is there anything short of re-rendering that will restore those attributes? Right now I'm forced to re-render entirely and if anyone knows how to avoid this behavior in the first place or restore the metadata without re-rending, that would be fantastic.
    Quote Quote  
  4. So is your question more about windows explorer, not playback in browsers ?

    Or are you 100% certain there is a link between windows explorer details and the browser playback issues ? This sounds more like some anecdotal observation

    Are you saying re-encoding it in any video converter produces files that display width/height in windows explorer? It uses ffmpeg / mencoder . So if you cut with ffmpeg or mencoder instead of mp4box, it should be using the same muxer. If the culprit was the MP4Box muxer, then that should fix it . If the reason is something else (e.g. maybe some header info at the beginning was discarded), then that won't work

    Or batch re-wrap the files that you've already cut with mp4box with ffmpeg or mencoder once you've confirmed that works

    Firefox and IE don't use WMP components , unless it's a streaming WMV file
    Quote Quote  
  5. The equivalent command in ffmpeg for what you're doing with mp4box would be -ss for start time -t for duration . So if I wanted a minute long clip starting from 10seconds in :


    ffmpeg -i input.mp4 -c:v copy -c:a copy -ss 00:00:10 -t 00:01:00 -movflags faststart output.mp4
    I don't see width/height in windows explorer, but I might be setup or configured differently . Or my test file was different to begin with. Or any video converter might be using a different binary, different compile or something specifically modified

    Just a minor gripe with terminology, but "crop" used in your title in the video world usually means cutting the edges (e.g. left, top, right , bottom), not specifying start and end points
    Quote Quote  
  6. My solution:
    I run the video through mp4box twice.

    First this to trim it from the 0:30 second mark to the 600 second mark.
    MP4Box.exe -splitx 30:600 "d:\myFiles\myVideo.mp4" -out "d:\myFiles\myOutput01.mp4"

    Then reprocess to make sure moov is before mdat. I've forgotten what 500 is for.
    MP4Box.exe -inter 500 -add "d:\myFiles\myOutput01.mp4#1:lang=en:fps=29.97 0" -add "d:\myFiles\myOutput01.mp4#2:lang=en" -v "d:\myFiles\myOutput02.mp4"

    So myOutput02.mp4 now contains the metadata info correctly, and I delete myOutput01.mp4.
    Quote Quote