Converting MPEG 2 issues

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Converting MPEG 2 issues

rava77
I have a MPEG 2 file with several audio tracks and one video track.
I want to convert it into something smaller, much smaller than MPEG 2, using ffmpeg. I try to create either ogv or mkv containers with good quality and smallest filesize. And I only want to keep the first 2 audio tracks. These can either stay as 6ch or be downmixed into 2ch.

My current ffmpeg version is:
__________

ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-3.4.2/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-pthreads --enable-libtheora --enable-libvorbis --enable-gpl --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-gnutls --enable-libcdio --enable-opengl --arch=x86_64 --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-libspeex --enable-nonfree --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libbluray --enable-libass --enable-libopus --enable-libtwolame --enable-libpulse
libavutil      55. 78.100 / 55. 78.100
libavcodec     57.107.100 / 57.107.100
libavformat    57. 83.100 / 57. 83.100
libavdevice    57. 10.100 / 57. 10.100
libavfilter     6.107.100 /  6.107.100
libswscale      4.  8.100 /  4.  8.100
libswresample   2.  9.100 /  2.  9.100
libpostproc    54.  7.100 / 54.  7.100
__________

System: slackware based x86-64 Linux.

This is the info when playing the original mpeg file using mpv (V 0.27.2)
__________

Playing: capture_V0.mpg
 (+) Video --vid=1 (mpeg2video 720x576 25.000fps)
VO: [opengl] 720x576 => 1024x576 yuv420p
 (+) Video --vid=1 (mpeg2video 720x576 25.000fps)
     Audio --aid=1 (ac3 6ch 48000Hz)
     Audio --aid=2 (ac3 6ch 48000Hz)
     Audio --aid=3 (ac3 6ch 48000Hz)
     Audio --aid=4 (ac3 2ch 48000Hz)
__________

I want to keep audio track 1 ("aid=1") and audio track 2 ("aid=2"), or how ffmpeg usually addresses these: "audio0 audio1"
The other 2 audio tracks can be rejected / should not be added into the resulting mkv or ogv.

To test if everything works okay I first created some 30 seconds sample video (using stream copy and the same container format than the original, mpg), deleting some video stuff at the beginning I don't want to keep ( thats what the "-ss 1:15.500" is for )
But I don't seem to get it right at all. I read the ffmpeg documentation ( http://ffmpeg.org//ffmpeg.html ), and also some posts about mapping on video.stackexchange.com and superuser.com, still I fail in adding the two audio tracks.

Here is how I tried creating the 30 seconds test video:
__________

ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0:0 -map 0:1 -c:a ac3 -codec copy -acodec copy -t 30 capture_V1_30s.mpg
[mpeg @ 0x2540de0] Invalid media type data for output stream #0
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

$ ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0 -codec copy -acodec copy -t 30 capture_V1_30s.mpg
[mpeg @ 0x1a71b20] Invalid media type data for output stream #0
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

$ ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0:0 -map 0:1 -codec copy -t 30 capture_V1_30s.mpg
[mpeg @ 0xe5fae0] Invalid media type data for output stream #0
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
__________

All these attempts with mapping failed, so I tried one version without any mapping:
__________

time ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -codec copy  -t 30 capture_V1_30s.mpg

real 0m3.233s
user 0m0.911s
sys 0m0.811s
__________

That /looks/ like it did work… but there is no audio track in the resulting 30 seconds test video:
__________

$ mpv capture_V1_30s.mpg
Playing: capture_V1_30s.mpg
 (+) Video --vid=1 (mpeg2video 720x576 25.000fps)
VO: [opengl] 720x576 => 1024x576 yuv420p
V: 00:00:10 / 00:00:30 (20%) Cache: 10s+11MB
__________

Unlike the ffmpeg documentation which says, unless you use the -map options, one video and one audio track is used, the video with the largest resolution, and the audio with the most tracks, and if there are more audio tracks, the one with the lowest index. Which should be in this case: audio 0 (or Audio --aid=1 (ac3 6ch 48000Hz) as mpv calls it).

*Why is there no audio when using -codec copy ? Using -codec copy _and_ -acodec copy has the same result: no audio, the resulting mpg only has video.*

*What do I do wrong trying to use -map to include the 1st and 2nd audio track (aka audio0 and audio1) ?*

There seems to be some glitch in the original capture_V0.mpg file. Playing it with mpv results in mpv updating the info it gives after some seconds at the beginning, and the video played indeed shows some kind of repeat.
The video starts, and then it looks like the video starts again, seemingly playing the same video from the start, but the 2nd time it not stopped and results in the start of the actual video that I want to keep - all from "-ss 1:15.500" till the end.
Since all that is in the part of the video I want to cut off, it should not be an issue creating the sample videos, and it also should not be an issue creating the real ogv or mkv.

The resulting capture_V1_30s.mpg, the one with no sound as described above is indeed the beginning of the video I want to have as ogv or mkv, with everything at the beginning cut off, including the weird repeat-glitch.


Cheers
Yours truly, Rava
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Converting MPEG 2 issues

Moritz Barsnick
On Sun, Apr 01, 2018 at 03:22:10 +0200, [hidden email] wrote:
> I want to keep audio track 1 ("aid=1") and audio track 2 ("aid=2"), or how ffmpeg usually addresses these: "audio0 audio1"
> The other 2 audio tracks can be rejected / should not be added into the resulting mkv or ogv.

No problem.

> Here is how I tried creating the 30 seconds test video:
> __________
>
> ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0:0 -map 0:1 -c:a ac3 -codec copy -acodec copy -t 30 capture_V1_30s.mpg
> [mpeg @ 0x2540de0] Invalid media type data for output stream #0
> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
>
> $ ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0 -codec copy -acodec copy -t 30 capture_V1_30s.mpg
> [mpeg @ 0x1a71b20] Invalid media type data for output stream #0
> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
>
> $ ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0:0 -map 0:1 -codec copy -t 30 capture_V1_30s.mpg
> [mpeg @ 0xe5fae0] Invalid media type data for output stream #0
> Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

First of all, you need to should us the *complete* console output,
while omitting "-v error". Because when using this option, you are
surpressing all the valuable information.

Secondly, your command lines are a bit confusing:
$ [...] -c:a ac3 -codec copy -acodec copy
             ^^^
Do you want to (re-)encode your audio to ac3, or do you want to keep it
(copy)?

Thirdly:
$ [...] -map 0:0 -map 0:1
will map streams 0 and 1 from your file. Presumably the video track and
the first audio track. If you want the first *two* audio tracks, you
probably need to add "-map 0:2", or you do
$ [...] -map 0:v -map 0:a:0 -map 0:a:1

> That /looks/ like it did work… but there is no audio track in the resulting 30 seconds test video:

Again, you need to show us the console output *without -v error*. You
are hiding all the information about your input files and the process
from us.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Converting MPEG 2 issues

rava77
> Sent: Monday, 02. April 2018 um 14:00 Uhr, by "Moritz Barsnick" <[hidden email]>

> > I want to keep audio track 1 ("aid=1") and audio track 2 ("aid=2"), or how ffmpeg usually addresses these: "audio0 audio1"
> > The other 2 audio tracks can be rejected / should not be added into the resulting mkv or ogv.
>
> No problem.

Good to know.


> $ [...] -map 0:v -map 0:a:0 -map 0:a:1

That also fails:
_________________________

# ffmpeg -y -ss 1:15.500 -i capture_V0.mpg -map 0:v -map 0:a:0 -map 0:a:1 -t 30 capture_v1_30s.mkv
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (GCC)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-3.4.2/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-pthreads --enable-libtheora --enable-libvorbis --enable-gpl --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-gnutls --enable-libcdio --enable-opengl --arch=x86_64 --enable-libmp3lame --enable-libxvid --enable-libx264 --enable-libspeex --enable-nonfree --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libbluray --enable-libass --enable-libopus --enable-libtwolame --enable-libpulse
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mpeg, from 'capture_V0.mpg':
  Duration: N/A, start: 0.280633, bitrate: N/A
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 7000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x28]: Subtitle: dvd_subtitle
    Stream #0:3[0x29]: Subtitle: dvd_subtitle
Stream map '0:a:0' matches no streams.
To ignore this, add a trailing '?' to the map.
_________________________

The above ends with no file being created. There are indeed also subtitles, but I don't want to keep any.

And here the version without mapping, the one that again (this time creating a mkv, not an mpg, and not using stream-copy as well) results in just video without any audio. (I leave out the banner, it is the very same than above.)
_________________________

# ffmpeg -hide_banner -y -ss 1:15.500 -i capture_V0.mpg -t 30 capture_V1_30s.mkv
Input #0, mpeg, from 'capture_V0.mpg':
  Duration: N/A, start: 0.280633, bitrate: N/A
    Stream #0:0[0x1bf]: Data: dvd_nav_packet
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 7000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x28]: Subtitle: dvd_subtitle
    Stream #0:3[0x29]: Subtitle: dvd_subtitle
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[mpeg @ 0x15b27c0] New audio stream 0:4 at pos:76978190 and DTS:75.3496s
[mpeg @ 0x15b27c0] New audio stream 0:5 at pos:76980238 and DTS:75.3496s
[mpeg @ 0x15b27c0] New audio stream 0:6 at pos:76982286 and DTS:75.3496s
[mpeg @ 0x15b27c0] New audio stream 0:7 at pos:77015054 and DTS:75.4456s
[libx264 @ 0x16169e0] using SAR=64/45
[libx264 @ 0x16169e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x16169e0] profile High, level 3.0
[libx264 @ 0x16169e0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'capture_V1_30s.mkv':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=-1--1, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.107.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[mpeg @ 0x15b27c0] New subtitle stream 0:8 at pos:79061006 and DTS:77.4616s
[mpeg @ 0x15b27c0] New subtitle stream 0:9 at pos:79067150 and DTS:77.4616s
[mpeg @ 0x15b27c0] New subtitle stream 0:10 at pos:79073294 and DTS:77.4616s
frame=   46 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   frame=   88 fps= 82 q=28.0 size=       1kB time=00:00:01.16 bitrate=   5.2kbits/frame=  127 fps= 77 q=28.0 size=      50kB time=00:00:02.72 bitrate= 151.5kbits/[mpeg @ 0x15b27c0] New subtitle stream 0:11 at pos:84781070 and DTS:82.7016s
frame=  187 fps= 87 q=28.0 size=      50kB time=00:00:05.12 bitrate=  80.5kbits/frame=  253 fps= 96 q=28.0 size=     125kB time=00:00:07.76 bitrate= 131.9kbits/frame=  323 fps=102 q=28.0 size=     125kB time=00:00:10.56 bitrate=  96.9kbits/frame=  387 fps=105 q=28.0 size=     185kB time=00:00:13.12 bitrate= 115.3kbits/frame=  453 fps=108 q=28.0 size=     185kB time=00:00:15.76 bitrate=  96.0kbits/frame=  517 fps=110 q=28.0 size=     270kB time=00:00:18.32 bitrate= 120.5kbits/frame=  574 fps=111 q=28.0 size=     270kB time=00:00:20.60 bitrate= 107.2kbits/[mpeg @ 0x15b27c0] New subtitle stream 0:12 at pos:104108046 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:13 at pos:104112142 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:14 at pos:104116238 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:15 at pos:104120334 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:16 at pos:104132622 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:17 at pos:104136718 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:18 at pos:104140814 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:19 at pos:104146958 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:20 at pos:104151054 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:21 at pos:104157198 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:22 at pos:104161294 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:23 at pos:104165390 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:24 at pos:104175630 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:25 at pos:104179726 and DTS:100.422s
[mpeg @ 0x15b27c0] New subtitle stream 0:26 at pos:104220686 and DTS:100.462s
[mpeg @ 0x15b27c0] New subtitle stream 0:27 at pos:104224782 and DTS:100.462s
[mpeg @ 0x15b27c0] New subtitle stream 0:28 at pos:104306702 and DTS:100.502s
[mpeg @ 0x15b27c0] New subtitle stream 0:29 at pos:104314894 and DTS:100.502s
[mpeg @ 0x15b27c0] New subtitle stream 0:30 at pos:104318990 and DTS:100.502s
[mpeg @ 0x15b27c0] New subtitle stream 0:31 at pos:104323086 and DTS:100.502s
frame=  625 fps=110 q=28.0 size=     387kB time=00:00:22.64 bitrate= 140.0kbits/frame=  671 fps=108 q=28.0 size=     535kB time=00:00:24.48 bitrate= 179.0kbits/frame=  710 fps=106 q=28.0 size=     535kB time=00:00:26.04 bitrate= 168.2kbits/frame=  750 fps= 94 q=-1.0 Lsize=    1471kB time=00:00:29.88 bitrate= 403.3kbits/s speed=3.74x    
video:1465kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.423144%
[libx264 @ 0x16169e0] frame I:14    Avg QP:16.74  size:  8947
[libx264 @ 0x16169e0] frame P:221   Avg QP:19.90  size:  3946
[libx264 @ 0x16169e0] frame B:515   Avg QP:21.15  size:   975
[libx264 @ 0x16169e0] consecutive B-frames:  2.9%  5.6% 32.8% 58.7%
[libx264 @ 0x16169e0] mb I  I16..4: 62.1% 32.9%  5.0%
[libx264 @ 0x16169e0] mb P  I16..4:  3.1%  3.3%  0.5%  P16..4: 16.5%  5.1%  3.8%  0.0%  0.0%    skip:67.7%
[libx264 @ 0x16169e0] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8: 15.5%  1.1%  0.4%  direct: 1.0%  skip:81.8%  L0:40.6% L1:56.6% BI: 2.8%
[libx264 @ 0x16169e0] 8x8 transform intra:40.6% inter:72.9%
[libx264 @ 0x16169e0] coded y,uvDC,uvAC intra: 24.7% 35.2% 19.9% inter: 4.2% 6.5% 1.5%
[libx264 @ 0x16169e0] i16 v,h,dc,p: 61% 23%  6%  9%
[libx264 @ 0x16169e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 17% 44%  3%  3%  4%  4%  4%  4%
[libx264 @ 0x16169e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 14% 20%  6%  7% 10%  5%  7%  4%
[libx264 @ 0x16169e0] i8c dc,h,v,p: 64% 19% 14%  3%
[libx264 @ 0x16169e0] Weighted P-Frames: Y:4.1% UV:3.2%
[libx264 @ 0x16169e0] ref P L0: 66.5%  9.3% 17.6%  6.5%  0.0%
[libx264 @ 0x16169e0] ref B L0: 86.6% 11.3%  2.1%
[libx264 @ 0x16169e0] ref B L1: 97.6%  2.4%
[libx264 @ 0x16169e0] kb/s:399.87
_________________________

No sound:

# mpv capture_V1_30s.mkv
Playing: capture_V1_30s.mkv
 (+) Video --vid=1 (*) (h264 720x576 25.000fps)
VO: [opengl] 720x576 => 1024x576 yuv420p
V: 00:00:01 / 00:00:30 (6%) Cache: 10s+1MB
_________________________


Cheers


--


> Gesendet: Montag, 02. April 2018 um 14:00 Uhr
> Von: "Moritz Barsnick" <[hidden email]>
> An: "FFmpeg user discussions" <[hidden email]>
> Betreff: Re: [FFmpeg-user] Converting MPEG 2 issues
>
> On Sun, Apr 01, 2018 at 03:22:10 +0200, [hidden email] wrote:
> > I want to keep audio track 1 ("aid=1") and audio track 2 ("aid=2"), or how ffmpeg usually addresses these: "audio0 audio1"
> > The other 2 audio tracks can be rejected / should not be added into the resulting mkv or ogv.
>
> No problem.
>
> > Here is how I tried creating the 30 seconds test video:
> > __________
> >
> > ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0:0 -map 0:1 -c:a ac3 -codec copy -acodec copy -t 30 capture_V1_30s.mpg
> > [mpeg @ 0x2540de0] Invalid media type data for output stream #0
> > Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
> >
> > $ ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0 -codec copy -acodec copy -t 30 capture_V1_30s.mpg
> > [mpeg @ 0x1a71b20] Invalid media type data for output stream #0
> > Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
> >
> > $ ffmpeg -y -v error -ss 1:15.500 -i capture_V0.mpg -map 0:0 -map 0:1 -codec copy -t 30 capture_V1_30s.mpg
> > [mpeg @ 0xe5fae0] Invalid media type data for output stream #0
> > Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
>
> First of all, you need to should us the *complete* console output,
> while omitting "-v error". Because when using this option, you are
> surpressing all the valuable information.
>
> Secondly, your command lines are a bit confusing:
> $ [...] -c:a ac3 -codec copy -acodec copy
>              ^^^
> Do you want to (re-)encode your audio to ac3, or do you want to keep it
> (copy)?
>
> Thirdly:
> $ [...] -map 0:0 -map 0:1
> will map streams 0 and 1 from your file. Presumably the video track and
> the first audio track. If you want the first *two* audio tracks, you
> probably need to add "-map 0:2", or you do
> $ [...] -map 0:v -map 0:a:0 -map 0:a:1
>
> > That /looks/ like it did work… but there is no audio track in the resulting 30 seconds test video:
>
> Again, you need to show us the console output *without -v error*. You
> are hiding all the information about your input files and the process
> from us.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Converting MPEG 2 issues

Moritz Barsnick
On Tue, Apr 03, 2018 at 17:43:03 +0200, [hidden email] wrote:
> > $ [...] -map 0:v -map 0:a:0 -map 0:a:1
> That also fails:

Because, unlike mpv, ffmpeg fails to recognize the audio streams which
appear later:

> # ffmpeg -hide_banner -y -ss 1:15.500 -i capture_V0.mpg -t 30 capture_V1_30s.mkv
[...]
> [mpeg @ 0x15b27c0] New audio stream 0:4 at pos:76978190 and DTS:75.3496s
> [mpeg @ 0x15b27c0] New audio stream 0:5 at pos:76980238 and DTS:75.3496s
> [mpeg @ 0x15b27c0] New audio stream 0:6 at pos:76982286 and DTS:75.3496s
> [mpeg @ 0x15b27c0] New audio stream 0:7 at pos:77015054 and DTS:75.4456s

Using just
$ ffmpeg -i capture_V0.mpg
you will see that ffmpeg doesn't see the audio streams initially.

In order to access these, ffmpeg requires the option(s) "-probesize"
and/or "-analyzeduration".

Please try whether
$ ffmpeg -probesize 100000000 -analyzeduration 100000000 -i capture_V0.mpg
shows info about significantly more streams (i.e. including the
expected audio streams 0:4 .. 0:8). Try with larger values as well. If
so, add those options to your conversion command line. You can then try
my suggested maps again, or "-map 0:v -map 0:4 -map 0:5" or the likes.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Converting MPEG 2 issues

rava77
> Gesendet: Dienstag, 03. April 2018 um 23:07 Uhr
> Von: "Moritz Barsnick" <[hidden email]>

ffmpeg -probesize 100000000 -analyzeduration 100000000 -i capture_V0.mpg indeed is able to show the audio info. The two wanted streams appear like so:

    Stream #0:4[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
    Stream #0:5[0x81]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s

# ffmpeg -hide_banner -y  -probesize 100000000 -analyzeduration 100000000  -ss 1:15.500 -i capture_V0.mpg -map 0:v -map 0:a:0 -map 0:a:1  -vf yadif -t 30 capture_V1_30s.mkv

works as it should, the resulting 30 seconds clip has both audio tracks I want to keep.

And adding some crop together with the conversion also works.

The final command line is:

ffmpeg -hide_banner -y -probesize 100000000 -analyzeduration 100000000 -ss 1:15.500 -i capture_V0.mpg -map 0:v -map 0:a:0 -map 0:a:1 -vf yadif,crop=692:530:14:23 -t 30 capture_V1_30s_crop.mkv

Seems, I can switch on the " -v error " (to speed up the conversion, should have thought of leaving it away for getting to the source of the error when posting my question) and do the full converion.

Thanks a lot, Moritz!

Cheers
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".