Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
vob files demuxer
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
sdauth
Guru
Guru


Joined: 19 Sep 2018
Posts: 569
Location: Ásgarðr

PostPosted: Wed Jan 10, 2024 12:32 pm    Post subject: vob files demuxer Reply with quote

Hello,
Do you know an easy way to demux all tracks (video, audio, subtitles) from a bunch of VOB files ?
I know it is possible using mencoder or ffmpeg but one needs to manually input the stream id, what I want is to dump the whole thing in one command.
Right now I'm using makemkv to... make a mkv from the VOB, then I demux the mkv with mkvextract (from mkvtoolnix) to get the tracks separately but there must be a quicker way.
Thanks


Last edited by sdauth on Wed Feb 07, 2024 10:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30922
Location: here

PostPosted: Wed Jan 10, 2024 12:37 pm    Post subject: Reply with quote

Maybe media-video/handbrake can do it.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
sdauth
Guru
Guru


Joined: 19 Sep 2018
Posts: 569
Location: Ásgarðr

PostPosted: Wed Jan 10, 2024 6:06 pm    Post subject: Reply with quote

Unless it recently changed, you can't copy the video (lossless) with handbrake, and it will produce a mp4/mkv anyway.
My current workflow :
With makemkv (cli), I load the vob files and generate a mkv :
Code:
makemkvcon mkv file:MOVIE/VIDEO_TS 0 .


Then I use this nice python script : https://github.com/dropcreations/mkvextractor
and select option 1 to extract all tracks from the mkv.

It works, but I would like to do it in a single operation and avoid useless writes.
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Thu Jan 11, 2024 11:34 am    Post subject: Reply with quote

i've been nerd-sniped. :) i've been trying to learn ffmpeg recently, so ....

This is, obviously, very far from being a one-liner, and is clearly limited; but it's POSIX other than its use of ffmpeg(1) and ffprobe(1), and only invokes ffmpeg once.

Code:
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}
   
}
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Thu Jan 11, 2024 11:44 am    Post subject: Reply with quote

Oh, i meant to say, you specifically asked for the subtitles to be extracted as well, but i wasn't sure whether what ffprobe(1) reports as a 'Data' stream - as distinct from 'Video' or 'Audio' - is where the subtitles are? In any case, hopefully my function gives you a base to build on (assuming someone else doesn't provide a far more elegant solution).
Back to top
View user's profile Send private message
yayo
Tux's lil' helper
Tux's lil' helper


Joined: 19 May 2014
Posts: 88

PostPosted: Fri Jan 19, 2024 6:02 pm    Post subject: Reply with quote

This page suggests to use some extra options ( -analyzeduration # -probesize # ) while looking for streams in a vob file with ffmpeg (see step 2):
https://www.internalpointers.com/post/convert-vob-files-mkv-ffmpeg

That's because vob files have no headers, so you must force ffmpeg to search for data streams "manually".
Back to top
View user's profile Send private message
Dragonix
Apprentice
Apprentice


Joined: 21 May 2006
Posts: 253
Location: Germany

PostPosted: Sat Feb 03, 2024 1:04 pm    Post subject: Reply with quote

Hi,
ProjectX should do the job.
packages.gentoo.org
Website
Back to top
View user's profile Send private message
downloader
n00b
n00b


Joined: 09 Mar 2024
Posts: 4

PostPosted: Sat Mar 09, 2024 9:03 pm    Post subject: Help With Surf Browser Youtube Playback Reply with quote

To demux all tracks (video, audio, subtitles) from a batch of VOB files using FFmpeg, you can employ a straightforward command:
Code:
ffmpeg -i input.vob -map 0 -c copy output.mkv

This command remuxes the VOB files into a Matroska (MKV) container, preserving all tracks without any transcoding. The -map 0 option selects all streams from the input file, and -c copy copies them into the output MKV file without re-encoding.

Alternatively, if you prefer to demux directly from the VOB files without creating an intermediate MKV file, you can use:
Code:
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

In this command:

    -map 0:v:0 selects the first video stream.
    -map 0:a selects all audio streams.
    -map 0:s selects all subtitle streams.
    Replace input.vob with your VOB file's name and adjust the output file names (video_track.vob, audio_track.ac3, subtitle_track.sub) as needed.


These commands enable you to quickly demux all tracks from your VOB files with a single command. Let me know if you need further assistance!
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Sun Mar 10, 2024 1:25 am    Post subject: Reply with quote

@downloader: In the first post, the OP wrote:

Quote:
I know it is possible using mencoder or ffmpeg but one needs to manually input the stream id

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?
Back to top
View user's profile Send private message
downloader
n00b
n00b


Joined: 09 Mar 2024
Posts: 4

PostPosted: Tue Mar 12, 2024 9:05 am    Post subject: Reply with quote

flexibeast wrote:
@downloader: In the first post, the OP wrote:

Quote:
I know it is possible using mencoder or ffmpeg but one needs to manually input the stream id

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?

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum