Page 1 of 1
Process MP4s audio muxed incorrectly with DTS header
Posted: Sat Sep 24, 2016 4:19 am
by silicontrip
Hi There,
We've encountered mp4 files where the audio has been incorrectly muxed with a DTS header. FFAStrans produces files with choppy out of sync audio.
ffmpeg is able to fix these files with use of the bitstream filter "aac_adtstoasc"
Code: Select all
ffmpeg -i broken.mp4 -acodec copy -vcodec copy -bsf:a aac_adtstoasc fixed.mp4
Is it possible to detect these files and include this bitstream filter in FFAStrans?
Thanks
Mark
Re: Process MP4s audio muxed incorrectly with DTS header
Posted: Sat Sep 24, 2016 1:20 pm
by admin
Are there any particular scenarios where FFAStrans creates these faulty files? And I assume you're using the "MP4"-encoder?
Anyway, you can use the "Custom FFmpeg"-encoder node to create your own encoder setup. Your issue should be trivial to fix using this method
-steinar
Re: Process MP4s audio muxed incorrectly with DTS header
Posted: Sat Sep 24, 2016 1:28 pm
by silicontrip
FFASTrans does not create these files. I am referring to source files that have been incorrectly created by other programs, which we are trying to transcode into XDCAM.
Currently FFAStrans transcodes these files without reporting an error but the resulting audio is out of sync and "choppy" these files first must be processed by ffmpeg to correct the audio. Would it be possible to detect these types of files and run the ffmpeg fix as a processor?
Thanks
Mark
Re: Process MP4s audio muxed incorrectly with DTS header
Posted: Sat Sep 24, 2016 2:06 pm
by admin
Have you tried running these files without the "A/V Media"-decoder node?
If you could share with me some file(s) that initiates the issue it would be easier for me to investigate the possibility to pick up these anomalies.
-steinar
Re: Process MP4s audio muxed incorrectly with DTS header
Posted: Mon Sep 26, 2016 3:32 am
by silicontrip
I hooked the Folder watcher directly to the XDCAM encoder. The audio sounds correct (not choppy) but still has synchronization issues with the video. The video appears to be dropping frames. The source files are clearly incorrect. I have not found a transcoder that can deal with them properly.
https://www.dropbox.com/s/f80ojtkgm61x2 ... ond-22.mp4
the only way I've been able to detect these files is with the following ffmpeg command;
Code: Select all
ffmpeg -i m-mh-football-richmond-22.mp4 -vcodec copy -acodec copy out.mp4
which produces the following error;
Code: Select all
[mp4 @ 0x7fa91a020600] Malformed AAC bitstream detected: use the audio bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
av_interleaved_write_frame(): Operation not permitted
Mark
Re: Process MP4s audio muxed incorrectly with DTS header
Posted: Mon Sep 26, 2016 9:04 am
by admin
Hi Mark and thank you for sharing the problem file
I've been looking it and the video seem to have has variable frame rate balancing at around 24.98 fps. There are also some bad PTS but that may just be due to the variable fps?. "Fixing" the video using using the bitstream filter in ffmpeg cause the framerate to drop to around 24.93. So you will still have a problem with some encoders. However, I've been able to get good decoding and encoding using the "A/V Media"-decoder in intelligent mode. The audio and video is in sync and not choppy using and XDCAM 35 mbit, 50i fps mxf profile. At least not what I can see or hear. I have checked the file using Premiere 9 looking at frame by frame and carefully looking at sync.
Anyway, I will take a look at how I can further improve picking up failed conversions and your issue will be very helpfull in this regard!
-steinar
Re: Process MP4s audio muxed incorrectly with DTS header
Posted: Tue Sep 27, 2016 2:41 am
by silicontrip
Maybe it was the different encoder I was trying before getting bmxtranswrap installed.
I've checked these clips and they sound OK now.
Mark