VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 52
  1. Can anybody help. This is strange. I have a 1080i file HERE
    I chose to save (mux) in VideoRedo but re-encode the audio to WAV. The resulting file plays back fine but VideoRedo seems to have added a -120ms delay.

    I demuxed the MKV with WAV of the source I provided in the link. But when I try to re-mux it in TSmuxer or MKVMerge the resulting video has artifacts in the video. Why does that happen?

    I don't have any problems doing this with standard definition video so why does it happen with HD video?

    It doesn't seem to matter if the audio is WAV or AC3. I get the same artifacts.

    I should point out that these videos are copied directly from my satellite receiver. I've noticed that when I re-encode the video and then demux and remux it, the video is fine. Yet demuxing and remuxing the source gives artifacts on the video.

    Another problem is that I can't seem to remove the delay in the video. I need to remove the delay otherwise when I re-encode with MEGUI the audio will be out of sync.
    Last edited by MrBiggles; 1st Jun 2015 at 07:27.
    Quote Quote  
  2. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by MrBiggles View Post
    I don't have any problems doing this with standard definition video so why does it happen with HD video?

    It doesn't seem to matter if the audio is WAV or AC3. I get the same artifacts.
    Maybe your computer is too slow
    Perhaps your video card is too old
    Perhaps both of the above?

    Sorry, but only uninformed people still use google-drive
    Quote Quote  
  3. It's none of those reasons and what's wrong with Google Drive? It does exactly what I require of it.

    I should point out that these videos are copied directly from my satellite receiver. I've noticed that when I re-encode the video and then demux and remux it, the video is fine. Yet demuxing and remuxing the source gives artifacts on the video.
    Quote Quote  
  4. everything is fine here, demuxed with eac3to (because inside were formats all friendly to eac3to), audio re-encoded with eac3to and remuxed with mkvmerge. Audio is slightly out of sync, but that was in the original as well.
    Image Attached Files
    Quote Quote  
  5. Thanks. Is there a GUI for eac3to?

    Have you tried TSMuxer to demux and remux? Just wondering if you get the same problems that I did?
    Quote Quote  
  6. yes, I just tried tsMuxer for demux, mkvmerge for re-mux, I got artifacts
    Image Attached Files
    Quote Quote  
  7. Thanks Al. It's one of the weirdest things I've ever seen. How on earth does muxing a video cause artifacts when the video hasn't been re-encoded?

    What settings did you use in Eac3to?
    Quote Quote  
  8. I used cmd line:
    Code:
    "C:\tools\eac3to\eac3to.exe"  "I:\download\1080i Source.mkv" 1: "X:\demux\1080i Source\Video.*" 2: "X:\demux\1080i Source\Audio_English_raw.PCM"
    Quote Quote  
  9. save this text to something.BAT, and just drop your mkv TV recording on it, it will produce remuxed MKV,
    before first use correct those paths for eac3to.exe and mkvmerge.exe, find out what correct paths are in your PC,
    remember, it is a batch script, so no weird characters in paths and names, just simple alphabetic characters and numbers, spaces, underscore,..., special characters, like parenthesis would crash script ...:
    Code:
    @echo off
    setlocal
    set eac3to="C:\tools\eac3to\eac3to.exe"
    set mkvmerge="C:\tools\mkvmerge\mkvmerge.exe"
    
    if "%~n1"=="" echo drop that TV recording with video and PCM audio into this batch file & endlocal & pause & exit
    if not "%~n2"=="" echo only one file at a time & endlocal & pause & exit
    if /i not "%~x1"==".mkv" echo only mkv for this batch file & endlocal & pause & exit
    
    %eac3to%  "%~1" 1: "%~dp1\Video.*" 2: "%~dp1\Audio.PCM"
    %eac3to% "%~dp1\Audio.PCM" "%~dp1\Audio.AC3" -256
    %mkvmerge% -o "%~dp1\remuxed_%~n1.mkv"  "--forced-track" "0:no" "--default-duration" "0:50i" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "%~dp1\Video.h264" ")" "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "%~dp1\Audio.AC3" ")" "--track-order" "0:0,1:0"
    
    endlocal
    echo press a key to exit ...
    pause>nul
    exit
    Last edited by _Al_; 30th May 2015 at 18:20.
    Quote Quote  
  10. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by MrBiggles View Post
    How on earth does muxing a video cause artifacts when the video hasn't been re-encoded?
    Incorrect multiplexing OR incorrect de-multiplexing may cause problems for the audio-video synchronization...
    The video artifacts are one of the possible results.

    Originally Posted by MrBiggles View Post
    It's none of those reasons and what's wrong with Google Drive?
    It was designed by and for "excessively-jovial" people
    Image Attached Thumbnails Click image for larger version

Name:	gaydrive.png
Views:	141
Size:	117.9 KB
ID:	31976  

    Quote Quote  
  11. The issue is probably with top/bottom field first, I have bumped into this issue as well but am unsure how to fix it.
    Quote Quote  
  12. Thanks that works however I wanted to keep the audio as Wav. The remuxed MKV the script makes plays back fine. However what I want to do is demux the video and audio then do work on the wav in an audio editor then mux everything back. Your script makes a video and audio file. If I remux them with TSmuxer or any muxer, the artifacts appear again. I also tried demuxing the remuxing the remuxed file produced by your script and the same happens when I remux.

    Is it possible to have a script to remux a wav & h264 file so the resulting file doesn't have video artifacts?
    If so would you be able to provide me with a script that demuxes a mkv with Wav.
    And another script that remuxes a h264 with wav. Thanks
    Quote Quote  
  13. Just avoid tsmuxer. As soon as it touches it, it appears you get problems. Demux it with mkvextract instead, mux with mkvmerge instead
    Quote Quote  
  14. When demuxed with mkvextract , remuxing with the 2.6.12 version of tsmuxer => artifacts unless you don't change SEI, VUI data and don't insert SPS/PPS (unchckmark it) . So it appears those default options caused the problem. Interestingly, the old stable tsmuxer version didn't hav those problems even with those options enabled (default)
    Quote Quote  
  15. Used MKVExtract then muxed with TSMuxer Old version 1.10.6 and didn't get artifacts. However muxed file (not uploaded here) still has a delay. I need the muxed file to NOT have a delay otherwhise when I go to re-encode with MeGUI, the resulting file will be out of sync. Any suggestions?
    Quote Quote  
  16. Used MKVExtract then muxed with TSMuxer Old version 1.10.6 and didn't get artifacts. However muxed file (not uploaded here) still has a delay. I need the muxed file to NOT have a delay otherwhise when I go to re-encode with MeGUI, the resulting file will be out of sync. Any suggestions?

    I found one of your batch scripts a while ago. From a MKV AAC file, it normalizes AAC audio and demuxes AAC. It also generates a TS file with AAC. It also removes any delay in the file. Could you please give me a script like that but which just demuxes a MKV with WAV.

    I would then edit the audio in an editor. Then I would use another batch file of yours which muxes them together again. Could you give me a script like that please.


    Code:
    "C:\Portable Installations\MKV Toolnix\mkvextract.exe"  --ui-language en tracks %1 0:"video.h264" 1:"gain0.m4a"
    
    "C:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "gain0.m4a" -vn -c:a copy -absf aac_adtstoasc "gain.m4a"
    
    "C:\Portable Installations\AAC Gain 1.9\aacgain" -r -k -m 0 gain.m4a
    
    "C:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i gain.m4a -map 0:0 -vn -c:a copy "%~d1%~p1%~n1.aac" -map 0:0 -vn -c:a ac3 -b:a 128k "output.ac3"
    
    SET tsmuxer="C:\Portable Installations\tsMuxeR_1.10.6\tsMuxeR.exe"
    echo MUXOPT --no-pcr-on-video-pid --vbr  --vbv-len=500         > remux.meta       
    echo V_MPEG4/ISO/AVC, "video.h264", insertSEI, contSPS        >> remux.meta   
    echo A_AC3, "output.ac3"                                      >> remux.meta
    %tsmuxer% remux.meta "%~d1%~p1%~n1.AC3.ts"
    DEL /Q remux.meta
    
    del gain.m4a
    del gain0.m4a
    del video.h264
    del output.ac3
    
    "C\Sounds\Completed Sound Short.WAV"
    
    pause
    Quote Quote  
  17. When you demux with mkvextract, the existing muxing delay is removed . If that muxing delay was used to keep things in sync, if you remux without that same delay it will be out of sync

    If your source files had no delay to begin with, then it doesn't matter
    Quote Quote  
  18. My file source had a -120ms delay originally. When I encode with MeGUI it then has a massive delay and is out of sync even though the file reports a -200ms delay. So if the file had a delay to start with you're saying I can't use mkvextract as it will remux without the delay which was keeping everything in sync?

    So what should I do then? I need to produce a muxed file that has no delay so I can use it with MeGUI.
    Quote Quote  
  19. The file you uploaded has no muxing delay. Using mkvextract works fine, and you can do whatever you want. Or use something other than megui - that discussion was in that other thread as well . It does something stupid like using mediainfo to determine the delay (of course that's wrong often) . I don't know if it still does that.

    Since you are editing audio anyways - if your other files truly have a delay, correct them with your audio editor. A (-) audio delay means you trim the start, because the audio starts before the video. A (+) audio delay means you shoud add silence, because the video starts before the audio . Alternatively, you can edit the video. That's how you properly fix it so there is no muxing delay and the streams are perfectly aligned and you won't get problems in any program, including megui. A muxing delay is like a "band aid" solution IMO
    Last edited by poisondeathray; 31st May 2015 at 17:50.
    Quote Quote  
  20. Originally Posted by poisondeathray View Post
    When you demux with mkvextract, the existing muxing delay is removed . If that muxing delay was used to keep things in sync, if you remux without that same delay it will be out of sync

    If your source files had no delay to begin with, then it doesn't matter
    The delay isn't removed. When I mux back with MkVMerge the delay is still there. Here's my file I'm working on, it's 2GB. Isn't there anything you can suggest that will remove the delay? My audio editor is just a normalizer, it's not an audio editor as such so I can't remove the delay in that. I also tried adding a +120ms delay in MKVMerge to remove the -120ms delay but it didn't work. The resulting file had no delay but when I demux the video again the delay comes back.

    What about this script which just muxes an MKV back to an MKV:

    Code:
    "C:\FFMPEG\bin\ffmpeg.exe" -i %1 -vcodec copy -acodec copy "%~d1%~p1%~n1.MKV.mkv"
    "C\Sounds\VideoRedo Completed Sound Short.WAV"
    pause
    It works as long as the video does NOT have a delay, if it does then the script fails. Can you please fix it so it works on my video?
    Or could you fix the other script mentioned earlier so that it works with WAV?
    Quote Quote  
  21. Originally Posted by MrBiggles View Post
    Originally Posted by poisondeathray View Post
    When you demux with mkvextract, the existing muxing delay is removed . If that muxing delay was used to keep things in sync, if you remux without that same delay it will be out of sync

    If your source files had no delay to begin with, then it doesn't matter
    The delay isn't removed. When I mux back with MkVMerge the delay is still there. Here's my file I'm working on, it's 2GB. Isn't there anything you can suggest that will remove the delay? My audio editor is just a normalizer, it's not an audio editor as such so I can't remove the delay in that. I also tried adding a +120ms delay in MKVMerge to remove the -120ms delay but it didn't work. The resulting file had no delay but when I demux the video again the delay comes back.
    Maybe someone else can help, I don't feel like downloading 2GB

    Again - If there is a physical , actual, delay, you fix it in an auditor editor . That's the proper way.

    The muxing delay is removed with mkvextract. That was the reason for using mkvextract in the other thread. Thus if you demux and mux without the same delay (that kept it in sync), it will become out of sync . In contrast, ffmpeg when used to not demux, retains the muxing delay according to mediainfo, thus megui does that stupid thing reading mediainfo and causing out of sync. That was the entire purpose for a few pages of that other thread

    How are you determining the delay value ? Try determining the value in a media player then using that value in mkvmerge. If it doesn't "fix" then something else is wrong with your audio & video


    It works as long as the video does NOT have a delay, if it does then the script fails. Can you please fix it so it works on my video?
    Or could you fix the other script mentioned earlier so that it works with WAV?
    Exactly, it works with ffmpeg for megui if mediainfo reports no delay. That is megui's problem. Sometimes the delay value reported in mediainfo isn't correct, causing megui to use the wrong values. That was the reason for using mkvextract. That poster's videos didn't have an actual delay, but mediainfo reported a minor delay, thus megui did some weird doubling of the delay
    Quote Quote  
  22. I was NOT talking about MeGUI when using this script. When using the script below to mux an MKV to an MKV the script only works if there's no delay in the video. Could you possibly fix this script please so it works even when there's a delay in the video?

    Code:
    "C:\FFMPEG\bin\ffmpeg.exe" -i %1 -vcodec copy -acodec copy "%~d1%~p1%~n1.MKV.mkv"
    "C\Sounds\VideoRedo Completed Sound Short.WAV"
    pause
    Or failing that I'll just use the following script on my source video which definitely works. It produces an MKV with AC3 amongst other things. After the script is finished I can then demux and remux and there won't be a delay in the video:

    Code:
    "C:\Portable Installations\MKV Toolnix\mkvextract.exe"  --ui-language en tracks %1 0:"video.h264" 1:"gain0.m4a"
    
    "C:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "gain0.m4a" -vn -c:a copy -absf aac_adtstoasc "gain.m4a"
    
    "C:\Portable Installations\AAC Gain 1.9\aacgain" -r -k -m 0 gain.m4a
    
    "C:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i gain.m4a -map 0:0 -vn -c:a copy "%~d1%~p1%~n1.aac" -map 0:0 -vn -c:a ac3 -b:a 128k "output.ac3"
    
    SET tsmuxer="C:\Portable Installations\tsMuxeR_1.10.6\tsMuxeR.exe"
    echo MUXOPT --no-pcr-on-video-pid --vbr  --vbv-len=500         > remux.meta       
    echo V_MPEG4/ISO/AVC, "video.h264", insertSEI, contSPS        >> remux.meta   
    echo A_AC3, "output.ac3"                                      >> remux.meta
    %tsmuxer% remux.meta "%~d1%~p1%~n1.AC3.ts"
    DEL /Q remux.meta
    
    del gain.m4a
    del gain0.m4a
    del video.h264
    del output.ac3
    
    "C:\Sounds\VideoRedo Completed Sound Short.WAV"
    
    pause
    Could you please modify the above script so that the only thing it does is make a TS with AAC. I don't need it to normalize the audio. Thanks
    Quote Quote  
  23. Originally Posted by MrBiggles View Post
    I was NOT talking about MeGUI when using this script. When using the script below to mux an MKV to an MKV the script only works if there's no delay in the video. Could you possibly fix this script please so it works even when there's a delay in the video?

    Code:
    "C:\FFMPEG\bin\ffmpeg.exe" -i %1 -vcodec copy -acodec copy "%~d1%~p1%~n1.MKV.mkv"
    "C\Sounds\VideoRedo Completed Sound Short.WAV"
    pause
    If you forget about megui, ffmpeg should work by itself with or without a delay when used in copy mode. ie. it should copy the delay over . If it doesn't work, something else is peculiar about your video, maybe errors

    Or failing that I'll just use the following script on my source video which definitely works. It produces an MKV with AC3 amongst other things. After the script is finished I can then demux and remux and there won't be a delay in the video:

    Code:
    "C:\Portable Installations\MKV Toolnix\mkvextract.exe"  --ui-language en tracks %1 0:"video.h264" 1:"gain0.m4a"
    
    "C:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "gain0.m4a" -vn -c:a copy -absf aac_adtstoasc "gain.m4a"
    
    "C:\Portable Installations\AAC Gain 1.9\aacgain" -r -k -m 0 gain.m4a
    
    "C:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i gain.m4a -map 0:0 -vn -c:a copy "%~d1%~p1%~n1.aac" -map 0:0 -vn -c:a ac3 -b:a 128k "output.ac3"
    
    SET tsmuxer="C:\Portable Installations\tsMuxeR_1.10.6\tsMuxeR.exe"
    echo MUXOPT --no-pcr-on-video-pid --vbr  --vbv-len=500         > remux.meta       
    echo V_MPEG4/ISO/AVC, "video.h264", insertSEI, contSPS        >> remux.meta   
    echo A_AC3, "output.ac3"                                      >> remux.meta
    %tsmuxer% remux.meta "%~d1%~p1%~n1.AC3.ts"
    DEL /Q remux.meta
    
    del gain.m4a
    del gain0.m4a
    del video.h264
    del output.ac3
    
    "C:\Sounds\VideoRedo Completed Sound Short.WAV"
    
    pause
    Could you please modify the above script so that the only thing it does is make a TS with AAC. I don't need it to normalize the audio. Thanks

    If that works, that means your video doesn't have an actual delay, like the poster in that original thread. That was the reason for using mkvextract

    Just use mkvextract and ffmpeg to convert the audio track to wav instead of ac3
    Quote Quote  
  24. I don't know how. Do you have a script please?
    Quote Quote  
  25. Found this script which converts to WAV then AAC and then converts to MKV AC3. Perhaps this is the most appropriate script for me.

    Code:
    for %%a in ("*.mkv") do (
    
    "X:\Portable Installations\MKV Toolnix\mkvextract.exe" --ui-language en tracks "%%a" 0:"E:\2 = New\Temp\video.h264" 1:"E:\2 = New\Temp\output0.ac3" 
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "E:\2 = New\Temp\output0.ac3" -vn -c:a pcm_s16le -ac 2 -ar 48000 -f wav - | "X:\Portable Installations\NeroAACCodec-1.5.1\win32\NeroAACEnc.exe" -if - -q 1 -ignorelength -of "E:\2 = New\Temp\output.aac" 
    
    "X:\Portable Installations\AAC Gain 1.9\aacgain.exe" -r -k -m 0 "E:\2 = New\Temp\output.aac"
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "E:\2 = New\Temp\output.aac" -map 0:0 -vn -c:a copy "%%~da%%~pa%%~na.aac" -map 0:0 -vn -c:a ac3 -b:a 128k "E:\2 = New\Temp\output.ac3"
    
    "X:\Portable Installations\MKV Toolnix\mkvmerge.exe" -o "%%~da%%~pa%%~na.AC3.mkv" "--forced-track" "0:no" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\2 = New\Temp\video.h264" ")" "--language" "0:eng" "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\2 = New\Temp\output.ac3" ")" "--track-order" "0:0,1:0"
    
    del "E:\2 = New\Temp\video.h264"
    del "E:\2 = New\Temp\output0.ac3"
    del "E:\2 = New\Temp\output.aac"
    del "E:\2 = New\Temp\output.ac3"
    
    )
    
    "X:\Daves Folder\Sounds\VideoRedo Completed Sound Short.WAV"
    
    pause
    
    )
    
    pause
    What script instead of the above should I use if I just want to convert to WAV and get an MKV with WAV?
    Quote Quote  
  26. what is your source ? h.264, aac or ac3 audio like that thread ? He had several variants. Because of the way the script is formatted you need to know the type and stream numbering. If your streams are different it won't work

    what do you want ? muxed mkv with audio converted to wav, copied video ?

    another option is to do it manually with the GUI's like mkvextractgui-2 , mkvtoolnix
    Quote Quote  
  27. Source 2GB video is in 1st post which I've updated. It's MKV 1080i h264 with WAV. I would ideally like the video copied and the audio re-encoded to WAV. But you could use any video to test your script. If that's not possible then the audio encoded to AAC max bitrate would be fine. Post 22 or 25 has different scripts so perhaps you could modify those or do whatever you feel is best.
    Quote Quote  
  28. If you want to modify it for a h.264 AC3 source, and mux it to mkv, wav

    Code:
    for %%a in ("*.mkv") do (
    
    "X:\Portable Installations\MKV Toolnix\mkvextract.exe" --ui-language en tracks "%%a" 0:"E:\2 = New\Temp\video.h264" 1:"E:\2 = New\Temp\output0.ac3" 
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "E:\2 = New\Temp\output0.ac3" -vn -c:a pcm_s16le -ac 2 -ar 48000 "E:\2 = New\Temp\output.wav" 
    
    "X:\Portable Installations\MKV Toolnix\mkvmerge.exe" -o "%%~da%%~pa%%~na.AC3.mkv" "--forced-track" "0:no" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\2 = New\Temp\video.h264" ")" "--language" "0:eng" "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\2 = New\Temp\output.ac3" ")" "--track-order" "0:0,1:0"
    
    del "E:\2 = New\Temp\video.h264"
    del "E:\2 = New\Temp\output0.ac3"
    del "E:\2 = New\Temp\output.wav"
    
    pause
    )

    You would need a different variation if the audio was AAC
    You should learn how to adjust it, because chances are you don't have the same folder structure as that poster
    Quote Quote  
  29. Originally Posted by MrBiggles View Post
    Source 2GB video is in 1st post which I've updated. It's MKV 1080i h264 with WAV. I would ideally like the video copied and the audio re-encoded to WAV. But you could use any video to test your script. If that's not possible then the audio encoded to AAC max bitrate would be fine. Post 22 or 25 has different scripts so perhaps you could modify those or do whatever you feel is best.
    If it's already h.264 with wav, why re-encode the audio to wav ? That does nothing - it's already uncompressed pcm wav
    Quote Quote  
  30. For the other files that don't have wav audio - if you don't use megui , just converting the audio directly to wav should work . That's the easiest and simplest. That was originally suggested in that other thread, but because mediainfo read the wrong delay, and megui uses that wrong information, the resultant files were out of sync, even though the output with ffmpeg is in sync . That was the reason for all those workaround scripts in the other thread

    ffmpeg -i input.mkv -c:v copy -c:a pcm_s16le output.mkv
    Quote Quote  



Similar Threads

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