GNOME Bugzilla – Bug 764714
Android: Discrepancy with SPS/PPS syntax of hardware encoder (omxqcomvideoencoderavc)
Last modified: 2018-05-01 06:58:22 UTC
Hi Everyone, I've found discrepancy between media stream generated with gstreamer release 1.8 and gstreamer release 1.4. Video stream generated with 1.4 (Pls refer media file 20160406_152750_1_4_GST) has single sps/pps in first NALU where as video stream generated with 1.8(Pls refer media file 20160406_152401_1_8_GST) has repeated sps/pps in first NALU unit. Video stream 20160406_152750_1_4_GST playbacks smoothly on all android media players and 20160406_152401_1_8_GST playback only with native player of the device(Samsung S4) also with VLC player and failed to playback with other media players like Google Photos. I've validate the syntax of NALU with iso-viewer. Media Files Link: https://s3-eu-west-1.amazonaws.com/ccstaticfiles/20160406_152401_1_8_GST.mp4 https://s3-eu-west-1.amazonaws.com/ccstaticfiles/20160406_152750_1_4_GST.mp4 Hardware encoder: omxqcomvideoencoderavc Pipeline: sprintf(gst_launch_pipeline, "filesrc location=%s ! qtdemux name=demux demux.audio_0 ! queue max-size-time=5000000000 ! audio/mpeg,mpegversion=4 ! mp4mux name=mux ! filesink name=sink location=%s demux.video_0 ! h264parse ! amcviddec-omxqcomvideodecoderavc ! queue ! video/x-raw,width=%ld,height=%ld,format=\(string\)NV12 ! amcvidenc-omxqcomvideoencoderavc bitrate=%ld i-frame-interval=2 ! video/x-h264 ! queue max-size-bytes=0 max-size-buffers=0 max-size-time=0 ! h264parse ! mux.video_0", input_file, output_file, (int)data->width, (int)data->height, targetBitrate); Testing Environment: Android Versions: 5.0 and 4.3 Device: Samsung Galaxy S4 GT -I9506 SoC: Qualcomm Sanpdragon 800 2.27 GHz Cores: 4 Thanks, -Uma
Does it work better without the h264parse after the encoder? With duplicated SPS/PPS, you mean there's SPS/PPS in the beginning and then right after that again SPS/PPS and then the first frame? Or do you mean SPS/PPS is repeated before every keyframe but there's not SPS/PPS followed by SPS/PPS?
Hi Sebastian, Pipeline not works without h264parse after encoder. Here duplicated SPS/PPS means there's SPS/PPS in the beginning and then right after that again SPS/PPS and then the first frame. For reference I've attached the snapshot of isoviewer. You can see AvcSample(0) has repeated SPS/PPS
Created attachment 325790 [details] Snapshot of isoviewer parse AvcSample(0) has repeated SPS/PPS
You mean it *now* works without h264parse? Or it does *not* work?
No confusion. without h264parser pipeline does not works. E/GStreamer+GST_PIPELINE(17394): 0:00:01.469155416 0xa03bdd80 ./grammar.y:642:gst_parse_perform_link could not link queue2 to mux W/art (17394): Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[12,tid=17446,Native,Thread*=0x9ef44400,peer=0x12f32080,"Thread-8233"] I/videotranscoder(17394): Transcoding of /storage/emulated/0/DCIM/Camera/20160406_152401.mp4 not successful. Please find attached detail log(764714.log)
Created attachment 325796 [details] Gstreamer log without h264parser after encoder
No updates in 2 years. Decoders requires parsers to work. Closing.