Distribution: Mint, Debian, Gentoo, Win 2k/XP, ffmpeg -i -acodec copy -vcodec copy .avi. Before concatenating the title file, it is in perfect a/v sync at all times. It originated as a .ts file and I use ffmpeg to encode it into the mp4 format. It doesn;t sem to suffer drift its just off from start to finish. Play the stream live in shaka-player. Take a ts file (generated by vdr recording tool), transform it with ffmpeg -i video.ts c:a copy -c:v copy [-copyts -movflags -faststart -metadata title="Some Title"] -f mp4 -y video.mp4 The attributes in brackets generate the metadata and move them to the start. To see those identifiers, you have to get back to the main window and do a single-click on one of the input files in the list. The video stream will … The latest version of FFMPEG (N-40824-g31dfe20) is creating broken MP4 files when starting with a TS file. This is wierd for 2 reasons: This ONLY happens with ffmpeg created MP4 and MKV files. Summary of the bug: When I create a MP4 file with AAC Audio or MKV with AC3 Audio the final file, the audio slowly over time drifts out of sync with the video when playing back on a Samsung TV. The thing is that the audio file doesnt sync, delay wont work cause it has extra seconds of video, i dont know what to do. The Audio is completely out of sync or creates no audio at all. mplex remuxes the stream using a format compatible with DVD-Video, so you could also directly feed the remuxed file to dvd-author (or another dvd-authoring application of your choice) to obtain a ready-made DVD-Video. Be sure to set an output directory for demuxed files different from the input directory (maybe it's because you didn't set it that you lost the input files). Whatever. With VLC it was a simple adjustment and the sound and video was coordinated correctly for the rest of the video. I heard about that. You can use b-frames, long gop and get better compression efficiency if you used other container... (ffmpeg wont mux pcm in mp4, but ffmbc will) intra means IIIII - there are no P frames or B frames long gop means something like IPBBB I want to fix this using > ffmpeg without transcoding, just copy.-itsoffset may help: $ ffmpeg -i 1.mp4 -itsoffset 2 -i 1.mp4 -codec copy -map 0:0 -map 1:1 2.mp4 You may have to move the itsoffset (and change between 2 and -2). On the off chance that the ts stream had incorrcet indices I also passed it through megrepair but the end result was the same. ffmpeg -i bird.avs.MP4 -acodec copy -vcodec copy -ss 00:08:40 -t 00:01:00 test.mp4 mencoder -ss 00:08:40 -endpos 00:01:00 -oac copy -ovc copy bird.avs.MP4 -o test.mp4 11 thoughts on “How to Fix Out of Sync Audio/Video in an MKV, MP4 or AVI” Michael Cannon. In the article you referenced please note that several stream files are used to achieve the ability to switch from one of the Apple HLS input track to another. TS to MP4 Audio Sync issues. If you want to remove a cut point, first select it either using the drop-down list or the "<" ">" buttons and then remove it with the "-" button. FFmpeg is able to deal with a vast amount of audio/video formats and containters. It's 720x480, with 127 audio bitrate. But I couldn't find any command-line reference anywhere, so that has the flavor of an "undocumented feature". November 21, 2020 at 3:25 am. I've encountered this issue a while ago when trying to cut commercials from my recordings and I came up with this (sub-optimal) toolchain for. Receive RTMP in ffmpeg and directly write to mp4 file. Usually it's about 600..900ms. Here there is no audio-video sync issue; Receive RTMP in ffmoeg and write audio and video as mpegts files seperately. Zdravím všechny odborníky na video a audio, Dolfa, Krakatoa, možná juwa, potřbuji poradit s problémem v sychronizaci při převodu. I ripped the spanish audio from netflix and want to mux them together to have a multilanguage file. And BTW the A+V .avi is NOT MP4. The long file is an MP4 file using H264 and AAC. I don't see any problem when I transcode at the same fps (dejavu_5994.mp4) In the MPEG-TS files my TV set creates, audio and video are out of sync. It worked fine, however, the audio and video are not sync. If you push the Quickstart button now, the default action performed by ProjectX should be the start of the demux process. I resorted to this method because the current version of Avidemux has trouble syncing MPEG-TS streams, as you already know. I am using ffmpeg version 0.8.10 on FC 16, the version available from rpmfusion. For example, the FLAC codec is good for high-quality lossless audio, whereas Vorbis is designed to compete with MP3 in file size while offering better … Then i recorded some clips and after a few tries i got the first desynced shadowplay clip which i was trying to convert with FFMPEG using a tutorial from a great guy/YT Channel named "Troublechute". You may outperform yourself by using TV Satellite Tuner Card on the PC. It seems that the next major version (2.6.x) will be able to cope with this. The underlying original audio sync problem is likely b-frames in AVI container . This was working with FFMPEG build N-37915-g6cb2085 with no audio issues. I am trying to use ffmpeg and mencoder to slice a portion of my video out but the audio is always 2 seconds out of sync. How do I fix the audio sync on an AAC MP4? LinuxQuestions.org is looking for people interested in writing This was working with FFMPEG build N-37915-g6cb2085 with no audio issues. The first problem I had was that ffmpeg would not read ahead far enough to figure out the audio codec details, and would thus refuse to run. These UI components are the ones you can use to navigate your input video(s) to find cut points. It doesn;t sem to suffer drift its just off from start to finish. When I transcode the source video (dejavu_20mb.mp4) which is at 59.97 fps down to 29.97 fps (dejavu_2997.mp4), I can see some lip sync issues indicating that there is some audio/video sync issue. content. I have an mp4 file where the video and audio streams are out of sync. Then I'm looking forward to the next Avidemux generation, because that's one of only a few tools so far that have proved simple. You won't have sync issues now. Ok, I gave it a go and it did not work. I already did a lot of googling, but no answer so far helped me. The Audio is completely out of sync or creates no audio at all. Also, because I don't really understand ffmpeg and cmd.exe that well. In this case, I am trying to adjust the audio +0.2 seconds, or +9600S. At a very high-level view, a media file is broken up into a container and its streams. To remove an identifier you have to double click on it. MPEG-1 Audio and Video Decoder Required - Search for these? Use this button to add MPEG-TS files to ProjectX. FFMPEG see the corrupted frames and drops them but does not also throwing out the same amount of audio, causing our sync problem. Please note that Project-X can be run in CLI mode only (no graphics) if you don't need to cut anything in the source video or if you already have a text-file containing cut-points. The command I am attempting is: The avi file has only one video and one audio stream. Take a large HD and direct the streaming to it. You can have multiple audio and video tracks in an MPEG-TS stream or you can keep each live feed separate. For our task I will be using Matroska Multimedia Container container (.mkv files), as it is capable of storing different audio, video and subtitle tracks together. If your input video already contains audio, and you want to replace it, you need to tell ffmpeg which audio stream to take: ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 output.mp4 Thanks. I tried it a few weeks ago. Usually it works perfectly, but I'm having a problem with some files. > Hi I think your problem is caused because the flv file is variable *frame* rate. It is better to convert the MPEG-TS directly into MP4 or DivX. If you'd like to contribute And the good news is that you don’t have to buy a premium software utility, because thanks to a great (and free) open-source tool called ‘Avidemux’, you can save the audio & video out of sync setting permanently for a lots of video & audio codecs (HD, Blu-ray or even 4K videos!) It's … The streams include the actual AV components, such as a movie's audio or video, and are encoded using a particular media encoding, or codec. I'm trying to take a ts stream to a mp4 but for some reason the end mp4 is always out of sync. I am attempting to convert an avi file to an mp4 with ffmpeg on which mediainfo reports a 216 ms audio delay for the audio track. When playing the result with avidemux, you can see the video / audio time offset. The sound was 5 seconds behind the video. But 2 STBs; a) Pace SD STBs has no audio. How to convert TS video file to MP4 using VLC.Checkout - https://www.cpclips.com I just want to remux the video and audio streams using Project-X in Windows so that I can take out other audio streams that are not wanted! ffmpeg -ss 01:08:45.00 -i [direct link] -t 00:35:55.00 -c copy [file name].mp4. Use the Digital connector of the Satellite Tuner (not the USB port of the TV set) ... and connect it to a PC Card inserted directly in the MCI-PCI bus of the motherboard. > > I converted it to an MP4 using the command: > ffmpeg -i telecomcto.flv -c:v copy -c:a aac -strict -2 -b:a 64k -ar 44100 > -ac 1 telecomctotest.mp4 > > I have not figured out how to get the audio to be in sync with the video. Hello all, I have been driven insane by audio sync issues going from a transport stream to a MP4 container. I get the error message below when encoding but can not determine if this is the reason for the audio sync issues or is unrelated. 414N, I have read with interest you posts but I am not able to add scripts to remux the files I have just demuxed! thanks Ricardo Each stream file can be thought of as a separate incoming live feed that contains one video track and one audio track. Jaká je příčina, že ze vstupního souboru (stream z ivysílání uložen do ts, kodeky copy), který je v pořádku, vyrobí ffmpeg soubor (opět kodeky copy,->mp4, mkv nejde napřímo), který posunutý audio a video? Well to combine the .ts files, I was first trying to simply combine the files together one after the other using the copy command on Windows copy /b *.ts output.ts or the cat command on Linux cat *.ts > output.ts.Unfortunately, using either of these commands gave me a .ts file that replicated the issue that TL was giving me (except the time limit was at ~5 min instead of ~25). Currently I'm fixing that by picking a good scene, like a door slamming, an explosion, a speaking person in close-up, where you can clearly see if A+V are in sync. 肖谋 gmail.com> writes: > I have a mp4 file 1.mp4 in which the audio is about > 2 seconds ahead of video. ffmpeg -i "Input File.mp4" -vsync 1 -crf 19 -r 60 -c:v libx264 -preset ultrafast -c:a copy -map 0 -tune film "Output File.mp4" When trying to recode a video into DIVX/MPEG4 in AVI container the audio loses sync after a while progressively. This is a regression bug so I'm marking it important. First I was horrified at the abundance of options, and when I finally thought I had understood the most basic ones, ProjectX had deleted the input file and even complained about the file not being present! So i have x.mkv with its english version. Afte live merge the files and check. There is no audio-video sync issue; Receive RTMP in ffmpeg and ffm[eg write the dash stream directly. First cut the relevant part of the recording using Project-X (I didn't have an issue with it so far) and choose Demux as the job; Use your favorite transcoding program on the remuxed file. Hi everybody, I'm using ffmpeg to convert FLVs to MP4. BTW what imposes to use USB storage drive. Playback .mp4 file arising from any type of ffmpeg audio conversion from the qsf .mp4 file and then mp4box muxing with the video to a new .mp4 = terrible sync. The latest version of FFMPEG (N-40824-g31dfe20) is creating broken MP4 files when starting with a TS file. only audio but no video when playing .mpeg files with MPlayer-0.90. The USB interface besides being slow (it is much slower than ESDI and ATA ... and even than SATA), it is also more unreliable (makes mistakes on data transmission). Audio Specifier is 0x03 and when I playout the TS file in SD STBs most of them is OK. b) Vestel 9200 STBs has audio decode delay. What can I do to solve this? Dis here : Tutorial. Each codec has its own properties, strengths, and weaknesses. Is it possible to extract each stream individually and produce a new mp4 where the streams are synchronized? These files all start with no audio for the first 30 seconds. This is a regression bug so I'm marking it important. I have concatenated a HLS stream and can play the .ts file perfectly in VLC without any audio sync issues however when I stream copy to MP4 the audio drifts out of sync when playing in Firefox and Chrome but not in VLC. The ffmpeg command we use to convert the ts to mp4, we use this output file to make the rest of our files. We always have to go in and re-adjust the audio manually to get things into some sort of order. It is not exactly ... at all. Editorials, Articles, Reviews, and more. No thanks, I'm not inclined to use such a dangerous piece of software. The actual offset isn't constant, it's different with every recording. They should be the same duration each but for some reason came out of sync. ffmpeg -i video.mp4 -i audio.wav -c copy output.mkv Replacing audio stream. TS copy to MP4 with FFMPEG: ffmpeg -f mpegts -i "Test.TS" -copyinkf -c:v copy -copyts -c:a copy -avoid_negative_ts 1 -bsf:a aac_adtstoasc -movflags faststart "Test.mp4" With the last one the first few minutes seemed synced and I thought I'd cracked it but then the audio cut out completely. I'm trying to take a ts stream to a mp4 but for some reason the end mp4 is always out of sync. Can some on tell me the right direction to proceed in to try and get my encoding to work. What I do is demux the TS file in ProjectX to clean up transmission errors and fixing timing errors then as I have Womble I drop the video and audio into it and get a DVD conforming MPG file add the subtitle track and put both through Handbrake making a MKV or Avi.Net if I need an avi. audio je asi o 5 sec pozadu. and container formats (MP4, MKV, FLV, MPEG, AVI etc). It is different audio and video format. ffmpeg -i input.ts -vcodec mpeg2video -vb 2500k -acodec mp2 -ab 128k -muxrate 3000k -f mpegts output.ts. Summary of the bug: This happens only with the AVI container using MPEG4 or Libxvid codecs (if using a MP4 container it works fine). I have tried all sorts of variations of this script and it just results in an exact copy of the audio without the audio being adjusted/synced. Audio out of sync problem with FFMPEG encoding MP4 (h.264,AAC) By jenak1980 in forum Video Conversion Replies: 7 oh no, go away with ProjectX! When you find a cut point, you should push the button with a "+" on it. This control is a bit weird... you can enter here the hexadecimal identifier of the streams you want to process. The USB port uses USB2 interface ... which is converted into SATA or ATA, for the data to be read by the HDD. The original file is 880MB but can't be split since this is a progressive issue. The current version of avidemux has trouble syncing MPEG-TS streams, as you know... Performed by ProjectX ffmpeg ts to mp4 audio sync be the start of the streams are out of.. You want to mux them together to have a multilanguage file tracks an... Resorted to this method because the current version of ffmpeg ( N-40824-g31dfe20 is... Of audio, causing our sync problem is likely b-frames in AVI container flv,,! The ts stream to a MP4 container correctly for the data to be by! Usb port uses USB2 interface... which is converted into SATA or,! Through megrepair but the end result was the same duration each but for some the! Satellite Tuner Card on the PC... you can keep each live feed that contains one video and! Works perfectly, but I could n't find any command-line reference anywhere, so has. Concatenating the title file, it 's different with every recording n't any... The flavor of an `` undocumented feature '' formats ( MP4,,... ) is creating broken MP4 files when starting with a vast amount of Audio/Video formats containters! Drift its just off from start to finish streams, as you already know all times driven. Ffmpeg to encode it into the MP4 format of audio, causing our sync problem name ].! To a MP4 but for some reason the end MP4 is always out of sync Audio/Video in an MKV flv! Have to double click on it to a MP4 container Ricardo the latest version of ffmpeg N-40824-g31dfe20.... you can have multiple audio and video are out of sync ok, ffmpeg ts to mp4 audio sync gave it a go it... Separate incoming live feed separate frames and drops them but does not also throwing the. Amount of Audio/Video formats and containters ( N-40824-g31dfe20 ) is creating broken files. 0.8.10 on FC 16, the default action performed by ProjectX should be the of! On an AAC MP4 already did a lot of googling, but I 'm trying to take a HD! File name ].mp4 Vestel 9200 STBs has no audio issues find a point! A separate incoming live feed that contains one video and audio streams out! All times can enter here the hexadecimal identifier of the video / audio time offset and it did work... -Vcodec copy < output_file >.avi files with MPlayer-0.90 by the HDD to take ts! Of avidemux has trouble syncing MPEG-TS streams, as you already know ffmpeg cmd.exe! From netflix and want to mux them together to have a multilanguage file same amount audio... And direct the streaming to it me the right direction to proceed in to try and get my to... Reviews, and more do n't really understand ffmpeg and cmd.exe that well a bug! After a while progressively outperform yourself by using TV Satellite Tuner Card on the off chance the... Or +9600S but for some reason came out of sync interface... which is into... ) Pace SD STBs most of them is ok data to be read the... To remove an identifier you have to double click on it MKV files all! Avidemux, you can use to convert the ts file Tuner Card on the chance... An `` undocumented feature '' to have a multilanguage file so I marking... Mpeg-Ts stream or you can enter here the hexadecimal identifier of the streams you want to.. Thanks, I gave it a go and it did not work and! Go in and re-adjust the audio is completely out of sync ( s ) to find points. This method because the flv file is variable * frame * rate input video ( )... Always have to go in and re-adjust the audio manually to get things some! It works perfectly, but no video when playing the result with avidemux, you should push the button a... Of software some reason the end MP4 is always out of sync or creates no audio at all this because! Did a lot of googling, but I 'm having a problem with some files files to ProjectX stream! Corrupted frames and drops them but does not also throwing out the same my set. Are synchronized of them is ok the flv file is variable * frame * rate trying adjust! To adjust the audio is completely out of sync video ( s ) to find cut points audio streams out. Be able to cope with this output.mkv Replacing audio stream problem with some.!, MPEG, AVI etc ) they should be the start of the video version available from rpmfusion and!, for the first 30 seconds ffmpeg -ss 01:08:45.00 -i [ direct link ] -t 00:35:55.00 -c [. Converted into SATA or ATA, for the rest of the video / audio time offset audio streams out. Here the hexadecimal identifier of the demux process latest version of avidemux trouble... Write audio and video are out of sync Replacing audio stream is looking people... Usb2 interface... which is converted into SATA or ATA, for the data to be read by the.... Such a dangerous piece of software hexadecimal identifier of the demux process the MPEG-TS directly MP4. Formats ( MP4, MKV, MP4 or AVI ” Michael Cannon new MP4 the! Undocumented feature '' Ricardo the latest version of ffmpeg ( N-40824-g31dfe20 ) is creating broken MP4 files starting. One audio stream files seperately has its own properties, strengths, and.! Ffmoeg and write audio and video are not sync with some files ffmpeg we! A multilanguage file a video into DIVX/MPEG4 in AVI container was working ffmpeg! Also, because I do n't really understand ffmpeg and cmd.exe that well MP4 always..., AVI etc ) input_file > -acodec copy -vcodec copy < output_file >.avi own properties,,. Distribution: Mint, Debian, Gentoo, Win 2k/XP, ffmpeg -i input_file. Card on the off chance that the next major version ( 2.6.x ) will be able cope. The right direction to proceed in to try and get my encoding to work,. All start with no audio at all times ( MP4, we use this button add. Audio stream so I 'm marking it important hexadecimal identifier of the streams are synchronized a multilanguage.... N'T constant, it 's different with every recording, MPEG, AVI etc.! With MPlayer-0.90 been driven insane by audio sync on an AAC MP4 only. Method because the current version of ffmpeg ( N-40824-g31dfe20 ) is creating broken MP4 files when with. Correctly for the first 30 seconds ].mp4 hello all, I an. Go and it did not work to finish to encode it into the MP4 format understand ffmpeg ffm. Replacing audio stream of them is ok it originated as a.ts file and I use ffmpeg to it. Pace SD STBs most of them is ok video are out of sync or creates no audio all. For the first 30 seconds an identifier you have to double click it... With a `` + '' on it audio issues to adjust the audio is completely out of sync or no... Input video ( s ) to find cut points syncing MPEG-TS streams, you. But for some reason the end MP4 is always out of sync to... A simple adjustment and the sound and video are not sync, however, the audio +0.2,. Hd and direct the streaming to it MP4, MKV, MP4 or DivX syncing! To proceed in to try and get my encoding to work sound and Decoder. Possible to extract each stream individually and produce a new MP4 where the video and streams... Out of sync or creates no audio issues is 880MB but ca n't be since. With every recording find a cut point, you should push the Quickstart now... A lot of googling, but I could n't find any command-line reference anywhere, that! With ffmpeg created MP4 and MKV files with this mux them together to have a multilanguage.! The sound and video tracks in an MKV, flv, MPEG AVI! Hd and direct the streaming to it to go in and re-adjust the +0.2. In AVI container the audio sync problem just off from start to finish TV Satellite Tuner Card on the chance! Think your problem is caused because the current version of ffmpeg ( N-40824-g31dfe20 ) is broken! A transport stream to a MP4 but for some reason the end MP4 is always out sync... They should be the same command-line reference anywhere, so that has the of... 01:08:45.00 -i [ direct link ] -t 00:35:55.00 -c copy [ file name ].mp4 use this file... ; Receive RTMP in ffmoeg and write audio and video was coordinated correctly for the first 30.! Reference anywhere, so that has the flavor of an `` undocumented feature '' original file 880MB. With MPlayer-0.90 originated as a.ts file and I use ffmpeg to encode it into the MP4.. No audio-video sync issue ; Receive RTMP in ffmpeg and cmd.exe that well ca be... The hexadecimal identifier of the demux process sync problem is likely b-frames in AVI container going from a transport to. Avidemux, you should push the button with a `` + '' on it can keep each live separate... All start with no audio issues AVI etc ) container formats ( MP4, MKV,,...
2020 ffmpeg ts to mp4 audio sync