LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-13-2019, 04:41 PM   #1
hujikor
LQ Newbie
 
Registered: Sep 2019
Posts: 3

Rep: Reputation: Disabled
Question How to add an another audio (language) to movie?


How to add an another audio (language) to movie?
Why? Because I learn the English language.

See, I have two films (same content, different title, long name below):
hysteria.mp4 - with english audio
bez-isteriki.avi - with russian audio

What I would like?
Result file hysteria-eng-rus.mp4 with two audio tracks (rus and eng) and when I will be playing it via mplayer, I use slave move of mplayer to change audio every 5 min (cron helps me).
It's interesting to listen to.

I type these commands:
Code:
mencoder bez-isteriki.avi -of rawaudio -oac copy -ovc copy -o bez-isteriki-audio-rus.ac3
Code:
mencoder hysteria.mp4 -o hysteria-eng-rus.mp4 -ovc copy -oac copy -audiofile bez-isteriki-audio-rus.ac3
But it doesn't work, no sound.
Playing Hysteria-eng-rus.mp4.
libavformat version 53.21.0 (external)
Mismatching header version 53.19.0
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO: [H264] 1280x544 24bpp 25.000 fps 814.8 kbps (99.5 kbyte/s)

Maybe I must see -aid 2 ?

Regards!

PS
Output:
file bez-isteriki.avi
bez-isteriki.avi: RIFF (little-endian) data, AVI, 720 x 304, 24.00 fps, video: XviD, audio: Dolby AC3 (6 channels, 48000 Hz)

file hysteria.mp4
Hysteria.2011.720p.bluray.x264.YIFY.mp4: ISO Media, MPEG v4 system, version 1


And this
Quote:
http://www.mplayerhq.hu/DOCS/tech/slave.txt
switch_audio [value] (currently MPEG*, AVI, Matroska and streams handled by libavformat)
Switch to the audio track with the ID [value]. Cycle through the
available tracks if [value] is omitted or negative.
 
Old 09-13-2019, 05:22 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,320

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Code:
ffmpeg -i hysteria.mp4 -i bez-isteriki.avi \
    -map 0:0 -map 0:1 -map 1:1 \
    -c copy \
    Hysteria-eng-rus.mp4

syncing audio is another matter
Code:
ffmpeg -i hysteria.mp4 -itsoffset 00:00:01.0 -i bez-isteriki.avi \
    -map 0:0 -map 0:1 -map 1:1 \
    -c copy \
    Hysteria-eng-rus.mp4
I think that would add a 1 second delay to bez-isteriki.avi's audio
I'm not 100% certain
 
Old 09-14-2019, 10:01 AM   #3
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,552

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
The OP's English is pretty good - why not just watch the English language version (possibly with optional Russian subtitles)?
 
Old 09-14-2019, 10:21 AM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,320

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Quote:
Originally Posted by JeremyBoden View Post
The OP's English is pretty good - why not just watch the English language version (possibly with optional Russian subtitles)?
did you not read the OP?

They have cron setup to flip between eng & rus every 5 min
 
Old 09-14-2019, 07:02 PM   #5
hujikor
LQ Newbie
 
Registered: Sep 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
Firerat, thanks, but we need to go deeper.jpg
I change option 'c' to -acodec copy -vcodec copy, 'cause:
Code:
Unrecognized option 'c'
Failed to set value 'copy' for option 'c'
and output are

Code:
ffmpeg -i Hysteria\ \(2011\)/Hysteria.2011.720p.bluray.x264.YIFY.mp4 -i Bez\ isteriki.chopper887.avi -map 0:0 -map 0:1 -map 1:1 -acodec copy -vcodec copy Hysteria\ \(2011\)/Hysteria-eng-rus.mp4 

ffmpeg version 0.8.10-6:0.8.10-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
  built on Feb  6 2014 20:57:40 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Hysteria (2011)/Hysteria.2011.720p.bluray.x264.YIFY.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2012-04-05 10:00:24
  Duration: 01:35:21.68, start: 0.000000, bitrate: 882 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 1280x544 [PAR 1:1 DAR 40:17], 814 kb/s, 25 fps, 25 tbr, 100 tbn, 50 tbc
    Metadata:
      creation_time   : 2012-04-05 10:00:24
    Stream #0.1(und): Audio: aac, 48000 Hz, stereo, s16, 64 kb/s
    Metadata:
      creation_time   : 2012-04-05 10:06:12

Seems stream 0 codec frame rate differs from container frame rate: 24.01 (65534/2730) -> 24.00 (10000000/416667)
Input #1, avi, from 'Bez isteriki.chopper887.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.3 | www.virtualdub-fr.org || (build 2550/release)
    title           : Bez isteriki.chopper887
    artist          : chopper887
    genre           : Comedy
    album           : Movie
  Duration: 01:39:07.00, start: 0.000000, bitrate: 2087 kb/s
    Stream #1.0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 720x304 [PAR 1:1 DAR 45:19], 24 tbr, 24 tbn, 24.01 tbc
    Stream #1.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s

Number of stream maps must match number of output streams
Maps! Yeah, how to create magic with it?




Quote:
Originally Posted by Firerat View Post
Code:
ffmpeg -i hysteria.mp4 -i bez-isteriki.avi \
    -map 0:0 -map 0:1 -map 1:1 \
    -c copy \
    Hysteria-eng-rus.mp4

syncing audio is another matter
Code:
ffmpeg -i hysteria.mp4 -itsoffset 00:00:01.0 -i bez-isteriki.avi \
    -map 0:0 -map 0:1 -map 1:1 \
    -c copy \
    Hysteria-eng-rus.mp4
I think that would add a 1 second delay to bez-isteriki.avi's audio
I'm not 100% certain
 
Old 09-14-2019, 08:53 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,320

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
your ffmpeg version is very old, this may explain why "-c copy" did not work ( works fine here )

This *might* work with your version
Code:
ffmpeg -i Hysteria\ \(2011\)/Hysteria.2011.720p.bluray.x264.YIFY.mp4 \
       -i Bez\ isteriki.chopper887.avi \
       -map 0:0 -vcodec copy \
       -map 0:1 -acodec copy \
       -map 1:1 -acodec copy \
       Hysteria\ \(2011\)/Hysteria-eng-rus.mp4
 
Old 09-15-2019, 03:46 PM   #7
hujikor
LQ Newbie
 
Registered: Sep 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
Output are
Number of stream maps must match number of output streams.

Hmm, what is the problem?

Quote:
Originally Posted by Firerat View Post
your ffmpeg version is very old, this may explain why "-c copy" did not work ( works fine here )

This *might* work with your version
Code:
ffmpeg -i Hysteria\ \(2011\)/Hysteria.2011.720p.bluray.x264.YIFY.mp4 \
       -i Bez\ isteriki.chopper887.avi \
       -map 0:0 -vcodec copy \
       -map 0:1 -acodec copy \
       -map 1:1 -acodec copy \
       Hysteria\ \(2011\)/Hysteria-eng-rus.mp4
 
Old 09-15-2019, 04:20 PM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,320

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
I honestly don't know

the version of ffmpeg is very old

If I take two videos, and use the original ffmpeg I gave I have no problem
The output is the Visual of first Video, + the audio of the fist and the second.

upgrade to a current ffmpeg, or check the ffmpeg documentation for the version you have
 
Old 09-15-2019, 04:40 PM   #9
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,320

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
more info on your ffmpeg version


https://stackoverflow.com/questions/...477756#9477756


if you upgrade Ubuntu you should get a real ffmpeg

you should upgrade Ubuntu anyway
https://en.wikipedia.org/wiki/Ubuntu_version_history

Support for Ubuntu 12.10 Quantal Quetzal officially ended on 16 May 2014.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I change my linux language to another language ? Matsane Linux - Newbie 8 04-15-2014 03:00 PM
Need to edit AVI movie clip SOUND ONLY and re-save to original movie clip Balarabay1 Linux - Software 1 02-06-2008 01:49 PM
300 Spartans movie great movie pazzibazi Linux - General 1 04-12-2007 02:00 PM
Creating a dvd movie out of different movie files.. memo007 Linux - Software 4 04-10-2007 10:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration