You are not logged in.
Pages: 1
I have a script i saved and have used for a while without any issues;
#!/bin/bash
for i in *.mkv
do
ffmpeg -i "$i" -acodec ac3 -vcodec copy "${i%.mkv}.mp4"
donewhich gives me;
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (ac3 (native) -> ac3 (native))
My question is, is it better for me to copy the audio instead and is AC3 -> AC3 going to give me an issue?
Sometimes i get AAC souce audio which is why i specify AC3
Offline
AC3 is probably lossy, so you'll probably lose quality (and time re-encoding). You could check what the codec is:
codec=`ffprobe video.mkv 2>&1 >/dev/null |grep Stream.*Audio | sed -e 's/.*Audio: //' -e 's/[, ].*//'`
if [ $codec == "ac3" ]
then
echo copy ffmpeg with -c:a copy
else
echo encode ffmpeg with -c:a ac3
fiIn case you're doing this for YouTube: in my experience, mkv is just fine.
Offline
i stream all my videos and the Rpi , ps3 and android all seem to like the .mp4 container and the ac3 audio. but sounds like aside from just time, im not really losing much. just wasnt sure how ffmeg would handle encoding to the same format, figured it would be better to reencode it for the new container to make sure the time stamps were right and the audio lined up... that was the big thing.
Offline
You don´t need to reencode (Ac3 to AC3) becouse time stamps..
Try This:
ffmpeg -fflags genpts -i "Video.mkv" -acodec copy -vcodec copy "Video.mp4"
Offline
is AC3 -> AC3 going to give me an issue?
No, other than wasting time re-encoding. You probably wouldn't notice a difference in quality. If something weird happens, like a change in channel layout, then it should be reported upstream.
Sometimes i get AAC souce audio which is why i specify AC3
AAC is the most common audio format for MP4 container, so stream copying it would be the best option.
You could check what the codec is:
codec=`ffprobe video.mkv 2>&1 >/dev/null |grep Stream.*Audio | sed -e 's/.*Audio: //' -e 's/[, ].*//'`
You can avoid the redirection, grep, and sed (see FFmpeg Wiki: FFprobe Tips).
$ ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -of default=nw=1:nk=1 input.mkv
aacNote that only the first audio stream will be probed in this example. If there are others they will be ignored. Change "-select_streams a:0" to "-select_streams a" if you want to list all.
Last edited by DrZaius (2015-04-18 23:41:57)
Offline
psjbeisler wrote:is AC3 -> AC3 going to give me an issue?
No, other than wasting time re-encoding. You probably wouldn't notice a difference in quality. If something weird happens, like a change in channel layout, then it should be reported upstream.
Thats pretty much what i was looking for.
Also i know there are some licensing issues of some kind with AC3, (Sony developed format wasn't it?) idk if that is the same with AAC (Apple maybe?) ...its been awhile since i played with audio formats but do more players handle AAC better than AC3. even in an mp4 container i thought i had issues w/ AAC audio. I thought like mkv, AAC had to be transcoded to play on some devices which i didnt think was the case w/ AC3.
Offline
Also i know there are some licensing issues of some kind with AC3, (Sony developed format wasn't it?) idk if that is the same with AAC (Apple maybe?)
Nobody cares about general users decoding and encoding for personal use. Don't let "licensing" FUD become a factor in your decision.
...its been awhile since i played with audio formats but do more players handle AAC better than AC3.
Probably. It's much more common.
even in an mp4 container i thought i had issues w/ AAC audio. I thought like mkv, AAC had to be transcoded to play on some devices which i didnt think was the case w/ AC3.
How can the issue be duplicated?
Offline
even in an mp4 container i thought i had issues w/ AAC audio. I thought like mkv, AAC had to be transcoded to play on some devices which i didnt think was the case w/ AC3.
How can the issue be duplicated?
I guess i can do an mp4 file w/ AAC and and another mp4 with AC3 and find out, but thanks that pretty much cleared everything up for me.
i did run into an issue with a player on Android telling me it couldnt do the AC3 audio because of a licensing issue, so its a lil more than FUD at that point but, it was only that once and it worked again shortly after... idk.
Last edited by psjbeisler (2015-04-19 00:09:33)
Offline
Pages: 1