how to combine an audio track and video file?

13 respostas [Última entrada]
muhammed
Desconectado
Joined: 04/13/2013

If I have separate audio and video files, can I combine them into one file? I don't want to convert/transcode anything ... I don't want to lose quality in any conversion. I'd just like to join two files together.

t3g
t3g
Desconectado
Joined: 05/15/2011

The VLC ppa from https://launchpad.net/~djcj/+archive/ubuntu/vlc-stable also has the latest ffmpeg as well. You may want to search on how to use ffmeg to put codecs into a container.

What are the audio and video codecs? The container format may be dependant on what they are.

mYself
Desconectado
Joined: 01/18/2012

The repository above contains the non-free FDK AAC (the new FAAC!) library, which is installed alongside FFmpeg/VLC, and cannot be removed due to the fact that it was manually enabled before compilation. Also, the maintainer obviously doesn't care too much about free software.

The latest FFmpeg can be downloaded here:
http://johnvansickle.com/ffmpeg/

t3g
t3g
Desconectado
Joined: 05/15/2011

Ugh, its much easier to use a PPA than having to re-compile with every update. I wonder how this will affect FFMPEG in the future as Ubuntu has gone back to FFMPEG after using LibAV for a while.

muhammed
Desconectado
Joined: 04/13/2013

thanks a lot mYself

SuperTramp83

I am a translator!

Desconectado
Joined: 10/31/2014

sudo apt-get install openshot

Sasaki
Desconectado
Joined: 08/11/2014

you can also do this with the preinstalled video editor in trisquel : pitivi. I personnaly have some problems using it and find kdenlive easier to use.

Maybe you won't have the desired quality when exporting the file. You can also edit audio and video in ardour 3, in wich you may find all the needed options about audio quality.

jxself
Desconectado
Joined: 09/13/2010

Try:
ffmpeg -i /path/to/one/file -i /path/to/another/file -acodec copy -vcodec copy /path/to/output/file

muhammed
Desconectado
Joined: 04/13/2013

Thanks a lot guys, I will give this a try. I'll try ffmpeg first.

muhammed
Desconectado
Joined: 04/13/2013

Hi again. Trisquel 7 doesn't have ffmpeg. It has avconv; does anyone know how to use avconv in the way that jxself described how to use ffmpeg?

Legimet
Desconectado
Joined: 12/10/2013

It should be the same; just replace ffmpeg with avconv and run it.

muhammed
Desconectado
Joined: 04/13/2013

I tried it and got the following output. Btw, I see t3g's post; I might give that a try too after I learn how to add a ppa.

avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[matroska,webm @ 0x2373920] Unknown/unsupported AVCodecID V_VP9.
[matroska,webm @ 0x2373920] max_analyze_duration reached
Input #0, matroska,webm, from '/home/user/video.webm':
Duration: 01:00:00.12, start: 0.000000, bitrate: N/A
Stream #0.0(eng): Video: [0][0][0][0] / 0x0000, 1280x720, PAR 1:1 DAR 16:9, 27 fps, 25 tbr, 1k tbn (default)
Input #1, matroska,webm, from '/home/user/audio.webm':
Duration: 01:00:00.15, start: 0.000000, bitrate: N/A
Stream #1.0(eng): Audio: vorbis, 44100 Hz, stereo, fltp (default)
[webm @ 0x238a2a0] Only VP8 video and Vorbis audio are supported for WebM.
Output #0, webm, to '/home/user/audiovideo.webm':
Metadata:
encoder : Lavf54.20.4
Stream #0.0(eng): Video: [0][0][0][0] / 0x0000, 1280x720 [PAR 1:1 DAR 16:9], q=2-31, 90k tbn, 1k tbc (default)
Stream #0.1(eng): Audio: libvorbis, 44100 Hz, stereo (default)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

J.B. Nicholson-Owens
Desconectado
Joined: 06/09/2014

name at domain wrote:
> If I have separate audio and video files, can I combine them into one
> file? I don't want to convert/transcode anything ... I don't want to
> lose quality in any conversion. I'd just like to join two files together.

I use the Matroska tools (install the mkvtoolnix-gui package for the GUI
app or the mkvtoolnix package for the command line tools) for this job.
Matroska is a capable container format that would also let you mux in
subtitles in multiple languages, chapters, alternate audio tracks, and more.