View Full Version : VD2 External Encoder questions
poisondeathray
26th November 2018, 08:07
So it played ok, in quicktime , BS player too , before "stream copy" ?
There are other differences that are not revealed by mediainfo ; for example MP4 container spec differences . Do you recall AVI container 2.0 openDML vs. 1.0 ? It's somewhat similar to that - there are different types of MP4 containers. Also there are box differences , that might play a role in the compatibility issues .
You can check more detail on the box information
MP4Box -info -v file.mp4
In post #46 you were extracting mp3 (maybe you specified mp3 in the command) , but the stream has AAC audio . So that's why it doesn't work for that particular one . You'd have to change the command to "AAC" instead of mp3
[mp3 @ 0254d680] Invalid audio stream. Exactly one MP3 audio stream is required.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
MediaInfo for that exact file:
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Or use something else like mp4box, which has a demux all streams command , regardless of what type they are (sort of a *wildcard ) , but if you have a zillion streams, it's a lot of clutter if you want only audio
MP4Box -raw * INPUT.mp4
stormy1777
26th November 2018, 09:20
Thanks for the thought of mp4box/syntax :)
Yes, bsplayer and VD2 opened and play the original .mp4 just fine.
Then load this mp4 into vd2 set both video/audio to direct copy stream (video add map avc1 -> h264 as mentioned above), then the SAVED mp4 is not playable in bsplayer and loads with "no video" in VD2 (using the quicktime I/D).
Original file mp4box info:
[iso file] Current top box start before parsing 0
[iso file] Read Box type ftyp size 24 start 0
[iso file] Current top box start before parsing 24
[iso file] Read Box type moov size 263724 start 24
[iso file] Read Box type mvhd size 108 start 32
[iso file] Read Box type iods size 21 start 140
[iso file] Read Box type trak size 211331 start 161
[iso file] Read Box type tkhd size 92 start 169
[iso file] Read Box type edts size 36 start 261
[iso file] Read Box type elst size 28 start 269
[iso file] Read Box type mdia size 211195 start 297
[iso file] Read Box type mdhd size 32 start 305
[iso file] Read Box type hdlr size 78 start 337
[iso file] Read Box type minf size 211077 start 415
[iso file] Read Box type vmhd size 20 start 423
[iso file] Read Box type dinf size 36 start 443
[iso file] Read Box type dref size 28 start 451
[iso file] Read Box type url size 12 start 467
[iso file] Read Box type stbl size 211013 start 479
[iso file] Read Box type stsd size 177 start 487
[iso file] Read Box type avc1 size 161 start 503
[iso file] Read Box type avcC size 55 start 589
[iso file] Read Box type btrt size 20 start 644
[iso file] Read Box type stts size 24 start 664
[iso file] Read Box type ctts size 137032 start 688
[iso file] Read Box type stss size 304 start 137720
[iso file] Read Box type stsc size 52 start 138024
[iso file] Read Box type stsz size 70952 start 138076
[iso file] Read Box type stco size 2464 start 209028
[iso file] Read Box type trak size 52256 start 211492
[iso file] Read Box type tkhd size 92 start 211500
[iso file] Read Box type mdia size 52156 start 211592
[iso file] Read Box type mdhd size 32 start 211600
[iso file] Read Box type hdlr size 33 start 211632
[iso file] Read Box type minf size 52083 start 211665
[iso file] Read Box type smhd size 16 start 211673
[iso file] Read Box type dinf size 36 start 211689
[iso file] Read Box type dref size 28 start 211697
[iso file] Read Box type url size 12 start 211713
[iso file] Read Box type stbl size 52023 start 211725
[iso file] Read Box type stsd size 91 start 211733
[iso file] Read Box type mp4a size 75 start 211749
[iso file] Read Box type esds size 39 start 211785
[iso file] Read Box type stts size 24 start 211824
[iso file] Read Box type stsc size 1768 start 211848
[iso file] Read Box type stsz size 47824 start 213616
[iso file] Read Box type stco size 2308 start 261440
[iso file] Current top box start before parsing 263748
[iso file] Read Box type mdat size 288453475 start 263748
[iso file] Current top box start before parsing 288717223
[iso file] Read Box type free size 68 start 288717223
* Movie Info *
Timescale 600 - 2 tracks
Computed Duration 00:04:55.845 - Indicated Duration 00:04:55.845
Fragmented File: no
File suitable for progressive download (moov before mdat)
File Brand isom - version 1
Compatible brands: isom avc1
Created: GMT Sun Nov 18 23:02:38 2018
Modified: GMT Sun Nov 18 23:02:38 2018
File has root IOD (9 bytes)
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: AVC/H264 Profile (0x7f)
Audio PL: AAC Profile @ Level 2 (0x29)
No streams included in root OD
Track # 1 Info - TrackID 1 - TimeScale 60000
Media Duration 00:04:55.845 - Indicated Duration 00:04:55.845
Track has 1 edit lists: track duration is 00:04:55.845
Media Info: Language "Undetermined (und)" - Type "vide:avc1" - 17733 samples
Visual Track layout: x=0 y=0 width=1280 height=720
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 1280 x 720
AVC Info: 1 SPS - 1 PPS - Profile High @ Level 4
NAL Unit length bits: 32
Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8
SPS#1 hash: 191F16CB9368F06DEA4720FF8E26A9C31FB3DC06
PPS#1 hash: 29D6EFAC804419693591849CA4E983253AD0B9D7
Self-synchronized
RFC6381 Codec Parameters: avc1.640028
Average GOP length: 249 samples
Track # 2 Info - TrackID 2 - TimeScale 44100
Media Duration 00:04:37.501 - Indicated Duration 00:04:37.501
Media Info: Language "Undetermined (und)" - Type "soun:mp4a" - 11951 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 44100
Synchronized on stream 1
RFC6381 Codec Parameters: mp4a.40.2
All samples are sync
Running the identical mp4box command on the SAVED mp4 produces this output:
[iso file] Current top box start before parsing 0
[iso file] Read Box type ftyp size 32 start 0
[iso file] Current top box start before parsing 32
[iso file] Read Box type free size 8 start 32
[iso file] Current top box start before parsing 40
[iso file] Read Box type mdat size 288456355 start 40
[iso file] Current top box start before parsing 288456395
[iso file] Read Box type moov size 328475 start 288456395
[iso file] Read Box type mvhd size 108 start 288456403
[iso file] Read Box type trak size 232119 start 288456511
[iso file] Read Box type tkhd size 92 start 288456519
[iso file] Read Box type edts size 36 start 288456611
[iso file] Read Box type elst size 28 start 288456619
[iso file] Read Box type mdia size 231983 start 288456647
[iso file] Read Box type mdhd size 32 start 288456655
[iso file] Read Box type hdlr size 45 start 288456687
[iso file] Read Box type minf size 231898 start 288456732
[iso file] Read Box type vmhd size 20 start 288456740
[iso file] Read Box type dinf size 36 start 288456760
[iso file] Read Box type dref size 28 start 288456768
[iso file] Read Box type url size 12 start 288456784
[iso file] Read Box type stbl size 231834 start 288456796
[iso file] Read Box type stsd size 110 start 288456804
[iso file] Read Box type avc1 size 94 start 288456820
[iso file] Read Box type avcC size 8 start 288456906
[iso file] Read Box type stts size 24 start 288456914
[iso file] Box "stts" is larger than container box
[iso file] Box "stts" is invalid in container avc1
[iso file] Box "avc1" size 94 invalid (read 118)
[iso file] Read Box type stts size 24 start 288456914
[iso file] Read Box type stss size 304 start 288456938
[iso file] Read Box type stsc size 112552 start 288457242
[iso file] Read Box type stsz size 70952 start 288569794
[iso file] Read Box type stco size 47884 start 288640746
[iso file] Read Box type trak size 96142 start 288688630
[iso file] Read Box type tkhd size 92 start 288688638
[iso file] Read Box type edts size 36 start 288688730
[iso file] Read Box type elst size 28 start 288688738
[iso file] Read Box type mdia size 96006 start 288688766
[iso file] Read Box type mdhd size 32 start 288688774
[iso file] Read Box type hdlr size 45 start 288688806
[iso file] Read Box type minf size 95921 start 288688851
[iso file] Read Box type smhd size 16 start 288688859
[iso file] Read Box type dinf size 36 start 288688875
[iso file] Read Box type dref size 28 start 288688883
[iso file] Read Box type url size 12 start 288688899
[iso file] Read Box type stbl size 95861 start 288688911
[iso file] Read Box type stsd size 103 start 288688919
[iso file] Read Box type mp4a size 87 start 288688935
[iso file] Read Box type esds size 51 start 288688971
[iso file] Read Box type stts size 24 start 288689022
[iso file] Read Box type stsc size 28 start 288689046
[iso file] Read Box type stsz size 47824 start 288689074
[iso file] Read Box type stco size 47820 start 288736898
[iso file] Read Box type sgpd size 26 start 288784718
[iso file] Read Box type sbgp size 28 start 288784744
[iso file] Read Box type udta size 98 start 288784772
[iso file] Read Box type meta size 90 start 288784780
[iso file] Read Box type hdlr size 33 start 288784792
[iso file] Read Box type ilst size 45 start 288784825
[iso file] Read Box type .too size 37 start 288784833
[iso file] Read Box type data size 29 start 288784841
* Movie Info *
Timescale 1000 - 2 tracks
Computed Duration 00:04:55.846 - Indicated Duration 00:04:55.846
Fragmented File: no
File Brand isom - version 512
Compatible brands: isom iso2 avc1 mp41
Created: UNKNOWN DATE Modified: UNKNOWN DATE
File has no MPEG4 IOD/OD
iTunes Info:
Encoder Software: Lavf57.78.100
1 UDTA types: meta (1)
Track # 1 Info - TrackID 1 - TimeScale 60000
Media Duration 00:04:55.845 - Indicated Duration 00:04:55.845
Track has 1 edit lists: track duration is 00:04:55.846
Media Info: Language "Undetermined (und)" - Type "vide:avc1" - 17733 samples
Visual Track layout: x=0 y=0 width=1280 height=720
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 1280 x 720
This is TRIMMED, as the program CRASHES... the 3 lines in bold are coming out as YELLOW, rest are GREEN.
so maybe the mp4 container that VD2 produces is not "correct"?
Stormy.
stormy1777
26th November 2018, 10:15
OK, you are right, the AnotherGUI failure to extract the audio is b/c it is AAC and not MP3.. (those few files are from external encoding, could not get the mp3 there going, but that's old news).. mp4box -raw extracted all just fine!
The real issue seems like VD2 saving (in direct stream video and audio) of a valid mp4 produces an mp4 that opens with black 'NO VIDEO' in VD2 itself (and does not play in bsplayer), and mp4box crashes on -info and extract VIDEO operation, it does manage to extract the audio in this case. Can easily reproduce, even on mp4 with mp3 in them (not aac)..
Stormy.
shekh
26th November 2018, 14:22
> Box "stts" is larger than container box
Something I need to check. The muxing is performed by FFmpeg library and I expect it to either fail altogether or produce valid file. Well, missing headers and stuff is one thing but invalid box size is really weird.
For me same experiment gave "cannot parse file" error from quicktime driver.
hello_hello
26th November 2018, 18:54
I couldn't duplicate the problem with Direct Stream Copy. I opened one of the MP4s I created yesterday when playing around (with the QuickTime Input Driver) and Direct Stream Copy for the video and audio worked fine. The new MP4 opened in MPC-HC and VD2.
The only oddity I did notice was when I opened the newly created MP4 with VD2 and looked at File Information, the QuickTime Input Driver identified the audio as 64000Hz AAC when it was in fact 44100Hz MP3. I couldn't extract it and when I tried (Extract/Raw Audio), the Save window defaulted to a .bin extension. When I opened the new MP4 with the ffmpeg option, File Information showed it as an MP3 and it extracted okay. MediaInfo identified the codec as mp4a-6B, so I'm not sure what the problem is there.
stormy1777
26th November 2018, 21:42
Try running: MP4Box -info -v file.mp4 on both files, on the saved one it crashes on my test.
When i open (using quicktime I/D - with the AVC1 -> H264 Mapping in Options) the saved mp4 shows up as 'NO VIDEO' when reopened in VD2 using same sequence; bsplayer does not play it (just audio works), but VLC does.. the "smoking gun" though is that mp4box -info is showing some warnings/errors and crashes, that should not happen I suspect... These "symptoms" may depend on the source mp4...
This appears *video* related, since even saving with *no-audio* results in "strangeness" with regards to the mp4 container/validity as tested by bsplayer (does not play), VD2 and mp4box -info crashing.
I guess it'll be easier to sleep at night knowing that resave in direct stream works smoothly... it's a good test/validation of VD2/mp4 interaction..
Stormy.
hello_hello
27th November 2018, 15:26
I didn't try "quicktime I/D - with the AVC1 -> H264 Mapping" because if that's necessary, then I think something's wrong.
I thought I'd confused myself for a while, as today I did seem to be having problems remuxing MP4s, but then I remembered I resized the input video at some stage. The input's an Avisynth script. Originally 720x480 but I'd resized it to 1280x720 to test something. So I double checked and that was the problem. The 1280x720 encoded video won't remux successfully (MP4Box and VD2 both crash when trying to open the remuxed version), whereas the 720x480 video will open.
Then I thought I should check, and discovered I was using an old version of the QuickTime Input Driver. After I updated it, when I tried to remux any MP4, it complained about the codec not being supported in an MP4 container. When I tried to use it to open an MP4 I'd already remuxed with the old version (v1.6) VD2 showed "No Video".
The import log said "Video track 1 (AVC) is missing the Decoder Configuration Record."
The same remuxed mp4 opened with the Caching Input Driver though, so at that point I decided to stop caring about it.
I think all you're proving with this remuxing experiment is there's a problem with the QuickTime Input Driver and Direct Stream Copy. If MP4Box doesn't have a problem with the original MP4 then why worry? Anyway, below is what happens for me when I look at the remuxed MP4 created with version 1.6 of the QuickTime Input Driver. MP4Box displays the following before crashing. Ignore the error at the top. I initially thought -v specified "video", not "verbose". When I used it with -info, I didn't see any "Box "stts" is larger than container box" type problems in the log.
https://i.postimg.cc/ZKLSMSwB/mp4box.gif
shekh,
Does VD2 store the external encoder configuration in the registry? Not that I care, but I downloaded the most recent VD2 today and put it in a fresh folder and I was surprised to see my external encoder configuration intact. I assumed it'd be empty and I'd have to export/import.
Oh.... and thanks for the continued XP compatibility (or at least no problems with the latest version so far).
shekh
27th November 2018, 16:51
> AVC1 to H264 Mapping
Yes it is something wrong. Somehow qucktime driver reports FOURCC as "AVC1" but ffmpeg list of tags includes "avc1" (lowercase). Can be fixed but now this experimental workaround (which anyway proved the procedure is faulty).
> Does VD2 store the external encoder configuration in the registry?
Yes, or virtualdub.ini if you use portable settings. This behavior is old (not changed in vd2).
> thanks for the continued XP compatibility
Cheers, I keep old XP box for this :)
stormy1777
27th November 2018, 17:57
Hello^2:
Using latest (stable) of everything as far as i know, since i just now embarked on switching from using AVI to MP4... So, mp4box:
mp4box -version
MP4Box - GPAC version 0.7.0-rev0-gbd5c9af-master
GPAC Copyright (c) Telecom ParisTech 2000-2012
Quicktime shows as version 2.6 in VD2, on Win7: system Quicktime 7.7.9 is installed.
The mentioned MP4 were externally encoded and muxed using mp4box, and play on all players including VD2, bsplayer, vlc, etc.
If MP4Box doesn't have a problem with the original MP4 then why worry?
It is very possible that I'll need to re-mux another audio, or edit video *slightly*, but as it stands, VD2 cannot handle these (externally encoded) mp4 files (in DIRECT COPY STREAM) without producing an MP4 that is not valid even for itself, i.e. shows 'NO VIDEO' when loaded, does not play in bsplayer and causes mp4box to crash, even with just -info flag.
The solution I've used on these mp4 is open with quicktime I/D and save as *AVI*, again, in 'direct copy', then all works fine.... I was trying to keep up with the times, but really not see a huge advantage for MP4 over AVI in my limited use cases, maybe in few more years mp4 will mature and standardize better... I really don't need to be on the cutting edge if you know what I mean :)
I'm surprised how you managed to do direct copy stream without the AVC1->H264 mapping on open...
Stormy.
stormy1777
27th November 2018, 18:22
Indeed in many cases seeing 'avc1' in lowercase whereas in other cases 'AVC1' in UPPERCASE, reading online it says fourcc is case sensitive, and should be UPPERCASE? maybe there is some "editor" that can just change that to upper case :)
stormy1777
28th November 2018, 12:00
For the record: updated bsplayer to latest (2.73) and these saved mp4 do play in it, however still mp4box info crashes and VD2 itself shows 'NO VIDEO' when opened using QuickTime I/D.. definitely something going on... Saved as AVI until this is sorted out :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.