1

I tried using ffmpeg for this, but for some reason there are gaps in the audio.

mylist.txt lists all .ts files.

ffmpeg -f concat -i mylist.txt -c copy video-all.ts
ffmpeg -i video-all.ts -acodec copy -vcodec copy video.mp4

I uploaded all related files here http://www.mediafire.com/file/gxul811x9ze5gmj/sm1586342.zip . It often stutters at 0:37 for example, at the border between sm1586342-6.ts and sm1586342-7.ts

2 Answers 2

1

First, alto trabajito pareces cesar dibujando nada mas que tu mujer es ese dibujito arre

FIRST !!! CHECK IF YOU LIKE THE VIDEO FINAL BEFORE READ THIS TOTURIAL

NEW final video and audio https://www.mediafire.com/file/tk8ygblhv4r4bl1/tesis_end_bestquality.mp4/file

OLD video and audio http://www.mediafire.com/file/k7f5yacxfufk4j3/all_before_tutorial.mp4/file

You have to work all this project, with ffmpeg, but ir dont mean that is all of one! we will to worlk... step by step!

1: https://i.stack.imgur.com/TUbvl.jpg 1

why? if we imagined, how to cook hamburguers with patotes... the chef put all ingredients in the first step into oil to 300 degrees F by 5 mins? ...

We will to divide this operation in two big parts,

stream 0:0 for video stream 0:1 for the audio

The problem here is that the inputs are divided in 26 parts of 6 seconds of duration, with extension ".ts", that was order and listed to unit in the file 'mylist.txt'

NOTE: ALL MEDIA FILES YOU CAN FIND HERE http://www.mediafire.com/folder/tdo9co17nu7gk/sm1586342

let's go to see what have this files that we have to concatenate...

ffmpeg -i sm1586342-1.ts

Input #0, mpegts, from 'sm1586342-1.ts': Duration: 00:00:06.01, start: 1.000000, bitrate: 289 kb/s Program 1 Stream #0:0[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 5 kb/s Stream #0:1[0x100]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 480x360 [SAR 1:1 DAR 4:3], 24 fps, 24 tbr, 90k tbn, 48 tbc

So we have two streams ffmpeg -i sm1586342-1.ts print this

Stream #0:0[0x101]: Audio: aac

Stream #0:1[0x100]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 480x360 [SAR 1:1 DAR 4:3], 24 fps, 24 tbr, 90k tbn, 48 tbc

The secret here is to work streams 0:0 and 0:1 separated.

first concatenate the 0:0 that is the audio, and not copy the video

ffmpeg -f concat -i mylist.txt -map 0:0 -map 0:1 -c copy -strict -2 -vn audio.ts

and later the other stream

ffmpeg -f concat -i mylist.txt -map 0:0 -map 0:1 -an -c copy video.ts

oast to video.ts

this mean that we tell to ffmpeg that 1) united all files whit the order that is in the "mylist.txt" file, and, when you have the unique file, copy the audio in same quality to output file audio.ts and vice versa for video.ts

Concat audio

Ok, now rest to copy video.ts as stream 0:0 and copy audio.ts -strict -2 to work_audiovideo.mp4

I tried using ffmpeg for this, but for some reason there are gaps in the audio.

There is no gaps in audio.ts, but audio.ts is now in horrible decodification system, the aac format craapple lossy codec.

In this cases, you have to mastering the file audio...

how?, put all audio in stereo, to grow the frecuence to reorganice the "gaps", and muestras in a contenedor real, friendy, that is .flac, obviusly, or .rar or .zip, but flac is the "preferido" (for the world)

if our ears can to be listen, no matter what drug the person who is listening to has consumed, their ears can listen to 18,000 hertz, and we have only 2 ears, two auditory nerves, and one part in the brain that decode and created, if the audio is real, as emotion as you want, so, we have to think that "20,000 hertz" for ear is a correct proportion/sizefile/ decodification time/ etc... heeeyy this is a neuroscientific rule, nothing It has to do with Nyquist's drunk, which is a childish theory.

Ok, we will give more capacity to show the audio to you, increasing the frequency to 48000 hertz in stereo chanels in 16 bits/sec, more? is how to buy and buy food to your dog, and this is other chapter to tolk.

create the audio.flac file front the horrible audio.ts encoder (aac)

ffmpeg -i audio.ts -map 0:0 -codec:a flac -ac 2 -ar 48000 -sample_fmt s16 audio.flac

and now, we have video.ts, audio.flac, and audio.mp4

change ts to mp4

ffmpeg -i video.ts -map 0:0 -c copy -an video.mp4

THE END is that exist to enjoy whit "tesis_end_bestquality.mp4"

ffmpeg -i video.mp4 -i audio.flac -c copy -map 0:0 -map 1:0 -map_metadata -1 -movflags +faststart -strict -3 -f mp4 tesis_end_bestquality.mp4

YES PEOPLE THANK FOR ALL, but i want to have to pass the hat, becouse i want a new mac, this is my email for chat or colaborating with the new mac, thansyou and regards!

[email protected]

the final tesis enter image description here

2
  • An 8mb video turned into a 21mb one. Recompressing an already compressed audio doesn't make it sound better, all compression artifacts are already there. How to merge them without any reencoding? Jan 29, 2020 at 16:27
  • Great post. I managed to create evertthing and the flac file has no audio 'gaps' in it. 1 problem, my video is 8minutes and 6 seconds long and the flac file is 8minutes long. Which results in bad video audio syncing. Any suggestions because I'm almost there. The audio was in 44100, so I changed the command to that, but no result..
    – Gilko
    Aug 25, 2020 at 1:40
0

This is almost like xear's answer, but doesn't reencode audio.

ffmpeg -f concat -i mylist.txt -map 0:0 -map 0:1 -c copy -vn audio.aac
ffmpeg -f concat -i mylist.txt -map 0:0 -map 0:1 -an -c copy video.ts
ffmpeg -i video.ts -i audio.aac -c copy -map 0:0 -map 1:0 -map_metadata -1 -movflags +faststart -strict -3 -f mp4 final.mp4

This plays better, but I'm not sure if audio is joined properly, and if it does or doesn't add desync between audio and video. But at least I can't hear anything wrong with it anymore with my bare ear.

Edit: discard this method, it introduces audio desinc for long videos, longer than 10 minutes. I now use ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4, notice -safe 0. Still a bit buggy, but I give up, chopping a video into multiple .ts files is evil in the first place.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .