The purpose of doing this is because my "Smart" samsung TV doesn't play MKV files.
This thread mentions that there is no need for video conversion, just changing the container might suffice. After reading multiple threads on how to change the container of MKV to MP4, I downloaded and compiled the FFMPEG with libfdk_aac support from here. I tried converting a sample MKV file using this command:
ffmpeg -i "C:\VideoTest\Sample1.mkv" -c:v copy -c:a libfdk_aac -b:a 384k "C:\VideoTest\Sample2.mp4"
but getting the following errors (copied from command prompt):
[hevc # 0000000000308ae0] Could not find ref with POC 113
[hevc # 0000000000308ae0] Could not find ref with POC 111
[hevc # 0000000000308ae0] Could not find ref with POC 109
[hevc # 0000000000308ae0] Could not find ref with POC 107
Input #0, matroska,webm, from 'C:\VideoTest\Sample-1.mk
v':
Metadata:
encoder : libebml v1.3.0 + libmatroska v1.4.1
creation_time : 2014-07-16 08:54:02
Duration: 00:00:58.68, start: 0.042000, bitrate: 3520 kb/s
Chapter #0.0: start 0.000000, end 58.717000
Metadata:
title : Chapter 4
Stream #0:0: Video: hevc (Main), yuv420p(tv), 1920x816, SAR 1:1 DAR 40:17, 2
4 fps, 24 tbr, 1k tbn, 1k tbc (default)
Metadata:
_STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
Jun 9 2014 15:16:27
_STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun 9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
_STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 2733260
BPS-eng : 2733260
DURATION : 00:00:58.667000000
DURATION-eng : 00:00:58.667000000
NUMBER_OF_FRAMES: 1408
NUMBER_OF_FRAMES-eng: 1408
NUMBER_OF_BYTES : 20044023
NUMBER_OF_BYTES-eng: 20044023
Stream #0:1: Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 768 kb/s (default)
Metadata:
_STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
Jun 9 2014 15:16:27
_STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun 9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
_STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 767986
BPS-eng : 767986
DURATION : 00:00:58.625000000
DURATION-eng : 00:00:58.625000000
NUMBER_OF_FRAMES: 5496
NUMBER_OF_FRAMES-eng: 5496
NUMBER_OF_BYTES : 5627904
NUMBER_OF_BYTES-eng: 5627904
Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080 (default)
Metadata:
_STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
Jun 9 2014 15:16:27
_STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun 9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
_STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 17485
BPS-eng : 17485
DURATION : 00:00:56.750000000
DURATION-eng : 00:00:56.750000000
NUMBER_OF_FRAMES: 40
NUMBER_OF_FRAMES-eng: 40
NUMBER_OF_BYTES : 124036
NUMBER_OF_BYTES-eng: 124036
Output #0, mp4, to 'C:\VideoTest\Sample.mp4':
Metadata:
encoder : Lavf56.1.100
Chapter #0.0: start 0.000000, end 58.675000
Metadata:
title : Chapter 4
Stream #0:0: Video: hevc ([35][0][0][0] / 0x0023), yuv420p, 1920x816 [SAR 1:
1 DAR 40:17], q=2-31, 24 fps, 16k tbn, 1k tbc (default)
Metadata:
_STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
Jun 9 2014 15:16:27
_STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun 9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
_STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 2733260
BPS-eng : 2733260
DURATION : 00:00:58.667000000
DURATION-eng : 00:00:58.667000000
NUMBER_OF_FRAMES: 1408
NUMBER_OF_FRAMES-eng: 1408
NUMBER_OF_BYTES : 20044023
NUMBER_OF_BYTES-eng: 20044023
Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000 Hz, 5.1
, s16, 128 kb/s (default)
Metadata:
_STATISTICS_WRITING_APP: mkvmerge v7.0.0 ('Where We Going') 64bit built on
Jun 9 2014 15:16:27
_STATISTICS_WRITING_APP-eng: mkvmerge v7.0.0 ('Where We Going') 64bit buil
t on Jun 9 2014 15:16:27
_STATISTICS_WRITING_DATE_UTC: 2014-07-16 08:54:02
_STATISTICS_WRITING_DATE_UTC-eng: 2014-07-16 08:54:02
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
BPS : 767986
BPS-eng : 767986
DURATION : 00:00:58.625000000
DURATION-eng : 00:00:58.625000000
NUMBER_OF_FRAMES: 5496
NUMBER_OF_FRAMES-eng: 5496
NUMBER_OF_BYTES : 5627904
NUMBER_OF_BYTES-eng: 5627904
encoder : Lavc56.0.101 libfdk_aac
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (dts (dca) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
[mp4 # 0000000003be0500] Invalid DTS: 656 PTS: -672 in output stream 0:0
av_interleaved_write_frame(): Invalid argument
[libfdk_aac # 00000000042fa640] Trying to remove 1024 samples, but the queue is
empty
[mp4 # 0000000003be0500] Encoder did not produce proper pts, making some up.
[libfdk_aac # 00000000042fa640] Trying to remove 1024 samples, but the queue is
empty
frame= 2 fps=0.0 q=-1.0 Lsize= 96kB time=00:00:00.04 bitrate=18415.0kbit
s/s
video:95kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
erhead: 0.570364%
Conversion failed!
Also tried using this command:
ffmpeg -i input.wav -c:a libfdk_aac -b:a 128k output.mp4
But this screws up the video quality and I start seeing some bad pixelated patches during the playback.
Any help would be appreciated.
Just an FYI: I got this far by reading blogs and posts. I have 0 knowledge about video conversion.
If you can't play the video after your first command, then (evidently) your TV can't deal with the originally encoded video stream. So - give a shot at re-encoding with another codec. This will produce a high quality re-encoded version (it will take a while to re-encode):
ffmpeg -i input.mkv -qscale 1 -c:a libfdk_aac -b:a 384k output.mp4
Related
I have this mkv video with multiple subtitles. the last one has no metadata and i would like to add title and language
Input #0, matroska,webm, from '1.mkv':
Metadata:
ENCODER : Lavf59.34.102
Duration: 00:34:58.02, start: 0.000000, bitrate: 10341 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
Metadata:
BPS-eng : 9953181
DURATION-eng : 00:34:57.973000000
NUMBER_OF_FRAMES-eng: 50301
NUMBER_OF_BYTES-eng: 2610188172
_STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2019-11-02 14:19:53
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:34:57.972000000
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
Metadata:
BPS-eng : 384000
DURATION-eng : 00:34:58.016000000
NUMBER_OF_FRAMES-eng: 65563
NUMBER_OF_BYTES-eng: 100704768
_STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2019-11-02 14:19:53
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:34:58.016000000
Stream #0:2(ger): Subtitle: subrip
Metadata:
BPS-eng : 62
DURATION-eng : 00:33:30.427000000
NUMBER_OF_FRAMES-eng: 392
NUMBER_OF_BYTES-eng: 15624
_STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2019-11-02 14:19:53
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:33:40.687000000
Stream #0:3(eng): Subtitle: subrip (default)
Metadata:
BPS-eng : 60
DURATION-eng : 00:33:23.254000000
NUMBER_OF_FRAMES-eng: 474
NUMBER_OF_BYTES-eng: 15207
_STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2019-11-02 14:19:53
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:33:33.514000000
Stream #0:4(spa): Subtitle: subrip
Metadata:
BPS-eng : 65
DURATION-eng : 00:33:30.177000000
NUMBER_OF_FRAMES-eng: 473
NUMBER_OF_BYTES-eng: 16346
_STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2019-11-02 14:19:53
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:33:40.270000000
Stream #0:5(fre): Subtitle: subrip
Metadata:
BPS-eng : 54
DURATION-eng : 00:33:58.622000000
NUMBER_OF_FRAMES-eng: 463
NUMBER_OF_BYTES-eng: 13880
_STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2019-11-02 14:19:53
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:34:08.841000000
Stream #0:6(por): Subtitle: subrip
Metadata:
title : PT-PT
BPS-eng : 58
DURATION-eng : 00:33:30.135000000
NUMBER_OF_FRAMES-eng: 479
NUMBER_OF_BYTES-eng: 14728
_STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2019-11-02 14:19:53
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:33:40.395000000
Stream #0:7(por): Subtitle: subrip
Metadata:
title : PT-BR
BPS-eng : 52
DURATION-eng : 00:33:30.135000000
NUMBER_OF_FRAMES-eng: 479
NUMBER_OF_BYTES-eng: 13174
_STATISTICS_WRITING_APP-eng: mkvmerge v38.0.0 ('The Silent Type') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2019-11-02 14:19:53
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
DURATION : 00:33:40.395000000
Stream #0:8: Subtitle: subrip
Metadata:
DURATION : 00:34:56.804000000
i tried every way but i can't ( -map -metadata )
i also tried to add the metadata to the separate srt file but the output srt was exactly the same
ffmpeg -i input.srt -metadata language="ita" output.srt
another option I tried
ffmpeg -i 1.mkv -c:s mov_text -metadata:s:0:8 title="italiano" -c:v copy -c:a copy out88.mkv
can you help me?
I have some source Video files with one or more audio streams inside.
I would to encode each source file with Italian language. Then I can do it.
ffmpeg -i source-file.avi -c:v ... -c:a ... -map 0:a:m:language:ita ...
But some source file has audio stream without Language metadata.
I look that it is possible to set Language metadata with "und" special value. Then I try to select the audio stream with this command:
ffmpeg -i source-file.avi -c:v ... -c:a ... -map 0:a:m:language:ita? -map 0:a:m:language:und? ...
(the "?" char say to ffmpeg that he do not fire exception if the audio stream do not exists).
Unfortunatelly this command do not works... It seems that ffmpeg search the "und" language instead of search a audio stream "without" language.
Video MetaData
This is the video MetaData where audio stream do not have language value:
Input #0, matroska,webm, from 'D:\My-Video.mkv':
Metadata:
title : My-Video
encoder : libebml v1.3.3 + libmatroska v1.4.4
creation_time : 2016-01-20T16:02:03.000000Z
Duration: 01:15:28.93, start: 0.000000, bitrate: 2775 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Metadata:
BPS : 2387529
BPS-eng : 2387529
DURATION : 01:15:28.920000000
DURATION-eng : 01:15:28.920000000
NUMBER_OF_FRAMES: 113223
NUMBER_OF_FRAMES-eng: 113223
NUMBER_OF_BYTES : 1351616420
NUMBER_OF_BYTES-eng: 1351616420
_STATISTICS_WRITING_APP: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_DATE_UTC: 2016-01-20 16:02:03
_STATISTICS_WRITING_DATE_UTC-eng: 2016-01-20 16:02:03
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
Metadata:
BPS : 384000
BPS-eng : 384000
DURATION : 01:15:28.928000000
DURATION-eng : 01:15:28.928000000
NUMBER_OF_FRAMES: 141529
NUMBER_OF_FRAMES-eng: 141529
NUMBER_OF_BYTES : 217388544
NUMBER_OF_BYTES-eng: 217388544
_STATISTICS_WRITING_APP: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_DATE_UTC: 2016-01-20 16:02:03
_STATISTICS_WRITING_DATE_UTC-eng: 2016-01-20 16:02:03
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(ita): Subtitle: dvd_subtitle, 720x576 (default)
Metadata:
BPS : 2218
BPS-eng : 2218
DURATION : 01:09:57.232000000
DURATION-eng : 01:09:57.232000000
NUMBER_OF_FRAMES: 965
NUMBER_OF_FRAMES-eng: 965
NUMBER_OF_BYTES : 1163769
NUMBER_OF_BYTES-eng: 1163769
_STATISTICS_WRITING_APP: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_DATE_UTC: 2016-01-20 16:02:03
_STATISTICS_WRITING_DATE_UTC-eng: 2016-01-20 16:02:03
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Can someone help me?
Thanks!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am struggling with the instruction provided to convert a 4k Movie to 1080p so I can run it easier on my plex server.
I have a Geforce 1080Ti and have enable cuda and all the necessary options when building ffmpeg.
I keep getting a weird error and I am stuck at the below point.
Here is my code that I am working on currently
REM #ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
COLOR 0A
TITLE CONVERT 4K TO 1080P USING GEFORCE HW
PUSHD "%~dp0"
SET "FF=C:\MAB\local64\bin-video\ffmpeg.exe"
FOR /R %%G IN (*.mkv) DO (
"%FF%" -hide_banner -hwaccel cuda -y -i "%%~dpnG.mkv" -c:v h264_nvenc -preset slow -pix_fmts yuv420p10le -vf scale='1920:-1' -c:a copy "%%~dpnG(1080p).mkv"
)
ECHO.
PAUSE
EXIT
below is the error output I get when running the above command
Guessed Channel Layout for Input Stream #0.1 : 5.1
Input #0, matroska,webm, from 'Mulan_2020.mkv':
Metadata:
title : mandtv.net
encoder : libebml v1.4.0 + libmatroska v1.6.2
creation_time : 2020-09-10T05:08:02.000000Z
Duration: 01:55:08.70, start: 0.000000, bitrate: 16704 kb/s
Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x1608 [SAR 1:1 DAR 160:67], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
BPS-eng : 15933746
DURATION-eng : 01:55:08.652000000
NUMBER_OF_FRAMES-eng: 165642
NUMBER_OF_BYTES-eng: 13760089087
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp (default) (forced)
Metadata:
title : En
BPS-eng : 768000
DURATION-eng : 01:55:08.704000000
NUMBER_OF_FRAMES-eng: 215897
NUMBER_OF_BYTES-eng: 663235584
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Subtitle: subrip
Metadata:
title : English
BPS-eng : 35
DURATION-eng : 01:50:28.504000000
NUMBER_OF_FRAMES-eng: 1150
NUMBER_OF_BYTES-eng: 29135
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:3(ger): Subtitle: subrip
Metadata:
title : de
BPS-eng : 2
DURATION-eng : 00:03:07.062000000
NUMBER_OF_FRAMES-eng: 2
NUMBER_OF_BYTES-eng: 53
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:4(ger): Subtitle: subrip
Metadata:
title : de
BPS-eng : 27
DURATION-eng : 01:54:16.482000000
NUMBER_OF_FRAMES-eng: 933
NUMBER_OF_BYTES-eng: 23256
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:5(fre): Subtitle: subrip
Metadata:
title : fr
BPS-eng : 0
DURATION-eng : 01:40:51.510000000
NUMBER_OF_FRAMES-eng: 21
NUMBER_OF_BYTES-eng: 380
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:6(fre): Subtitle: subrip
Metadata:
title : fr
BPS-eng : 29
DURATION-eng : 01:54:19.902000000
NUMBER_OF_FRAMES-eng: 806
NUMBER_OF_BYTES-eng: 25098
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:7(spa): Subtitle: subrip
Metadata:
title : es
BPS-eng : 2
DURATION-eng : 00:03:21.201000000
NUMBER_OF_FRAMES-eng: 3
NUMBER_OF_BYTES-eng: 73
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:8(spa): Subtitle: subrip
Metadata:
title : es
BPS-eng : 30
DURATION-eng : 01:43:53.693000000
NUMBER_OF_FRAMES-eng: 783
NUMBER_OF_BYTES-eng: 24134
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:9(ita): Subtitle: subrip
Metadata:
title : it
BPS-eng : 2
DURATION-eng : 00:03:08.522000000
NUMBER_OF_FRAMES-eng: 2
NUMBER_OF_BYTES-eng: 67
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:10(ita): Subtitle: subrip
Metadata:
title : it
BPS-eng : 27
DURATION-eng : 01:54:16.649000000
NUMBER_OF_FRAMES-eng: 784
NUMBER_OF_BYTES-eng: 23506
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:11(por): Subtitle: subrip
Metadata:
title : pt
BPS-eng : 27
DURATION-eng : 01:54:16.649000000
NUMBER_OF_FRAMES-eng: 784
NUMBER_OF_BYTES-eng: 23202
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:12(por): Subtitle: subrip
Metadata:
title : pt
BPS-eng : 2
DURATION-eng : 00:03:08.522000000
NUMBER_OF_FRAMES-eng: 2
NUMBER_OF_BYTES-eng: 61
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:13(rus): Subtitle: subrip (default)
Metadata:
title : ru
BPS-eng : 0
DURATION-eng : 01:37:43.480000000
NUMBER_OF_FRAMES-eng: 9
NUMBER_OF_BYTES-eng: 420
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:14(rus): Subtitle: subrip
Metadata:
title : ru
BPS-eng : 50
DURATION-eng : 01:44:17.000000000
NUMBER_OF_FRAMES-eng: 850
NUMBER_OF_BYTES-eng: 39721
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:15(ukr): Subtitle: subrip
Metadata:
title : uk
BPS-eng : 50
DURATION-eng : 01:43:53.650000000
NUMBER_OF_FRAMES-eng: 848
NUMBER_OF_BYTES-eng: 39165
_STATISTICS_WRITING_APP-eng: mkvmerge v50.0.0 ('Awakenings') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-09-10 05:08:02
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_nvenc))
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (subrip (srt) -> ass (ssa))
Press [q] to stop, [?] for help
[h264_nvenc # 000002306685ccc0] 10 bit encode not supported
[h264_nvenc # 000002306685ccc0] Provided device doesn't support required NVENC features
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
Can anyone spot what I'm missing?
#ECHO OFF
SETLOCAL
COLOR 0A
TITLE CONVERT 4K TO 1080P WITH GEFORCE HW ACCELERATION
:---------------------------------------------------------------------------------
REM CHANGE WORKING DIRECTORY TO THE SCRIPT'S DIRECTORY
PUSHD "%~dp0"
:---------------------------------------------------------------------------------
REM MAXIMIZE CMD WINDOW
IF NOT "%1"=="MAX" START /MAX CMD /D /C %0 MAX & EXIT /B
:---------------------------------------------------------------------------------
REM POINT FF VAR TO FFMPEG.EXE'S FULL PATH
SET "FF=C:\MAB\local64\bin-video\ffmpeg.exe"
REM RECURSIVELY SEARCH FOR VIDEO IN THE WORKING DIRECTORY
FOR /R %%G IN (*.mkv) DO (
"%FF%" -hide_banner -hwaccel cuda -y -i "%%~dpnG.mkv" -c:v nvenc_hevc -preset p7 -tune hq -vf scale='1920:-1' -c:a copy "%%~dpnG(1080p).mkv"
)
:---------------------------------------------------------------------------------
REM CHANGE THE COLOR OF THE CMD WINDOW WHEN FFMPEG HAS FINISHED
COLOR 0E
ECHO=
ECHO FFMPEG HAS FINISHED & ECHO=
PAUSE
I tried with several videos but I am encountering the same error as:
'Output file #0 does not contain any stream'
if soft sub
ffmpeg -hide_banner -i 1.mkv
.
Input #0, matroska,webm, from '1.mkv':
Metadata:
encoder : libebml v1.3.6 + libmatroska v1.4.9
creation_time : 2020-06-27T08:04:52.000000Z
Duration: 01:02:06.37, start: 0.000000, bitrate: 662 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
Metadata:
BPS-eng : 500501
DURATION-eng : 01:02:05.834000000
NUMBER_OF_FRAMES-eng: 89420
NUMBER_OF_BYTES-eng: 233098262
_STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-06-27 08:04:52
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Subtitle: subrip
Metadata:
title : English#BonsaiHD.Fun
BPS-eng : 25
DURATION-eng : 01:01:07.500000000
NUMBER_OF_FRAMES-eng: 449
NUMBER_OF_BYTES-eng: 11798
_STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-06-27 08:04:52
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Subtitle: subrip (default) (forced)
Metadata:
title : English_Forced##BonsaiHD.Fun
BPS-eng : 1
DURATION-eng : 00:57:12.917000000
NUMBER_OF_FRAMES-eng: 21
NUMBER_OF_BYTES-eng: 448
_STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-06-27 08:04:52
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:3(eng): Subtitle: subrip
Metadata:
title : English#BonsaiHD.Fun
BPS-eng : 36
DURATION-eng : 00:57:14.833000000
NUMBER_OF_FRAMES-eng: 594
NUMBER_OF_BYTES-eng: 15793
_STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-06-27 08:04:52
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:4(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 160 kb/s (default)
Metadata:
BPS-eng : 160000
DURATION-eng : 01:02:06.368000000
NUMBER_OF_FRAMES-eng: 116449
NUMBER_OF_BYTES-eng: 74527360
_STATISTICS_WRITING_APP-eng: mkvmerge v31.0.0 ('Dolores In A Shoestand') 64-bit
_STATISTICS_WRITING_DATE_UTC-eng: 2020-06-27 08:04:52
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
this video has 5 streams; 0:0 is video & 0:4 is audio & 0:1, 0:2, 0:3 are subtitles
to extract the sub in 0:1 stream in my file 1.mkv to subtitle1.ass or subtitle1.srt file
ffmpeg -v error -stats -i 1.mkv -vn -an -map 0:1 subtitle1.ass
STEP 1 : First list all the audio stream
STEP 2 : ffmpeg -i VIDEO.mkv, ffmpeg -i input.mkv
STEP 3 : Compile the command to extract the audio track
I need to extract metadata track from a MP4 file and save as separate file. I see that, using ffmpeg I can extract standard tracks like Audio or Video or Subtitle track and save it as a new file. For ex: to save audio track I use the command below:
ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac
But my need is to save a proprietary metadata track. Any pointers will be helpful.
Here is output of ffmpeg to know different traks that are present in the file. Particuarly, I am interested in extracting track corresponding to Stream #0:3(eng)...
C:\Users\rkumar\Documents\work\tools\ffmpeg\bin>ffmpeg.exe -i input.MP4
ffmpeg version N-57176-g64b3aaf Copyright (c) 2000-2013 the FFmpeg developers
built on Oct 15 2013 21:32:52 with gcc 4.8.1 (GCC)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.MP4':
Metadata:
major_brand : mp41
minor_version : 538120216
compatible_brands: mp41
creation_time : 1970-01-01 00:00:09
Duration: 00:00:10.52, start: 0.000000, bitrate: 834 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc, bt709),
854x480 [SAR 1:1 DAR 427:240], 679 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
Metadata:
creation_time : 1970-01-01 00:00:09
handler_name : AVC
timecode : 00:00:13:22
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:09
handler_name : AAC
timecode : 00:00:13:22
Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:09
handler_name : TCD
timecode : 00:00:13:22
Stream #0:3(eng): Data: none (ssmd / 0x646D7067), 5 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:09
handler_name : MET
Stream #0:4(eng): Data: none (fdsc / 0x63736466), 10 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:09
handler_name : SOS
You can extract the meta data track with ffmpeg:
ffmpeg -i input-video.avi -map 0:1 -c copy -copy_unknown -f data data.bin
This will save the meta data in data.bin which is a binary file so there will be some additional processing required to get the data out.