[FFmpeg-user] how to drop an input stream

Francois Visagie francois.visagie at gmail.com
Tue Sep 3 09:12:42 CEST 2013


> -----Original Message-----
> From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-
> bounces at ffmpeg.org] On Behalf Of gheine at mathnmaps.com
> Sent: 02 September 2013 21:11
> To: FFmpeg user questions
> Subject: Re: [FFmpeg-user] how to drop an input stream
> 
> Thanks for your assistance.
> 
> Tried
> 
> $ ffmpeg -i EE.mpg -map 0:1 -map 0:2  -target ntsc-dvd EEout.mpg
> 
> Output video, as you indicated, dropped the source data stream 0:0.

Unless you need/want to re-encode, you can do the above losslessly by adding
'-c: copy' to the command line. I haven't checked whether any '-target
ntsc-dvd' settings depend on re-encoding to take effect, though.

> However, feeding EEout.mpg into dvdauthor generated exactly the same
> synchronization errors.
> 
> Next I tried writing the audio and video to separate files, changing the
format
> of the audio, and recombining:
> 
> $ ffmpeg -i EE.mpg -map 0:1    EEaud.wav
> $ ffmpeg -i EE.mpg -map 0:2    EEvid.mpg
> $ ffmpeg -i EEaud.wav -i EEvid.mpg  -target ntsc-dvd EEout.mpg
> 
> This worked (no warnings or errors from dvdauthor).

Great stuff. I use GUI for dvdauthor (which uses either the dvdauthor or
muxman engine) and at least one of the two requires elementary streams like
you produced above. So possibly this was the cause of the error messages.

> <<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>
> 
> On 2013-09-02 01:52, Francois Visagie wrote:
> >> -----Original Message-----
> >> From: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-
> >> bounces at ffmpeg.org] On Behalf Of gheine at mathnmaps.com
> >> Sent: 02 September 2013 00:28
> >> To: ffmpeg-user at ffmpeg.org
> >> Subject: [FFmpeg-user] how to drop an input stream
> >>
> >> Have a short video clip ripped from a DVD (probably using mplayer -
> >> dumpstream).
> >> Here is what ffprobe says about the clip:
> >>
> >> <CODE>
> >> ffprobe version git-2013-08-25-626739e Copyright (c) 2007-2013 the
> >> FFmpeg developers
> >>    built on Aug 24 2013 20:38:02 with gcc 4.6 (Ubuntu/Linaro
> >> 4.6.3-1ubuntu5)
> >>    configuration: --prefix=/home/gheine/ffmpeg_build
> >> --extra-cflags=-I/home/gheine/ffmpeg_build/include
> >> --extra-ldflags=-L/home/gheine/ffmpeg_build/lib
> >> --bindir=/home/gheine/bin --extra-libs=-ldl --enable-gpl
> >> --enable-libass
> > --
> >> enable-libfdk-aac --enable-libmp3lame --enable-libopus
> >> --enable-libtheora
> > --
> >> enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree
> > --enable-
> >> x11grab
> >>    libavutil      52. 42.100 / 52. 42.100
> >>    libavcodec     55. 29.100 / 55. 29.100
> >>    libavformat    55. 14.102 / 55. 14.102
> >>    libavdevice    55.  3.100 / 55.  3.100
> >>    libavfilter     3. 82.102 /  3. 82.102
> >>    libswscale      2.  5.100 /  2.  5.100
> >>    libswresample   0. 17.103 /  0. 17.103
> >>    libpostproc    52.  3.100 / 52.  3.100
> >> [NULL @ 0xafe11e0] start time is not set in estimate_timings_from_pts
> > Input
> >> #0, mpeg, from 'EE.mpg':
> >>    Duration: 00:00:36.45, start: 0.514689, bitrate: 6504 kb/s
> >>      Stream #0:0[0x1bf]: Data: dvd_nav_packet
> >>      Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s
> >>      Stream #0:2[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480
> >> [SAR
> >> 8:9 DAR 4:3], max. 9000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94
> >> tbc Unsupported codec with id 1145979222 for input stream 0k </CODE>
> >>
> >> What's the best way to get rid of that unwanted data stream 0:0 ?
> >
> > Unless you explicitly include it with '-map', ffmpeg will
> > automatically exclude the data stream. See the section on stream
> selection:
> > http://www.ffmpeg.org/ffmpeg-all.html#Stream-selection.
> >
> >> Followup question:  ultimate goal is to rewrite this clip onto
> >> another
> > dvd.
> >> Here is the result using dvdauthor:
> >> <CODE>
> >> $ dvdauthor  -o ../Test/ -t EE.mpg --video=ntsc DVDAuthor::dvdauthor,
> >> version 0.7.0.
> >> Build options: gnugetopt imagemagick iconv freetype fribidi
> >> fontconfig
> > Send
> >> bug reports to <dvdauthor-users at lists.sourceforge.net>
> >>
> >> INFO: no default video format, must explicitly specify NTSC or PAL
> >> INFO: dvdauthor creating VTS
> >> STAT: Picking VTS 07
> >>
> >> STAT: Processing EE.mpg...
> >> WARN: Audio pts for channel 0 moves backwards by 2879; please
> >> remultiplex input.
> >> WARN: Previous sector: 0.500 - 0.564
> >> WARN: Current sector: 0.532 - 0.564
> >> WARN: Audio pts for channel 0 moves backwards by 1; please
> >> remultiplex input.
> >> WARN: Previous sector: 0.532 - 0.564
> >> WARN: Current sector: 0.564 - 0.596
> >> WARN: Audio pts for channel 0 moves backwards by 2; please
> >> remultiplex input.
> >> WARN: Previous sector: 0.948 - 0.980
> >> WARN: Current sector: 0.979 - 1.011
> >> ERR:  Cannot infer pts for VOBU if there is no audio or video and it
> >> is
> > the
> >> ERR:  first VOBU.`
> >> </CODE>
> >> Will getting rid of stream 0:0 fix this problem?
> >
> > I doubt it (in the sense that the data stream doesn't look to be the
> > cause of the problems), but remultiplexing as suggested should help
> > with the timestamp problems and will implicitly get rid of the data
> > stream anyway as above.
> >
> > For remultiplexing, specify a target file type with '-target
> > {pal|ntsc}-dvd'
> > as appropriate.
> >
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list