Tried it both with and without, from memory. But not using quotes breaks it because of spaces in the filename anyway.
+ Reply to Thread
Results 121 to 150 of 183
-
-
Code:
for %%F in (*.mkv) do ( ffmpeg -i "%%F" -vcodec copy -acodec copy -map a:0 "%~nF.ac3" -map v:0 "%~nF.mp4" ) pause
Last edited by koberulz; 10th Mar 2020 at 23:22. Reason: Typo
-
The percent sign in a batch file is used to indicate command line arguments passed to the batch file. To use it within a FOR loop you need to "escape" it.
https://www.robvanderwoude.com/escapechars.php
So you need to use %% instead of %. In this case: "%%~nF.ac3" and "%%~nF.mp4" -
Yes, it's very common for the opening and closing sequences for TV shows to be different than the body of the show. Individual shots are often sped up or slowed down to match the music. Titles are often overlaid as interlaced video (60 different fields per second) to smooth out their motion. Etc.
-
How do you want to handle it? I usually don't care about the credits and just use TFM() or TFM(pp=0).vinverse() to remove any residual comb artifacts -- especially if the credits don't move but only fade in/out. Or you could just encode the entire video at 59.94 fps to keep the fluid motion of the credits. Or encode VFR with the open and closing sequences at 59.94 fps and the body of the video at 23.976 fps.
-
https://youtu.be/JivPEYjYd20
It's this sequence. Not exactly subtle. -
Is flagging the whole thing as interlaced an option? Progressive footage seems to work just fine flagged as interlaced most of the time anyway, as most of these DVDs are progressive but interlaced-flagged.
-
Sometimes opening/closing credits are converted by another method while the rest of the episode is sped up, in order to keep the original pitch and and tempo of the music.
-
-
-
-
-
That requires each track to be its own file, no? My starting point is an MKV multiple tracks, not two separate audio files.
-
No, you are not limited to separate files. With LSmash and ffAudioSource you can specify which audio track is to be opened. Even if you were limited to separate files you could always demux one of the tracks to get a separate file.
-
Yes, MergeChannels, not MixAudio. Use ffmpeg's "map" and "amerge" or "join" to select and merge audio channels to one stream.
https://trac.ffmpeg.org/wiki/AudioChannelManipulation -
How do I know what channel should go where though?
EDIT: After more reading, even more confused. I'm not sure which filter I should be using, or how I should be using it, and I have no idea how to make it an audio track in the muxed file instead of just outputting an audio file which is what all those examples do.
At present I'm guessing I have an AVS file that results in 7.1 audio where the first six channels are the 5.1 track and the last two are the stereo track.Last edited by koberulz; 15th Mar 2020 at 07:20.
-
I was hoping you would figure something out on your own so I wouldn't have to spend my time on it. Here's what I came up with. Assuming input.avs merges a 5.1 track and a 2.0 track into a single 8 channel track (as discussed before):
Code:ffmpeg -y -i "input.avs" -i input.avs ^ -filter_complex "[0:a]channelmap=map=FL-FL|FR-FR|FC-FC|LFE-LFE|BL-BL|BR-BR:channel_layout=5.1" ^ -filter_complex "[1:a]channelmap=map=SL-FL|SR-FR:channel_layout=stereo" ^ -c:v libx264 ^ -c:a ac3 ^ -map 0:0 -map 0:1 -map 1:1 ^ output.mkv
-
Unfortunately no, it's too far outside what I'm familiar with for me to understand it enough to start working with it.
Why are you using two input.avs? One for the first filter_complex and one for the second filter_complex? Is there a reason you can't run them both on the same input?
From my reading of that: the first filter_complex maps the audio to track 0, the second maps the audio to track 1. We then encode the video as previously and re-encode the audio as ac3.
But the map line throws me. 0:0 and 1:1 make sense, but why 0:1? The documentation doesn't seem to mention syntax for map so I'm not sure which is input and which is output, but that code seems to run the same track from the input into two different output tracks, which doesn't make much sense.
Also, why the ^ symbols? Escaping the line breaks? -
I couldn't figure out how to split one audio track into two, and then handle the two tracks differently. So to get two audio tracks I just loaded the AVS twice.
The first filter_complex works on the audio track from file 0 (0:a). The second filter works on the audio track from file 1 (1:a).
Yes. The video track from the second input file isn't used so it shouldn't slow down the processing.
The first number is the input file number. file 0, file 1, etc. The second number is the track number within that file. So 0:1 is file 0, track 1. It could also have been written with the v/a convention "map 0:v map 0:a map 1:a".
For the CLI end-of-line is normally the end of the command. So if you want to spread one long command line over several lines you need to escape the EOL. The command is equivalent to:
Code:ffmpeg -y -i "input.avs" -i input.avs -filter_complex "[0:a]channelmap=map=FL-FL|FR-FR|FC-FC|LFE-LFE|BL-BL|BR-BR:channel_layout=5.1" -filter_complex "[1:a]channelmap=map=SL-FL|SR-FR:channel_layout=stereo" -c:v libx264 -c:a ac3 -map 0:0 -map 0:1 -map 1:1 output.mkv
-
I figured out how to do it with only one input. It turned out to be simpler than I expected:
Code:ffmpeg -y -i "video.avs" ^ -filter_complex "[0:1]channelmap=map=FL-FL|FR-FR|FC-FC|LFE-LFE|BL-BL|BR-BR:channel_layout=5.1" ^ -filter_complex "[0:1]channelmap=map=SL-FL|SR-FR:channel_layout=stereo" ^ -c:v libx264 ^ -c:a ac3 ^ output.mkv
-
I'm getting an error on MergeChannels saying the clips need to have the same sample rate, but MediaInfo reports they're both 48.0kHz.
Code:Audio #1 ID : 2 ID in the original source medium : 189 (0xBD)-128 (0x80) Format : AC-3 Format/Info : Audio Coding 3 Codec ID : A_AC3 Duration : 1 h 35 min Bit rate : 384 kb/s Channel(s) : 6 channels Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 spf) Compression mode : Lossy Stream size : 263 MiB (6%) Title : Dolby Digital 5.1 Language : English Default : Yes Forced : No Audio #2 ID : 3 ID in the original source medium : 189 (0xBD)-129 (0x81) Format : AC-3 Format/Info : Audio Coding 3 Codec ID : A_AC3 Duration : 1 h 35 min Bit rate : 192 kb/s Channel(s) : 2 channels Sampling rate : 48.0 kHz Frame rate : 31.250 FPS (1536 spf) Compression mode : Lossy Stream size : 132 MiB (3%) Title : Commentary DD 2.0 Language : English Default : No Forced : No
Code:for %%F in (*.mkv) do ( echo A = LWLibAvVideoSource("%%F"^) > script.avs echo B = LWLibAvAudioSource("%%F",stream_index=1^) >> script.avs echo C = LWLibAVAudioSource("%%F",stream_index=2^) >> script.avs echo MergeChannels (A,B,C^) >> script.avs rem echo AudioDub(A,B^) >> script.avs echo AssumeFPS(24000,1001,sync_audio=true^) >> script.avs echo ResampleAudio(48000^) >> script.avs
Similar Threads
-
Multiple video episodes from DVD to BD
By Tim Berlin in forum Authoring (Blu-ray)Replies: 7Last Post: 23rd Dec 2019, 12:39 -
Trying to get tv episodes onto my iPod video
By noblenutria in forum Newbie / General discussionsReplies: 4Last Post: 9th Sep 2019, 12:07 -
Ripping Episodes from my Bluray-Disc
By JonNada in forum Blu-ray RippingReplies: 1Last Post: 2nd Jan 2018, 01:20 -
Is there a way to list all subtitle tracks for all my episodes?
By zephyr22 in forum SubtitleReplies: 4Last Post: 3rd Jun 2016, 07:01 -
multiavchd---shows only 12 of 15 episodes
By mysts in forum Authoring (Blu-ray)Replies: 0Last Post: 27th Jul 2015, 12:20