Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

vob files demuxer

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
10 posts • Page 1 of 1
Author
Message
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

vob files demuxer

  • Quote

Post by sdauth » Wed Jan 10, 2024 12:32 pm

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.
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31985
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Wed Jan 10, 2024 12:37 pm

Maybe media-video/handbrake can do it.
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
sdauth
l33t
l33t
User avatar
Posts: 770
Joined: Wed Sep 19, 2018 2:48 am
Location: Ásgarðr

  • Quote

Post by sdauth » Wed Jan 10, 2024 6:06 pm

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: Select all

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.
Top
flexibeast
l33t
l33t
Posts: 682
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

  • Quote

Post by flexibeast » Thu Jan 11, 2024 11:34 am

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: 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}
    
}
Top
flexibeast
l33t
l33t
Posts: 682
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

  • Quote

Post by flexibeast » Thu Jan 11, 2024 11:44 am

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).
Top
yayo
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 122
Joined: Mon May 19, 2014 12:34 pm

  • Quote

Post by yayo » Fri Jan 19, 2024 6:02 pm

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/c ... mkv-ffmpeg

That's because vob files have no headers, so you must force ffmpeg to search for data streams "manually".
Top
Dragonix
Apprentice
Apprentice
Posts: 253
Joined: Sun May 21, 2006 6:18 pm
Location: Germany

  • Quote

Post by Dragonix » Sat Feb 03, 2024 1:04 pm

Hi,
ProjectX should do the job.
packages.gentoo.org
Website
Top
downloader
n00b
n00b
User avatar
Posts: 4
Joined: Sat Mar 09, 2024 8:44 pm

Help With Surf Browser Youtube Playback

  • Quote

Post by downloader » Sat Mar 09, 2024 9:03 pm

To demux all tracks (video, audio, subtitles) from a batch of VOB files using FFmpeg, you can employ a straightforward command:

Code: Select all

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: 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
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!
Top
flexibeast
l33t
l33t
Posts: 682
Joined: Mon Apr 04, 2022 4:15 am
Location: Naarm/Melbourne, Australia
Contact:
Contact flexibeast
Website

  • Quote

Post by flexibeast » Sun Mar 10, 2024 1:25 am

@downloader: In the first post, the OP wrote:
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?
Top
downloader
n00b
n00b
User avatar
Posts: 4
Joined: Sat Mar 09, 2024 8:44 pm

  • Quote

Post by downloader » Tue Mar 12, 2024 9:05 am

flexibeast wrote:@downloader: In the first post, the OP wrote:
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.
Top
Post Reply

10 posts • Page 1 of 1

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic