FFmpeg converting to .265 corrupts videos - react-native

I'm trying to convert and compress videos in React Native using FFmpegKit, what is strange is it is very slow regardless of the preset I use, Also, no matter how big the input video is, it always produces a video less than 1MB that is corrupt.
This is my first time using FFmpeg, I'm using it due to the lack of good video compressing libraries on React Native.
My command looks like this:
const getFFmpegCommand = (input: string, output: string) => {
const scale = `"scale='if(gte(iw,ih),min(720,iw),-2):if(lt(iw,ih),min(720,ih),-2)'"`;
const preset = '-preset veryfast ';
const ffmpegCommand = `-i ${input} -y -crf 28 -vf ${scale} ${preset} -c:v libx265 ${output}`;
return ffmpegCommand;
};
This is my log output
ffmpeg version v4.5-dev-3393-g30322ebe3c
LOG Copyright (c) 2000-2021 the FFmpeg developers
LOG
LOG built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
LOG configuration: --cross-prefix=i686-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/storage/light/projects/ffmpeg-kit/prebuilt/android-x86/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=i686 --cpu=i686 --target-os=android --disable-neon --disable-asm --disable-inline-asm --ar=i686-linux-android-ar --cc=i686-linux-android24-clang --cxx=i686-linux-android24-clang++ --ranlib=i686-linux-android-ranlib --strip=i686-linux-android-strip --nm=i686-linux-android-nm --extra-libs='-L/storage/light/projects/ffmpeg-kit/prebuilt/android-x86/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libx264 --enable-libxvid --enable-libx265 --enable-libvidstab --disable-sdl2 --disable-openssl --enable-zlib --enable-mediacodec --enable-gpl
LOG libavutil 57. 13.100 / 57. 13.100
LOG libavcodec 59. 15.102 / 59. 15.102
LOG libavformat 59. 10.100 / 59. 10.100
LOG libavdevice 59. 1.100 / 59. 1.100
LOG libavfilter 8. 21.100 / 8. 21.100
LOG libswscale 6. 1.102 / 6. 1.102
LOG libswresample 4. 0.100 / 4. 0.100
LOG Guessed Channel Layout for Input Stream #0.1 : mono
LOG Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:///data/user/0/com.orbis.cybersight/files/95fdb965-5074-421f-b6b0-9e67332550ca/VID_20220625_211041.mp4':
LOG Metadata:
LOG major_brand :
LOG mp42
LOG
LOG minor_version :
LOG 0
LOG
LOG compatible_brands:
LOG isommp42
LOG
LOG creation_time :
LOG 2022-06-25T19:11:17.000000Z
LOG
LOG location :
LOG +37.4234-122.0839/
LOG
LOG location-eng :
LOG +37.4234-122.0839/
LOG
LOG com.android.version:
LOG 11
LOG
LOG Duration:
LOG 00:00:33.68
LOG , start:
LOG 0.000000
LOG , bitrate:
LOG 8302 kb/s
LOG
LOG Stream #0:0
LOG [0x1]
LOG (eng)
LOG : Video: h264 (avc1 / 0x31637661), yuv420p(tv, gbr/reserved/reserved, progressive), 1280x720, 9007 kb/s
LOG , SAR 1:1 DAR 16:9
LOG ,
LOG 22.69 fps,
LOG 90k tbr,
LOG 90k tbn
LOG (default)
LOG
LOG Metadata:
LOG creation_time :
LOG 2022-06-25T19:11:17.000000Z
LOG
LOG handler_name :
LOG VideoHandle
LOG
LOG vendor_id :
LOG [0][0][0][0]
LOG
LOG Side data:
LOG
LOG displaymatrix: rotation of -90.00 degrees
LOG
LOG Stream #0:1
LOG [0x2]
LOG (eng)
LOG : Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, fltp, 12 kb/s
LOG (default)
LOG
LOG Metadata:
LOG creation_time :
LOG 2022-06-25T19:11:17.000000Z
LOG
LOG handler_name :
LOG SoundHandle
LOG
LOG vendor_id :
LOG [0][0][0][0]
LOG
LOG [h264 # 0xebd4c280] The "sub_text_format" option is deprecated: Deprecated, does nothing
LOG [amrnb # 0xebd4dc00] The "sub_text_format" option is deprecated: Deprecated, does nothing
LOG Stream mapping:
LOG Stream #0:0 -> #0:0
LOG (h264 (native) -> hevc (libx265))
LOG
LOG Stream #0:1 -> #0:1
LOG (amr_nb (amrnb) -> aac (native))
LOG
LOG Press [q] to stop, [?] for help
LOG [aac # 0xebd4a5d0] Too many bits 8832.000000 > 6144 per frame requested, clamping to max
LOG Output #0, mp4, to '/storage/emulated/0/Android/data/com.orbis.cybersight/files/3dfb9ef6-6cb3-4adf-9777-8fb4c7762dc7.mp4':
LOG Metadata:
LOG major_brand :
LOG mp42
LOG
LOG minor_version :
LOG 0
LOG
LOG compatible_brands:
LOG isommp42
LOG
LOG com.android.version:
LOG 11
LOG
LOG location :
LOG +37.4234-122.0839/
LOG
LOG location-eng :
LOG +37.4234-122.0839/
LOG
LOG encoder :
LOG Lavf59.10.100
LOG
LOG Stream #0:0
LOG (eng)
LOG : Video: hevc (hev1 / 0x31766568), yuv420p(tv, gbr/reserved/reserved, progressive), 720x1280 [SAR 1:1 DAR 9:16], q=2-31
LOG ,
LOG 22.69 fps,
LOG 2502k tbn
LOG (default)
LOG
LOG Metadata:
LOG creation_time :
LOG 2022-06-25T19:11:17.000000Z
LOG
LOG handler_name :
LOG VideoHandle
LOG
LOG vendor_id :
LOG [0][0][0][0]
LOG
LOG encoder :
LOG Lavc59.15.102 libx265
LOG
LOG Side data:
LOG
LOG cpb:
LOG bitrate max/min/avg: 0/0/0 buffer size: 0
LOG vbv_delay: N/A
LOG
LOG
LOG displaymatrix: rotation of -0.00 degrees
LOG
LOG Stream #0:1
LOG (eng)
LOG : Audio: aac (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 48 kb/s
LOG (default)
LOG
LOG Metadata:
LOG creation_time :
LOG 2022-06-25T19:11:17.000000Z
LOG
LOG handler_name :
LOG SoundHandle
LOG
LOG vendor_id :
LOG [0][0][0][0]
LOG
LOG encoder :
LOG Lavc59.15.102 aac

Related

Filebeat does not complete on close_eof + --once

Using filebeat 7.5.2:
I'm using a filebeat configuration with close_eof enabled and I run filebeat with the flag --once. I can see the harvester reaching eof but the filebeat keeps going.
Flebeat conf:
filebeat.inputs:
- type: log
close_eof: true
enabled: true
paths:
- "${LOGS_PATH}"
scan_frequency: 1s
fields: {
machine: "${HOST}"
}
output.logstash:
hosts: ["192.168.41.6:5044"]
bulk_max_size: 1024
timeout: 30s
pipelining: 1
workers: 1
And I run it using:
filebeat run --once -v -c "PATH TO CONF..."
And some logs from the filebeat instance:
...
2020-02-04T18:30:16.950Z INFO instance/beat.go:297 Setup Beat: filebeat; Version: 7.5.2
2020-02-04T18:30:17.059Z INFO [publisher] pipeline/module.go:97 Beat name: logstash
2020-02-04T18:30:17.167Z WARN beater/filebeat.go:152 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch out
put is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2020-02-04T18:30:17.168Z INFO instance/beat.go:429 filebeat start running.
2020-02-04T18:30:17.168Z INFO [monitoring] log/log.go:118 Starting metrics logging every 30s
2020-02-04T18:30:17.168Z INFO registrar/migrate.go:104 No registry home found. Create: /tmp/tmp.BXJtfiaEzb/data/registry/filebeat
2020-02-04T18:30:17.179Z INFO registrar/migrate.go:112 Initialize registry meta file
2020-02-04T18:30:17.192Z INFO registrar/registrar.go:108 No registry file found under: /tmp/tmp.BXJtfiaEzb/data/registry/filebeat/data.json. Creating a new re
gistry file.
2020-02-04T18:30:17.193Z INFO registrar/registrar.go:145 Loading registrar data from /tmp/tmp.BXJtfiaEzb/data/registry/filebeat/data.json
2020-02-04T18:30:17.193Z INFO registrar/registrar.go:152 States Loaded from registrar: 0
2020-02-04T18:30:17.193Z WARN beater/filebeat.go:368 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch out
put is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2020-02-04T18:30:17.193Z INFO crawler/crawler.go:72 Loading Inputs: 1
2020-02-04T18:30:17.194Z INFO log/input.go:152 Configured paths: [/tmp/tmp.BXJtfiaEzb/*.log]
2020-02-04T18:30:17.206Z INFO input/input.go:114 Starting input of type: log; ID: 13918413832820009056
2020-02-04T18:30:17.225Z INFO input/input.go:167 Stopping Input: 13918413832820009056
2020-02-04T18:30:17.225Z INFO crawler/crawler.go:106 Loading and starting Inputs completed. Enabled inputs: 1
2020-02-04T18:30:17.225Z INFO log/harvester.go:251 Harvester started for file: /tmp/tmp.BXJtfiaEzb/dcbgw-20200124080032_darkblue.log
2020-02-04T18:30:17.231Z INFO beater/filebeat.go:384 Running filebeat once. Waiting for completion ...
2020-02-04T18:30:17.231Z INFO beater/filebeat.go:386 All data collection completed. Shutting down.
2020-02-04T18:30:17.231Z INFO crawler/crawler.go:139 Stopping Crawler
2020-02-04T18:30:17.231Z INFO crawler/crawler.go:149 Stopping 1 inputs
2020-02-04T18:30:17.258Z INFO pipeline/output.go:95 Connecting to backoff(async(tcp://192.168.41.6:5044))
2020-02-04T18:30:17.296Z INFO pipeline/output.go:105 Connection to backoff(async(tcp://192.168.41.6:5044)) established
... Only metrics here ...
2020-02-04T18:35:55.686Z INFO log/harvester.go:274 End of file reached: /tmp/tmp.BXJtfiaEzb/dcbgw-20200124080032_darkblue.log. Closing because close_eof is enabled.
2020-02-04T18:35:55.686Z INFO crawler/crawler.go:165 Crawler stopped
... MORE METRICS ...
2020-02-04T18:36:26.609Z ERROR logstash/async.go:256 Failed to publish events caused by: read tcp 192.168.41.6:49662->192.168.41.6:5044: i/o timeout
2020-02-04T18:36:26.621Z ERROR logstash/async.go:256 Failed to publish events caused by: client is not connected
2020-02-04T18:36:28.520Z ERROR pipeline/output.go:121 Failed to publish events: client is not connected
2020-02-04T18:36:28.520Z INFO pipeline/output.go:95 Connecting to backoff(async(tcp://192.168.41.6:5044))
2020-02-04T18:36:28.521Z INFO pipeline/output.go:105 Connection to backoff(async(tcp://192.168.41.6:5044)) established
... MORE METRICS ...
From this I'm outputing this to Logstash 7.5.2 running in the same Ubuntu 18 VM. Running Logstash with log level trace does not output any error.

Filebeat not starting TCP server (input)

So I have configured filebeat to accept input via TCP. This is filebeat.yml file.
filebeat.inputs:
- type: tcp
host: ["localhost:9000"]
max_message_size: 20MiB
For some reason filebeat does not start the TCP server at port 9000. I have verified this using wireshark. Wireshark shows nothing at port 9000.
This is output of command "filebeat -e -d "*"" run on terminal
2019-08-14T09:12:40.745-0600 INFO instance/beat.go:468 Home path: [/usr/local/Cellar/filebeat/6.2.4] Config path: [/usr/local/etc/filebeat] Data path: [/usr/local/var/lib/filebeat] Logs path: [/usr/local/var/log/filebeat]
2019-08-14T09:12:40.745-0600 DEBUG [beat] instance/beat.go:495 Beat metadata path: /usr/local/var/lib/filebeat/meta.json
2019-08-14T09:12:40.745-0600 INFO instance/beat.go:475 Beat UUID: 764da0fd-ea93-4777-b1ea-63149be0d6b6
2019-08-14T09:12:40.745-0600 INFO instance/beat.go:213 Setup Beat: filebeat; Version: 6.2.4
2019-08-14T09:12:40.745-0600 DEBUG [beat] instance/beat.go:230 Initializing output plugins
2019-08-14T09:12:40.745-0600 DEBUG [processors] processors/processor.go:49 Processors:
2019-08-14T09:12:40.745-0600 INFO pipeline/module.go:76 Beat name: Ad-MBP.domain
2019-08-14T09:12:40.745-0600 ERROR fileset/modules.go:95 Not loading modules. Module directory not found: /usr/local/Cellar/filebeat/6.2.4/module
2019-08-14T09:12:40.745-0600 INFO [monitoring] log/log.go:97 Starting metrics logging every 30s
2019-08-14T09:12:40.745-0600 INFO instance/beat.go:301 filebeat start running.
2019-08-14T09:12:40.745-0600 DEBUG [registrar] registrar/registrar.go:90 Registry file set to: /usr/local/var/lib/filebeat/registry
2019-08-14T09:12:40.746-0600 INFO registrar/registrar.go:110 Loading registrar data from /usr/local/var/lib/filebeat/registry
2019-08-14T09:12:40.746-0600 INFO registrar/registrar.go:121 States Loaded from registrar: 0
2019-08-14T09:12:40.746-0600 WARN beater/filebeat.go:261 Filebeat is unable to load the Ingest Node pipelines for the configured modules because the Elasticsearch output is not configured/enabled. If you have already loaded the Ingest Node pipelines or are using Logstash pipelines, you can ignore this warning.
2019-08-14T09:12:40.746-0600 INFO crawler/crawler.go:48 Loading Prospectors: 1
2019-08-14T09:12:40.746-0600 DEBUG [registrar] registrar/registrar.go:152 Starting Registrar
2019-08-14T09:12:40.746-0600 DEBUG [cfgfile] cfgfile/reload.go:95 Checking module configs from: /usr/local/etc/filebeat/modules.d/*.yml
2019-08-14T09:12:40.746-0600 DEBUG [cfgfile] cfgfile/reload.go:109 Number of module configs found: 0
2019-08-14T09:12:40.746-0600 INFO crawler/crawler.go:82 Loading and starting Prospectors completed. Enabled prospectors: 0
2019-08-14T09:12:40.746-0600 INFO cfgfile/reload.go:127 Config reloader started
2019-08-14T09:12:40.748-0600 DEBUG [cfgfile] cfgfile/reload.go:151 Scan for new config files
2019-08-14T09:12:40.748-0600 DEBUG [cfgfile] cfgfile/reload.go:170 Number of module configs found: 0
2019-08-14T09:12:40.748-0600 INFO cfgfile/reload.go:219 Loading of config files completed.
I am not sure what I am doing wrong..
I believe filebeat inputs are only available from filebeat 6.3+, anything older used filebeat prospectors.
6.3 TCP input documentation, nothing available for 6.2 or older as it uses prospectors:
https://www.elastic.co/guide/en/beats/filebeat/6.3/filebeat-input-tcp.html
Your logs show that you are on filebeat version 6.24, could you try out your configuration with 6.3+?

ffmpeg error SSL routines:ssl3_write_pending:bad write retry

Recently, I see this error very often. Does anyone know what the error is and how to fix ? Please check full ffmpeg output here ( I already update openssl latest version from yum )
ffmpeg version N-93715-gd0e4d04 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: --prefix= ....
Input #0, mpegts, from '/tmp/4028813_video_0.ts':
Duration: 00:04:08.19, start: 1.410111, bitrate: 1504 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 608x1080 [SAR 1:1 DAR 76:135], 30 fps, 30 tbr, 90k tbn, 60 tbc
Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 121 kb/s
[ sh: 2019-05-06 9:39:46 ]
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, flv, to 'rtmps://live-api-s.facebook.com:443/rtmp/289693778580218?s_bl=1&s_sw=0&s_vt=api-s&a=Abxj1aU9OTqh0RtS':
Metadata:
comment : gs4028813
encoder : Lavf58.27.103
Stream #0:0: Video: h264 (High) ([7][0][0][0] / 0x0007), yuv420p(tv, bt709, progressive), 608x1080 [SAR 1:1 DAR 76:135], q=2-31, 3000 kb/s, 30 fps, 30 tbr, 1k tbn, 30 tbc
Stream #0:1(eng): Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc58.52.100 aac
[ sh: 2019-05-06 9:39:47 ]size= 169kB time=00:00:00.52 bitrate=2643.9kbits/s speed=1.03x
......
[ sh: 2019-05-06 9:40:10 ]size= 3386kB time=00:00:22.72 bitrate=1220.7kbits/s speed=0.999x
[ sh: 2019-05-06 9:40:11 ]size= 3842kB time=00:00:25.32 bitrate=1242.9kbits/s speed= 1x
[tls # 0x30ab3c0] error:00000000:lib(0):func(0):reason(0)82 bitrate=1247.3kbits/s speed= 1x
av_interleaved_write_frame(): Input/output error
[flv # 0x3030f80] Failed to update header with correct duration.
[flv # 0x3030f80] Failed to update header with correct filesize.
Error writing trailer of rtmps://live-api-s.facebook.com:443/rtmp/289693778580218?s_bl=1&s_sw=0&s_vt=api-s&a=Abxj1aU9OTqh0RtS: Input/output error
frame= 776 fps= 30 q=-1.0 Lsize= 3932kB time=00:00:25.82 bitrate=1247.3kbits/s speed= 1x
video:3530kB audio:406kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[tls # 0x30ab3c0] error:1409F07F:SSL routines:ssl3_write_pending:bad write retry
This error normally indicates a bug in the program calling OpenSSL. When an application using OpenSSL attempts to write application data to an SSL/TLS connection using the "SSL_write" function it may be unable to complete the write in one go (for example because the underlying network buffers are full). In this case a recoverable "retry" error occurs. The application is supposed to retry the write with exactly the same data as last time. If the calling application retries the write with different data then you get the "bad write retry" message (a fatal error). As to how to fix it that unfortunately depends on identifying the bug in the calling application and ensuring that retries are only ever performed with exactly the same data.

ffmpeg h.246 plays locally in Safari, but not when hosted on s3 bucket

ffmpeg h.246 plays locally in Safari, but not when hosted on s3 bucket.
I thought it was therefore a problem with S3, however a friend has sent me an .mp4 of the same file converted with Zencoder's service and this works perfectly, which surely means it must be a problem with my encoding settings in ffmpeg?
I'm using the settings recommended for maximum compatibility:
ffmpeg -an -i mov-input-02.mov -vcodec libx264 -filter:v scale="1400:trunc(ow/a/2)*2" -movflags +faststart -pix_fmt yuv420p -profile:v baseline mov-output-02-1400.mp4
Additionally, the .webm files I'm converting with ffmpeg all work perfectly in Chrome, Firefox, Opera etc.!
I would really appreciate any thoughts.
The video that works from Zencoder has this metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1mp42
creation_time : 2018-06-01T11:24:54.000000Z
Duration: 00:00:10.97, start: 0.000000, bitrate: 396 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1800x1200 [SAR 1:1 DAR 3:2], 394 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)
Metadata:
creation_time : 2018-06-01T11:24:49.000000Z
While my videos from ffmpeg which don't work have this metadata:
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.12.100
Duration: 00:00:10.97, start: 0.000000, bitrate: 184 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1400x932 [SAR 699:700 DAR 3:2], 182 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
timecode : 00:00:00:01
Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
Metadata:
handler_name : TimeCodeHandler
timecode : 00:00:00:01
Unsupported codec with id 0 for input stream 1
Here's the full output from conversion:
Tempuras-iMac:2018.06.05 tempura$ ffmpeg -an -i mov-input-01.mov -vcodec l Tempuras-iMac:2018.06.05 tempura$ ffmpeg -an -i mov-input-02.mov -vcodec libx264 -filter:v scale="1400:trunc(ow/a/2)*2" -movflags +faststart -pix_fmt yuv420p -profile:v baseline -level 3 mov-output-02-1400.mp4
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.42)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'mov-input-02.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2018-05-09T09:59:58.000000Z
Duration: 00:00:10.97, start: 0.000000, bitrate: 114375 kb/s
Stream #0:0(eng): Video: qtrle (rle / 0x20656C72), rgb24(progressive), 2700x1800, 113610 kb/s, SAR 1:1 DAR 3:2, 30 fps, 30 tbr, 30 tbn, 30 tbc (default)
Metadata:
creation_time : 2018-05-09T09:59:58.000000Z
handler_name : Apple Alias Data Handler
encoder : Animation
timecode : 00:00:00:01
Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
creation_time : 2018-05-09T09:59:58.000000Z
handler_name : Apple Alias Data Handler
timecode : 00:00:00:01
Stream mapping:
Stream #0:0 -> #0:0 (qtrle (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 # 0x7fac39004200] using SAR=699/700
[libx264 # 0x7fac39004200] frame MB size (88x59) > level limit (1620)
[libx264 # 0x7fac39004200] MB rate (155760) > level limit (40500)
[libx264 # 0x7fac39004200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0x7fac39004200] profile Constrained Baseline, level 3.0
[libx264 # 0x7fac39004200] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 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, mp4, to 'mov-output-02-1400.mp4':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
encoder : Lavf58.12.100
Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1400x932 [SAR 699:700 DAR 3:2], q=-1--1, 0.03 fps, 15360 tbn, 30 tbc (default)
Metadata:
creation_time : 2018-05-09T09:59:58.000000Z
handler_name : Apple Alias Data Handler
timecode : 00:00:00:01
encoder : Lavc58.18.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[mp4 # 0x7fac39003000] Starting second pass: moving the moov atom to the beginning of the file
frame= 329 fps= 42 q=-1.0 Lsize= 248kB time=00:00:10.93 bitrate= 185.5kbits/s speed= 1.4x
video:245kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.042892%
[libx264 # 0x7fac39004200] frame I:2 Avg QP:15.82 size: 34370
[libx264 # 0x7fac39004200] frame P:327 Avg QP:16.88 size: 555
[libx264 # 0x7fac39004200] mb I I16..4: 76.8% 0.0% 23.2%
[libx264 # 0x7fac39004200] mb P I16..4: 0.5% 0.0% 0.2% P16..4: 0.7% 0.2% 0.1% 0.0% 0.0% skip:98.3%
[libx264 # 0x7fac39004200] coded y,uvDC,uvAC intra: 14.3% 0.1% 0.1% inter: 0.2% 0.0% 0.0%
[libx264 # 0x7fac39004200] i16 v,h,dc,p: 57% 39% 3% 0%
[libx264 # 0x7fac39004200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 41% 24% 20% 2% 3% 3% 2% 3% 1%
[libx264 # 0x7fac39004200] i8c dc,h,v,p: 100% 0% 0% 0%
[libx264 # 0x7fac39004200] kb/s:182.53

linux how to show video to webcam

I am trying the following command, so that my webcam shows a video when i access it from network or android emulator.
I am using archlinux. I have installed v4l2loopback-dkms. and added the module to the kernel. then i launched
gst-launch-0.10 filesrc location=/home/simha/1.3gp ! decodebin2 ! ffmpegcolorspace ! videoscale ! ffmpegcolorspace ! v4l2sink device=/dev/video0
but no sucess.
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video0' is not a output device.
Additional debug info:
v4l2_calls.c(528): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x85200001
Setting pipeline to NULL ...
Freeing pipeline ...
Also tried:
ffmpeg -f x11grab -r 15 -s 1280x720 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0
but not working
ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-shared --enable-version3 --enable-x11grab
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, x11grab, from ':0.0+0,0':
Duration: N/A, start: 1456374857.672770, bitrate: N/A
Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x720, 15 fps, 15 tbr, 1000k tbn, 15 tbc
[v4l2 # 0x55f5129180a0] ioctl(VIDIOC_G_FMT): Invalid argument
Output #0, v4l2, to '/dev/video0':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, q=2-31, 200 kb/s, 15 fps, 15 tbn, 15 tbc
Metadata:
encoder : Lavc56.60.100 rawvideo
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
You might be using the wrong driver for your webcam.
Use the lsusb command to identify your webcam. Then find out what driver you need to get it working. You can find out more information about this by reading the Webcam Arch Wiki Page