
Code: Select all
makemkvcon mkv file:MOVIE/VIDEO_TS 0 .
Code: Select all
extract_streams () {
V_EXT='mp4'
A_EXT='mp3'
FILE="${1}"
CMD="ffmpeg -i ${FILE}"
STREAMS=$(
ffprobe "${FILE}" 2>&1 | \
sed -n 's/^.*Stream #\([^[]*\)[^:]*: \([^:]*\):.*$/\1=\2/p; ' | \
tr '\n' ' '
)
for S in $STREAMS
do
OUT=
EXT=
case "${S}" in
*Video)
EXT=${V_EXT}
;;
*Audio)
EXT=${A_EXT}
;;
esac
if [ -n "${EXT}" ]
then
I=${S}
I=${I%%=Video}
I=${I%%=Audio}
N=$(echo $I | awk -F: '{ print $2 }')
OUT="stream-${N}.${EXT}"
CMD="${CMD} -map ${I} ${OUT}"
fi
done
echo "Running: $CMD"
${CMD}
}

Code: Select all
ffmpeg -i input.vob -map 0 -c copy output.mkv
Code: Select all
ffmpeg -i input.vob -c copy -map 0:v:0 video_track.vob -map 0:a audio_track.ac3 -map 0:s subtitle_track.sub

which i take as implying that the OP doesn't want to have to manually specify each of the streams and each distinct file those streams should be placed in. Hence the script i provided; whereas the second command you provided, to extract individual streams into distinct files, doesn't seem to avoid having to manually specify the stream to be extracted. Am i missing or misunderstanding either you or the OP?I know it is possible using mencoder or ffmpeg but one needs to manually input the stream id

The script you provided automates the extraction of all streams from the input file without requiring manual specification of each stream ID. On the other hand, the second command I suggested allows for the extraction of specific streams into separate files but necessitates manual input of the stream ID for each extraction. Both approaches offer solutions to the OP's query, with your script providing a more automated process and the second command allowing for more granular control over stream extraction. The choice between the two methods depends on the OP's preference regarding automation and the desired output format.flexibeast wrote:@downloader: In the first post, the OP wrote:
which i take as implying that the OP doesn't want to have to manually specify each of the streams and each distinct file those streams should be placed in. Hence the script i provided; whereas the second command you provided, to extract individual streams into distinct files, doesn't seem to avoid having to manually specify the stream to be extracted. Am i missing or misunderstanding either you or the OP?I know it is possible using mencoder or ffmpeg but one needs to manually input the stream id